@event4u/agent-config 1.13.0 → 1.15.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 (291) hide show
  1. package/.agent-src/commands/agent-handoff.md +4 -1
  2. package/.agent-src/commands/agent-status.md +3 -0
  3. package/.agent-src/commands/agents-audit.md +4 -0
  4. package/.agent-src/commands/agents-cleanup.md +6 -1
  5. package/.agent-src/commands/agents-prepare.md +3 -0
  6. package/.agent-src/commands/analyze-reference-repo.md +4 -0
  7. package/.agent-src/commands/bug-fix.md +7 -3
  8. package/.agent-src/commands/bug-investigate.md +4 -0
  9. package/.agent-src/commands/chat-history-checkpoint.md +126 -0
  10. package/.agent-src/commands/chat-history-clear.md +6 -1
  11. package/.agent-src/commands/chat-history-resume.md +7 -2
  12. package/.agent-src/commands/chat-history.md +7 -2
  13. package/.agent-src/commands/check-current-md.md +137 -0
  14. package/.agent-src/commands/commit-in-chunks.md +118 -0
  15. package/.agent-src/commands/commit.md +4 -0
  16. package/.agent-src/commands/compress.md +37 -2
  17. package/.agent-src/commands/context-create.md +4 -0
  18. package/.agent-src/commands/context-refactor.md +4 -0
  19. package/.agent-src/commands/copilot-agents-init.md +3 -0
  20. package/.agent-src/commands/copilot-agents-optimize.md +3 -0
  21. package/.agent-src/commands/create-pr-description.md +4 -0
  22. package/.agent-src/commands/create-pr.md +4 -0
  23. package/.agent-src/commands/do-and-judge.md +4 -1
  24. package/.agent-src/commands/do-in-steps.md +3 -0
  25. package/.agent-src/commands/e2e-heal.md +4 -0
  26. package/.agent-src/commands/e2e-plan.md +4 -0
  27. package/.agent-src/commands/estimate-ticket.md +4 -1
  28. package/.agent-src/commands/feature-dev.md +4 -0
  29. package/.agent-src/commands/feature-explore.md +4 -0
  30. package/.agent-src/commands/feature-plan.md +4 -0
  31. package/.agent-src/commands/feature-refactor.md +4 -0
  32. package/.agent-src/commands/feature-roadmap.md +6 -0
  33. package/.agent-src/commands/fix-ci.md +4 -0
  34. package/.agent-src/commands/fix-portability.md +5 -2
  35. package/.agent-src/commands/fix-pr-bot-comments.md +4 -0
  36. package/.agent-src/commands/fix-pr-comments.md +4 -0
  37. package/.agent-src/commands/fix-pr-developer-comments.md +4 -0
  38. package/.agent-src/commands/fix-references.md +3 -0
  39. package/.agent-src/commands/fix-seeder.md +4 -0
  40. package/.agent-src/commands/implement-ticket.md +39 -13
  41. package/.agent-src/commands/jira-ticket.md +4 -0
  42. package/.agent-src/commands/judge.md +3 -0
  43. package/.agent-src/commands/memory-add.md +5 -3
  44. package/.agent-src/commands/memory-full.md +5 -2
  45. package/.agent-src/commands/memory-promote.md +7 -6
  46. package/.agent-src/commands/mode.md +3 -0
  47. package/.agent-src/commands/module-create.md +4 -0
  48. package/.agent-src/commands/module-explore.md +4 -0
  49. package/.agent-src/commands/onboard.md +33 -0
  50. package/.agent-src/commands/optimize-agents.md +4 -0
  51. package/.agent-src/commands/optimize-augmentignore.md +12 -0
  52. package/.agent-src/commands/optimize-rtk-filters.md +3 -0
  53. package/.agent-src/commands/optimize-skills.md +4 -0
  54. package/.agent-src/commands/override-create.md +4 -0
  55. package/.agent-src/commands/override-manage.md +4 -0
  56. package/.agent-src/commands/package-reset.md +3 -0
  57. package/.agent-src/commands/package-test.md +3 -0
  58. package/.agent-src/commands/prepare-for-review.md +4 -0
  59. package/.agent-src/commands/project-analyze.md +4 -0
  60. package/.agent-src/commands/project-health.md +4 -0
  61. package/.agent-src/commands/propose-memory.md +6 -8
  62. package/.agent-src/commands/quality-fix.md +4 -0
  63. package/.agent-src/commands/refine-ticket.md +12 -7
  64. package/.agent-src/commands/review-changes.md +39 -8
  65. package/.agent-src/commands/review-routing.md +4 -0
  66. package/.agent-src/commands/roadmap-create.md +18 -0
  67. package/.agent-src/commands/roadmap-execute.md +14 -1
  68. package/.agent-src/commands/rule-compliance-audit.md +4 -0
  69. package/.agent-src/commands/set-cost-profile.md +11 -0
  70. package/.agent-src/commands/sync-agent-settings.md +12 -0
  71. package/.agent-src/commands/sync-gitignore.md +3 -0
  72. package/.agent-src/commands/tests-create.md +4 -0
  73. package/.agent-src/commands/tests-execute.md +6 -3
  74. package/.agent-src/commands/threat-model.md +4 -0
  75. package/.agent-src/commands/update-form-request-messages.md +4 -0
  76. package/.agent-src/commands/upstream-contribute.md +4 -0
  77. package/.agent-src/commands/work.md +161 -0
  78. package/.agent-src/guidelines/agent-infra/engineering-memory-data-format.md +2 -6
  79. package/.agent-src/guidelines/agent-infra/layered-settings.md +0 -1
  80. package/.agent-src/guidelines/agent-infra/memory-access.md +0 -7
  81. package/.agent-src/guidelines/agent-infra/role-contracts.md +2 -4
  82. package/.agent-src/guidelines/agent-infra/self-improvement-pipeline.md +0 -1
  83. package/.agent-src/guidelines/php/patterns/strategy.md +180 -2
  84. package/.agent-src/personas/README.md +0 -1
  85. package/.agent-src/rules/artifact-drafting-protocol.md +7 -2
  86. package/.agent-src/rules/artifact-engagement-recording.md +133 -0
  87. package/.agent-src/rules/ask-when-uncertain.md +18 -13
  88. package/.agent-src/rules/augment-portability.md +64 -37
  89. package/.agent-src/rules/autonomous-execution.md +158 -0
  90. package/.agent-src/rules/chat-history-cadence.md +109 -0
  91. package/.agent-src/rules/chat-history-ownership.md +123 -0
  92. package/.agent-src/rules/chat-history-visibility.md +96 -0
  93. package/.agent-src/rules/cli-output-handling.md +27 -4
  94. package/.agent-src/rules/command-suggestion.md +134 -0
  95. package/.agent-src/rules/commit-policy.md +109 -0
  96. package/.agent-src/rules/direct-answers.md +114 -0
  97. package/.agent-src/rules/docs-sync.md +36 -0
  98. package/.agent-src/rules/downstream-changes.md +10 -9
  99. package/.agent-src/rules/improve-before-implement.md +9 -6
  100. package/.agent-src/rules/language-and-tone.md +85 -6
  101. package/.agent-src/rules/non-destructive-by-default.md +117 -0
  102. package/.agent-src/rules/package-ci-checks.md +4 -0
  103. package/.agent-src/rules/preservation-guard.md +20 -0
  104. package/.agent-src/rules/roadmap-progress-sync.md +159 -27
  105. package/.agent-src/rules/role-mode-adherence.md +1 -1
  106. package/.agent-src/rules/scope-control.md +42 -1
  107. package/.agent-src/rules/size-enforcement.md +2 -3
  108. package/.agent-src/rules/skill-quality.md +3 -8
  109. package/.agent-src/rules/ui-audit-before-build.md +106 -0
  110. package/.agent-src/rules/user-interaction.md +107 -51
  111. package/.agent-src/scripts/update_roadmap_progress.py +73 -9
  112. package/.agent-src/skills/blade-ui/SKILL.md +47 -3
  113. package/.agent-src/skills/command-routing/SKILL.md +32 -0
  114. package/.agent-src/skills/command-writing/SKILL.md +52 -2
  115. package/.agent-src/skills/description-assist/SKILL.md +21 -0
  116. package/.agent-src/skills/estimate-ticket/SKILL.md +0 -1
  117. package/.agent-src/skills/existing-ui-audit/SKILL.md +202 -0
  118. package/.agent-src/skills/fe-design/SKILL.md +78 -61
  119. package/.agent-src/skills/file-editor/SKILL.md +9 -0
  120. package/.agent-src/skills/finishing-a-development-branch/SKILL.md +4 -0
  121. package/.agent-src/skills/flux/SKILL.md +31 -4
  122. package/.agent-src/skills/guideline-writing/SKILL.md +24 -2
  123. package/.agent-src/skills/learning-to-rule-or-skill/SKILL.md +51 -9
  124. package/.agent-src/skills/livewire/SKILL.md +49 -4
  125. package/.agent-src/skills/md-language-check/SKILL.md +103 -0
  126. package/.agent-src/skills/php-coder/SKILL.md +24 -0
  127. package/.agent-src/skills/react-shadcn-ui/SKILL.md +121 -0
  128. package/.agent-src/skills/refine-prompt/SKILL.md +220 -0
  129. package/.agent-src/skills/refine-ticket/SKILL.md +32 -28
  130. package/.agent-src/skills/roadmap-management/SKILL.md +24 -11
  131. package/.agent-src/skills/rule-writing/SKILL.md +23 -1
  132. package/.agent-src/skills/skill-writing/SKILL.md +3 -5
  133. package/.agent-src/skills/upstream-contribute/SKILL.md +3 -3
  134. package/.agent-src/skills/using-git-worktrees/SKILL.md +3 -1
  135. package/.agent-src/templates/AGENTS.md +24 -6
  136. package/.agent-src/templates/agent-settings.md +149 -0
  137. package/.agent-src/templates/roadmaps.md +11 -4
  138. package/.agent-src/templates/scripts/implement_ticket/__init__.py +63 -26
  139. package/.agent-src/templates/scripts/implement_ticket/__main__.py +8 -2
  140. package/.agent-src/templates/scripts/memory_lookup.py +1 -1
  141. package/.agent-src/templates/scripts/telemetry/__init__.py +42 -0
  142. package/.agent-src/templates/scripts/telemetry/aggregator.py +154 -0
  143. package/.agent-src/templates/scripts/telemetry/boundary.py +171 -0
  144. package/.agent-src/templates/scripts/telemetry/engagement.py +238 -0
  145. package/.agent-src/templates/scripts/telemetry/report_renderer.py +170 -0
  146. package/.agent-src/templates/scripts/telemetry/settings.py +112 -0
  147. package/.agent-src/templates/scripts/telemetry_record.py +166 -0
  148. package/.agent-src/templates/scripts/telemetry_report.py +161 -0
  149. package/.agent-src/templates/scripts/telemetry_status.py +142 -0
  150. package/.agent-src/templates/scripts/work_engine/__init__.py +58 -0
  151. package/.agent-src/templates/scripts/work_engine/__main__.py +9 -0
  152. package/.agent-src/templates/scripts/work_engine/cli.py +195 -0
  153. package/.agent-src/templates/scripts/work_engine/cli_args.py +116 -0
  154. package/.agent-src/templates/scripts/{implement_ticket → work_engine}/delivery_state.py +10 -3
  155. package/.agent-src/templates/scripts/work_engine/directives/__init__.py +33 -0
  156. package/.agent-src/templates/scripts/work_engine/directives/backend/__init__.py +98 -0
  157. package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/analyze.py +1 -1
  158. package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/implement.py +3 -3
  159. package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/memory.py +2 -2
  160. package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/plan.py +2 -2
  161. package/.agent-src/templates/scripts/work_engine/directives/backend/refine.py +396 -0
  162. package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/report.py +37 -5
  163. package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/test.py +2 -2
  164. package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/verify.py +2 -2
  165. package/.agent-src/templates/scripts/work_engine/directives/mixed/__init__.py +116 -0
  166. package/.agent-src/templates/scripts/work_engine/directives/mixed/contract.py +254 -0
  167. package/.agent-src/templates/scripts/work_engine/directives/mixed/stitch.py +229 -0
  168. package/.agent-src/templates/scripts/work_engine/directives/mixed/ui.py +231 -0
  169. package/.agent-src/templates/scripts/work_engine/directives/ui/__init__.py +113 -0
  170. package/.agent-src/templates/scripts/work_engine/directives/ui/_passthrough.py +44 -0
  171. package/.agent-src/templates/scripts/work_engine/directives/ui/apply.py +241 -0
  172. package/.agent-src/templates/scripts/work_engine/directives/ui/audit.py +414 -0
  173. package/.agent-src/templates/scripts/work_engine/directives/ui/design.py +335 -0
  174. package/.agent-src/templates/scripts/work_engine/directives/ui/polish.py +510 -0
  175. package/.agent-src/templates/scripts/work_engine/directives/ui/review.py +468 -0
  176. package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/__init__.py +119 -0
  177. package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/_skipped.py +37 -0
  178. package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/apply.py +165 -0
  179. package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/refine.py +66 -0
  180. package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/report.py +62 -0
  181. package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/test.py +115 -0
  182. package/.agent-src/templates/scripts/work_engine/dispatcher.py +331 -0
  183. package/.agent-src/templates/scripts/work_engine/emitters.py +43 -0
  184. package/.agent-src/templates/scripts/work_engine/errors.py +19 -0
  185. package/.agent-src/templates/scripts/work_engine/hook_bootstrap.py +76 -0
  186. package/.agent-src/templates/scripts/work_engine/hooks/__init__.py +54 -0
  187. package/.agent-src/templates/scripts/work_engine/hooks/builtin/__init__.py +32 -0
  188. package/.agent-src/templates/scripts/work_engine/hooks/builtin/_chat_history_base.py +103 -0
  189. package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_append.py +44 -0
  190. package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_halt_append.py +42 -0
  191. package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_heartbeat.py +50 -0
  192. package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_turn_check.py +49 -0
  193. package/.agent-src/templates/scripts/work_engine/hooks/builtin/directive_set_guard.py +53 -0
  194. package/.agent-src/templates/scripts/work_engine/hooks/builtin/halt_surface_audit.py +50 -0
  195. package/.agent-src/templates/scripts/work_engine/hooks/builtin/state_shape_validation.py +52 -0
  196. package/.agent-src/templates/scripts/work_engine/hooks/builtin/trace.py +84 -0
  197. package/.agent-src/templates/scripts/work_engine/hooks/context.py +66 -0
  198. package/.agent-src/templates/scripts/work_engine/hooks/events.py +44 -0
  199. package/.agent-src/templates/scripts/work_engine/hooks/exceptions.py +79 -0
  200. package/.agent-src/templates/scripts/work_engine/hooks/registry.py +60 -0
  201. package/.agent-src/templates/scripts/work_engine/hooks/runner.py +73 -0
  202. package/.agent-src/templates/scripts/work_engine/hooks/settings.py +141 -0
  203. package/.agent-src/templates/scripts/work_engine/input_builders.py +163 -0
  204. package/.agent-src/templates/scripts/work_engine/intent/__init__.py +47 -0
  205. package/.agent-src/templates/scripts/work_engine/intent/classify.py +280 -0
  206. package/.agent-src/templates/scripts/work_engine/migration/__init__.py +8 -0
  207. package/.agent-src/templates/scripts/work_engine/migration/v0_to_v1.py +231 -0
  208. package/.agent-src/templates/scripts/{implement_ticket → work_engine}/persona_policy.py +1 -1
  209. package/.agent-src/templates/scripts/work_engine/resolvers/__init__.py +22 -0
  210. package/.agent-src/templates/scripts/work_engine/resolvers/diff.py +106 -0
  211. package/.agent-src/templates/scripts/work_engine/resolvers/file.py +113 -0
  212. package/.agent-src/templates/scripts/work_engine/resolvers/prompt.py +90 -0
  213. package/.agent-src/templates/scripts/work_engine/scoring/__init__.py +14 -0
  214. package/.agent-src/templates/scripts/work_engine/scoring/confidence.py +300 -0
  215. package/.agent-src/templates/scripts/work_engine/stack/__init__.py +31 -0
  216. package/.agent-src/templates/scripts/work_engine/stack/detect.py +187 -0
  217. package/.agent-src/templates/scripts/work_engine/state.py +641 -0
  218. package/.agent-src/templates/scripts/work_engine/state_io.py +202 -0
  219. package/.claude-plugin/marketplace.json +105 -2
  220. package/AGENTS.md +38 -8
  221. package/CHANGELOG.md +609 -0
  222. package/README.md +136 -14
  223. package/config/agent-settings.template.yml +45 -0
  224. package/config/gitignore-block.txt +4 -0
  225. package/docs/MIGRATION.md +122 -0
  226. package/docs/architecture.md +111 -35
  227. package/docs/contracts/STABILITY.md +95 -0
  228. package/docs/contracts/adr-chat-history-split.md +132 -0
  229. package/docs/contracts/adr-command-suggestion.md +146 -0
  230. package/docs/contracts/adr-implement-ticket-runtime.md +122 -0
  231. package/docs/contracts/adr-product-ui-track.md +384 -0
  232. package/docs/contracts/adr-prompt-driven-execution.md +187 -0
  233. package/docs/contracts/agent-memory-contract.md +149 -0
  234. package/docs/contracts/artifact-engagement-flow.md +262 -0
  235. package/docs/contracts/command-clusters.md +126 -0
  236. package/docs/contracts/command-suggestion-flow.md +148 -0
  237. package/docs/contracts/implement-ticket-flow.md +628 -0
  238. package/docs/contracts/linear-ai-rules-inclusion.md +143 -0
  239. package/docs/contracts/linear-ai-three-layers.md +131 -0
  240. package/docs/contracts/rule-interactions.md +107 -0
  241. package/docs/contracts/rule-interactions.yml +142 -0
  242. package/docs/contracts/ui-stack-extension.md +236 -0
  243. package/docs/contracts/ui-track-flow.md +338 -0
  244. package/docs/development.md +1 -1
  245. package/docs/getting-started.md +3 -3
  246. package/docs/installation.md +124 -2
  247. package/docs/migrations/commands-1.15.0.md +112 -0
  248. package/docs/showcase.md +204 -0
  249. package/docs/ui-track-mental-model.md +121 -0
  250. package/package.json +1 -1
  251. package/scripts/agent-config +199 -0
  252. package/scripts/audit_cloud_compatibility.py +288 -0
  253. package/scripts/build_cloud_bundle.py +458 -0
  254. package/scripts/build_linear_digest.py +263 -0
  255. package/scripts/chat_history.py +796 -7
  256. package/scripts/check_compression.py +139 -0
  257. package/scripts/check_iron_law_prominence.py +143 -0
  258. package/scripts/check_md_language.py +159 -0
  259. package/scripts/check_portability.py +38 -0
  260. package/scripts/check_public_links.py +185 -0
  261. package/scripts/check_references.py +1 -0
  262. package/scripts/check_reply_consistency.py +140 -0
  263. package/scripts/command_suggester/__init__.py +51 -0
  264. package/scripts/command_suggester/cooldown.py +132 -0
  265. package/scripts/command_suggester/loader.py +70 -0
  266. package/scripts/command_suggester/match.py +180 -0
  267. package/scripts/command_suggester/rank.py +120 -0
  268. package/scripts/command_suggester/render.py +86 -0
  269. package/scripts/command_suggester/sanitize.py +113 -0
  270. package/scripts/command_suggester/settings.py +125 -0
  271. package/scripts/command_suggester/types.py +78 -0
  272. package/scripts/hooks/augment-chat-history.sh +56 -0
  273. package/scripts/install-hooks.sh +67 -0
  274. package/scripts/install.py +150 -33
  275. package/scripts/lint_marketplace.py +27 -0
  276. package/scripts/lint_no_new_atomic_commands.py +179 -0
  277. package/scripts/lint_rule_interactions.py +149 -0
  278. package/scripts/memory_lookup.py +1 -1
  279. package/scripts/migrate_command_suggestions.py +151 -0
  280. package/scripts/release.py +297 -64
  281. package/scripts/schemas/command.schema.json +41 -0
  282. package/scripts/skill_linter.py +81 -0
  283. package/scripts/sync_agent_settings.py +42 -12
  284. package/scripts/update_counts.py +10 -0
  285. package/templates/consumer-settings/augment-cli-hooks.json +54 -0
  286. package/templates/consumer-settings/claude-settings.json +55 -1
  287. package/.agent-src/rules/chat-history.md +0 -171
  288. package/.agent-src/templates/scripts/implement_ticket/cli.py +0 -171
  289. package/.agent-src/templates/scripts/implement_ticket/dispatcher.py +0 -134
  290. package/.agent-src/templates/scripts/implement_ticket/steps/__init__.py +0 -49
  291. package/.agent-src/templates/scripts/implement_ticket/steps/refine.py +0 -140
@@ -0,0 +1,202 @@
1
+ """State-file I/O helpers for the CLI entry point.
2
+
3
+ Extracted from ``cli.py`` in P2.3 of
4
+ ``road-to-post-pr29-optimize.md``. Holds the format-preserving
5
+ load/save pair, the v0 legacy serialiser, the JSON reader, the
6
+ ``DeliveryState`` projection helpers, and the legacy-file migration
7
+ hint. Behaviour is byte-identical to the pre-split version — Goldens
8
+ stay green.
9
+ """
10
+ from __future__ import annotations
11
+
12
+ import json
13
+ from pathlib import Path
14
+ from typing import Any
15
+
16
+ from . import state as _state_module
17
+ from .cli_args import DEFAULT_STATE_FILE, LEGACY_STATE_FILE, _FMT_V0, _FMT_V1
18
+ from .delivery_state import DeliveryState
19
+ from .errors import _CLIError
20
+ from .migration.v0_to_v1 import migrate_payload
21
+ from .state import SchemaError, WorkState
22
+
23
+
24
+ def _maybe_raise_legacy_hint(state_file: Path) -> None:
25
+ """Surface a migration hint when only the pre-1.15.0 file is present.
26
+
27
+ The dispatcher renamed the default state file from
28
+ ``.implement-ticket-state.json`` to ``.work-state.json`` in 1.15.0
29
+ (alongside the ``implement_ticket → work_engine`` package move).
30
+ Existing checkouts that still carry the legacy file would otherwise
31
+ fail with a generic "no state file" message. This helper detects
32
+ the legacy file in the same directory and points the user at the
33
+ one-shot migration command instead.
34
+
35
+ Only fires when ``state_file`` has the canonical default name and
36
+ sits next to a legacy file — explicit ``--state-file`` overrides
37
+ bypass the hint so power users can carry their own naming scheme.
38
+ """
39
+ if state_file.name != DEFAULT_STATE_FILE.name:
40
+ return
41
+ legacy_candidate = state_file.with_name(LEGACY_STATE_FILE.name)
42
+ if not legacy_candidate.is_file():
43
+ return
44
+ raise _CLIError(
45
+ f"Found legacy state file {legacy_candidate} but no "
46
+ f"{state_file}. The default state file was renamed in 1.15.0. "
47
+ f"Run `python3 -m work_engine.migration.v0_to_v1 "
48
+ f"{legacy_candidate}` to migrate, or pass `--state-file "
49
+ f"{legacy_candidate}` to keep using the old name. See "
50
+ "docs/MIGRATION.md.",
51
+ )
52
+
53
+
54
+ def _load(state_file: Path) -> tuple[WorkState, str]:
55
+ """Load ``state_file`` and tag it with the wire format detected."""
56
+ data = _read_json(state_file)
57
+ if not isinstance(data, dict):
58
+ raise _CLIError(
59
+ f"State file {state_file} must carry a JSON object; "
60
+ f"got {type(data).__name__}.",
61
+ )
62
+
63
+ # v1 declares ``version``; v0 has none. Anything else is invalid.
64
+ if data.get("version") == _state_module.SCHEMA_VERSION:
65
+ try:
66
+ return _state_module.from_dict(data), _FMT_V1
67
+ except SchemaError as exc:
68
+ raise _CLIError(f"State file shape is invalid: {exc}") from exc
69
+ if "version" in data:
70
+ raise _CLIError(
71
+ f"State file shape is invalid: unsupported version "
72
+ f"{data.get('version')!r}; expected {_state_module.SCHEMA_VERSION}",
73
+ )
74
+ if "ticket" not in data:
75
+ raise _CLIError(
76
+ "State file shape is invalid: missing 'ticket' (v0) or "
77
+ "'version' (v1) — file is neither shape.",
78
+ )
79
+ try:
80
+ migrated = migrate_payload(data)
81
+ return _state_module.from_dict(migrated), _FMT_V0
82
+ except SchemaError as exc:
83
+ raise _CLIError(f"State file shape is invalid: {exc}") from exc
84
+
85
+
86
+ def _to_delivery(work: WorkState) -> DeliveryState:
87
+ """Project ``work`` into a ``DeliveryState`` for handler dispatch.
88
+
89
+ R1 P4 S1 (Option A2): handlers continue to consume ``DeliveryState``
90
+ with ``state.ticket``; the ``WorkState`` wrapper exists at the CLI
91
+ boundary so the dispatcher's directive-set selection has a v1
92
+ state object to read ``directive_set`` from. Mutable containers
93
+ (``memory``, ``changes``, ``outcomes``, ``questions``) are passed
94
+ by reference — in-place mutations land on both objects without an
95
+ explicit sync. Reassignments (``state.plan = …``, ``state.report
96
+ = …``) are mirrored back by :func:`_sync_back`.
97
+ """
98
+ return DeliveryState(
99
+ ticket=work.input.data,
100
+ persona=work.persona,
101
+ memory=work.memory,
102
+ plan=work.plan,
103
+ changes=work.changes,
104
+ tests=work.tests,
105
+ verify=work.verify,
106
+ outcomes=work.outcomes,
107
+ questions=work.questions,
108
+ report=work.report,
109
+ ui_audit=work.ui_audit,
110
+ ui_design=work.ui_design,
111
+ ui_review=work.ui_review,
112
+ ui_polish=work.ui_polish,
113
+ contract=work.contract,
114
+ stitch=work.stitch,
115
+ stack=work.stack,
116
+ )
117
+
118
+
119
+ def _sync_back(work: WorkState, delivery: DeliveryState) -> None:
120
+ """Mirror handler mutations from ``delivery`` back into ``work``.
121
+
122
+ Container fields are shared by reference (see :func:`_to_delivery`)
123
+ so the assignment is a no-op for those — we still mirror them
124
+ defensively to cover the case where a handler reassigned the
125
+ attribute (``state.memory = [new_list]``) instead of mutating in
126
+ place.
127
+ """
128
+ work.input.data = delivery.ticket
129
+ work.persona = delivery.persona
130
+ work.memory = delivery.memory
131
+ work.plan = delivery.plan
132
+ work.changes = delivery.changes
133
+ work.tests = delivery.tests
134
+ work.verify = delivery.verify
135
+ work.outcomes = delivery.outcomes
136
+ work.questions = delivery.questions
137
+ work.report = delivery.report
138
+ work.ui_audit = delivery.ui_audit
139
+ work.ui_design = delivery.ui_design
140
+ work.ui_review = delivery.ui_review
141
+ work.ui_polish = delivery.ui_polish
142
+ work.contract = delivery.contract
143
+ work.stitch = delivery.stitch
144
+ work.stack = delivery.stack
145
+
146
+
147
+ def _save(state_file: Path, work: WorkState, fmt: str) -> None:
148
+ """Persist ``work`` in the wire format it was loaded with.
149
+
150
+ v1 emits the canonical envelope via :func:`work_engine.state.to_dict`;
151
+ v0 emits the legacy flat shape that ``DeliveryState.asdict`` used
152
+ to produce, byte-identical to the pre-Phase-4 output so the
153
+ Golden Transcript replay stays green.
154
+ """
155
+ state_file.parent.mkdir(parents=True, exist_ok=True)
156
+ payload = _state_module.to_dict(work) if fmt == _FMT_V1 else _to_v0_dict(work)
157
+ state_file.write_text(
158
+ json.dumps(payload, indent=2, ensure_ascii=False) + "\n",
159
+ encoding="utf-8",
160
+ )
161
+
162
+
163
+ def _to_v0_dict(work: WorkState) -> dict[str, Any]:
164
+ """Serialise ``work`` in the legacy v0 wire format.
165
+
166
+ Field order matches ``DeliveryState`` declaration order so
167
+ pre-Phase-4 state files round-trip byte-equal.
168
+ """
169
+ return {
170
+ "ticket": work.input.data,
171
+ "persona": work.persona,
172
+ "memory": work.memory,
173
+ "plan": work.plan,
174
+ "changes": work.changes,
175
+ "tests": work.tests,
176
+ "verify": work.verify,
177
+ "outcomes": work.outcomes,
178
+ "questions": work.questions,
179
+ "report": work.report,
180
+ }
181
+
182
+
183
+ def _read_json(path: Path):
184
+ try:
185
+ raw = path.read_text(encoding="utf-8")
186
+ except OSError as exc:
187
+ raise _CLIError(f"Cannot read {path}: {exc}") from exc
188
+ try:
189
+ return json.loads(raw)
190
+ except json.JSONDecodeError as exc:
191
+ raise _CLIError(f"Invalid JSON in {path}: {exc}") from exc
192
+
193
+
194
+ __all__ = [
195
+ "_load",
196
+ "_maybe_raise_legacy_hint",
197
+ "_read_json",
198
+ "_save",
199
+ "_sync_back",
200
+ "_to_delivery",
201
+ "_to_v0_dict",
202
+ ]
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Shared agent configuration \u2014 skills for AI coding tools (Claude Code, Augment, Cursor, Cline, Windsurf, Gemini CLI).",
9
- "version": "1.13.0"
9
+ "version": "1.15.0"
10
10
  },
11
11
  "plugins": [
12
12
  {
@@ -17,41 +17,97 @@
17
17
  "skills": [
18
18
  "./.claude/skills/adversarial-review",
19
19
  "./.claude/skills/agent-docs-writing",
20
+ "./.claude/skills/agent-handoff",
21
+ "./.claude/skills/agent-status",
22
+ "./.claude/skills/agents-audit",
23
+ "./.claude/skills/agents-cleanup",
24
+ "./.claude/skills/agents-prepare",
20
25
  "./.claude/skills/analysis-autonomous-mode",
21
26
  "./.claude/skills/analysis-skill-router",
27
+ "./.claude/skills/analyze-reference-repo",
22
28
  "./.claude/skills/api-design",
23
29
  "./.claude/skills/api-endpoint",
24
30
  "./.claude/skills/api-testing",
25
31
  "./.claude/skills/artisan-commands",
32
+ "./.claude/skills/authz-review",
26
33
  "./.claude/skills/aws-infrastructure",
27
34
  "./.claude/skills/blade-ui",
35
+ "./.claude/skills/blast-radius-analyzer",
28
36
  "./.claude/skills/bug-analyzer",
37
+ "./.claude/skills/bug-fix",
38
+ "./.claude/skills/bug-investigate",
39
+ "./.claude/skills/chat-history",
40
+ "./.claude/skills/chat-history-checkpoint",
41
+ "./.claude/skills/chat-history-clear",
42
+ "./.claude/skills/chat-history-resume",
43
+ "./.claude/skills/check-current-md",
44
+ "./.claude/skills/check-refs",
29
45
  "./.claude/skills/code-refactoring",
30
46
  "./.claude/skills/code-review",
31
47
  "./.claude/skills/command-routing",
48
+ "./.claude/skills/command-writing",
49
+ "./.claude/skills/commit",
50
+ "./.claude/skills/commit-in-chunks",
32
51
  "./.claude/skills/composer-packages",
52
+ "./.claude/skills/compress",
53
+ "./.claude/skills/context-authoring",
54
+ "./.claude/skills/context-create",
33
55
  "./.claude/skills/context-document",
56
+ "./.claude/skills/context-refactor",
34
57
  "./.claude/skills/conventional-commits-writing",
58
+ "./.claude/skills/copilot-agents-init",
35
59
  "./.claude/skills/copilot-agents-optimization",
60
+ "./.claude/skills/copilot-agents-optimize",
36
61
  "./.claude/skills/copilot-config",
62
+ "./.claude/skills/create-pr",
63
+ "./.claude/skills/create-pr-description",
37
64
  "./.claude/skills/dashboard-design",
65
+ "./.claude/skills/data-flow-mapper",
38
66
  "./.claude/skills/database",
39
67
  "./.claude/skills/dependency-upgrade",
68
+ "./.claude/skills/description-assist",
40
69
  "./.claude/skills/design-review",
41
70
  "./.claude/skills/devcontainer",
42
71
  "./.claude/skills/developer-like-execution",
72
+ "./.claude/skills/do-and-judge",
73
+ "./.claude/skills/do-in-steps",
43
74
  "./.claude/skills/docker",
44
75
  "./.claude/skills/dto-creator",
76
+ "./.claude/skills/e2e-heal",
77
+ "./.claude/skills/e2e-plan",
45
78
  "./.claude/skills/eloquent",
79
+ "./.claude/skills/estimate-ticket",
80
+ "./.claude/skills/existing-ui-audit",
46
81
  "./.claude/skills/fe-design",
82
+ "./.claude/skills/feature-dev",
83
+ "./.claude/skills/feature-explore",
84
+ "./.claude/skills/feature-plan",
47
85
  "./.claude/skills/feature-planning",
86
+ "./.claude/skills/feature-refactor",
87
+ "./.claude/skills/feature-roadmap",
48
88
  "./.claude/skills/file-editor",
89
+ "./.claude/skills/finishing-a-development-branch",
90
+ "./.claude/skills/fix-ci",
91
+ "./.claude/skills/fix-portability",
92
+ "./.claude/skills/fix-pr-bot-comments",
93
+ "./.claude/skills/fix-pr-comments",
94
+ "./.claude/skills/fix-pr-developer-comments",
95
+ "./.claude/skills/fix-references",
96
+ "./.claude/skills/fix-seeder",
49
97
  "./.claude/skills/flux",
50
98
  "./.claude/skills/git-workflow",
51
99
  "./.claude/skills/github-ci",
52
100
  "./.claude/skills/grafana",
101
+ "./.claude/skills/guideline-writing",
102
+ "./.claude/skills/implement-ticket",
53
103
  "./.claude/skills/jira-integration",
104
+ "./.claude/skills/jira-ticket",
54
105
  "./.claude/skills/jobs-events",
106
+ "./.claude/skills/judge",
107
+ "./.claude/skills/judge-bug-hunter",
108
+ "./.claude/skills/judge-code-quality",
109
+ "./.claude/skills/judge-security-auditor",
110
+ "./.claude/skills/judge-test-coverage",
55
111
  "./.claude/skills/laravel",
56
112
  "./.claude/skills/laravel-horizon",
57
113
  "./.claude/skills/laravel-mail",
@@ -63,15 +119,32 @@
63
119
  "./.claude/skills/laravel-scheduling",
64
120
  "./.claude/skills/laravel-validation",
65
121
  "./.claude/skills/learning-to-rule-or-skill",
122
+ "./.claude/skills/lint-skills",
66
123
  "./.claude/skills/livewire",
67
124
  "./.claude/skills/logging-monitoring",
68
125
  "./.claude/skills/mcp",
126
+ "./.claude/skills/md-language-check",
127
+ "./.claude/skills/memory-add",
128
+ "./.claude/skills/memory-full",
129
+ "./.claude/skills/memory-promote",
69
130
  "./.claude/skills/merge-conflicts",
70
131
  "./.claude/skills/migration-creator",
132
+ "./.claude/skills/mode",
133
+ "./.claude/skills/module-create",
134
+ "./.claude/skills/module-explore",
71
135
  "./.claude/skills/module-management",
72
136
  "./.claude/skills/multi-tenancy",
137
+ "./.claude/skills/onboard",
73
138
  "./.claude/skills/openapi",
139
+ "./.claude/skills/optimize-agents",
140
+ "./.claude/skills/optimize-augmentignore",
141
+ "./.claude/skills/optimize-rtk-filters",
142
+ "./.claude/skills/optimize-skills",
143
+ "./.claude/skills/override-create",
144
+ "./.claude/skills/override-manage",
74
145
  "./.claude/skills/override-management",
146
+ "./.claude/skills/package-reset",
147
+ "./.claude/skills/package-test",
75
148
  "./.claude/skills/performance",
76
149
  "./.claude/skills/performance-analysis",
77
150
  "./.claude/skills/pest-testing",
@@ -79,6 +152,7 @@
79
152
  "./.claude/skills/php-debugging",
80
153
  "./.claude/skills/php-service",
81
154
  "./.claude/skills/playwright-testing",
155
+ "./.claude/skills/prepare-for-review",
82
156
  "./.claude/skills/project-analysis-core",
83
157
  "./.claude/skills/project-analysis-hypothesis-driven",
84
158
  "./.claude/skills/project-analysis-laravel",
@@ -87,32 +161,61 @@
87
161
  "./.claude/skills/project-analysis-react",
88
162
  "./.claude/skills/project-analysis-symfony",
89
163
  "./.claude/skills/project-analysis-zend-laminas",
164
+ "./.claude/skills/project-analyze",
90
165
  "./.claude/skills/project-analyzer",
91
166
  "./.claude/skills/project-docs",
167
+ "./.claude/skills/project-health",
168
+ "./.claude/skills/propose-memory",
169
+ "./.claude/skills/quality-fix",
92
170
  "./.claude/skills/quality-tools",
171
+ "./.claude/skills/react-shadcn-ui",
93
172
  "./.claude/skills/readme-reviewer",
94
173
  "./.claude/skills/readme-writing",
95
174
  "./.claude/skills/readme-writing-package",
175
+ "./.claude/skills/receiving-code-review",
176
+ "./.claude/skills/refine-prompt",
177
+ "./.claude/skills/refine-ticket",
178
+ "./.claude/skills/requesting-code-review",
179
+ "./.claude/skills/review-changes",
180
+ "./.claude/skills/review-routing",
181
+ "./.claude/skills/roadmap-create",
182
+ "./.claude/skills/roadmap-execute",
96
183
  "./.claude/skills/roadmap-management",
97
184
  "./.claude/skills/rtk-output-filtering",
185
+ "./.claude/skills/rule-compliance-audit",
186
+ "./.claude/skills/rule-writing",
98
187
  "./.claude/skills/security",
99
188
  "./.claude/skills/security-audit",
100
189
  "./.claude/skills/sentry-integration",
101
190
  "./.claude/skills/sequential-thinking",
191
+ "./.claude/skills/set-cost-profile",
102
192
  "./.claude/skills/skill-improvement-pipeline",
103
193
  "./.claude/skills/skill-management",
104
194
  "./.claude/skills/skill-reviewer",
105
195
  "./.claude/skills/skill-writing",
106
196
  "./.claude/skills/sql-writing",
197
+ "./.claude/skills/subagent-orchestration",
198
+ "./.claude/skills/sync-agent-settings",
199
+ "./.claude/skills/sync-gitignore",
200
+ "./.claude/skills/systematic-debugging",
107
201
  "./.claude/skills/technical-specification",
108
202
  "./.claude/skills/terraform",
109
203
  "./.claude/skills/terragrunt",
204
+ "./.claude/skills/test-driven-development",
110
205
  "./.claude/skills/test-performance",
206
+ "./.claude/skills/tests-create",
207
+ "./.claude/skills/tests-execute",
208
+ "./.claude/skills/threat-model",
209
+ "./.claude/skills/threat-modeling",
111
210
  "./.claude/skills/traefik",
112
211
  "./.claude/skills/universal-project-analysis",
212
+ "./.claude/skills/update-form-request-messages",
113
213
  "./.claude/skills/upstream-contribute",
214
+ "./.claude/skills/using-git-worktrees",
114
215
  "./.claude/skills/validate-feature-fit",
115
- "./.claude/skills/websocket"
216
+ "./.claude/skills/verify-before-complete",
217
+ "./.claude/skills/websocket",
218
+ "./.claude/skills/work"
116
219
  ]
117
220
  }
118
221
  ]
package/AGENTS.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # event4u/agent-config
2
2
 
3
+ > **agent-config is not a runtime, but it ships a deterministic orchestration contract / state machine for host agents.**
4
+
3
5
  **Shared agent configuration** — skills, rules, commands, guidelines, and templates
4
6
  for AI coding tools (Augment Code, Claude Code, Cursor, Cline, Windsurf, Gemini CLI,
5
7
  GitHub Copilot).
@@ -47,16 +49,41 @@ No PHP, no Laravel, no JavaScript runtime dependencies. The `composer.json` /
47
49
  ## Working on this repo
48
50
 
49
51
  ```bash
50
- task sync # .agent-src.uncompressed/ → .agent-src/, then project → .augment/
51
- task generate-tools # Regenerate .claude/, .cursor/, .clinerules/, .windsurfrules
52
- task test # pytest tests/ + tests/test_install.sh
53
- task lint-skills # python3 scripts/skill_linter.py --all
54
- task ci # Full pipeline must be green before PR
52
+ task sync # .agent-src.uncompressed/ → .agent-src/, then project → .augment/
53
+ task generate-tools # Regenerate .claude/, .cursor/, .clinerules/, .windsurfrules
54
+ task test # pytest tests/ + tests/test_install.sh
55
+ task lint-skills # python3 scripts/skill_linter.py --all
56
+ task build-cloud-bundles-all # ZIP every eligible skill dist/cloud/ (Claude.ai Web / Skills API)
57
+ task ci # Full pipeline — must be green before PR
55
58
  ```
56
59
 
57
60
  All checks must pass before a PR: sync-check, consistency, check-compression,
58
61
  check-refs, check-portability, lint-skills, test, lint-readme.
59
62
 
63
+ ## Maintainer telemetry (opt-in)
64
+
65
+ The artefact-engagement telemetry pipeline (`./agent-config telemetry:record`
66
+ and `./agent-config telemetry:report`) is **default-off**. Maintainers who
67
+ want to measure which skills/rules/commands the agent actually applies set
68
+ `telemetry.artifact_engagement.enabled: true` in `.agent-settings.yml`. The
69
+ log is local-only JSONL (no upload, no cross-project share) and is bound
70
+ by the redaction floor described in
71
+ [`docs/contracts/artifact-engagement-flow.md`](docs/contracts/artifact-engagement-flow.md) (beta).
72
+ The recording rule lives at
73
+ [`.agent-src/rules/artifact-engagement-recording.md`](.agent-src/rules/artifact-engagement-recording.md).
74
+
75
+ ## Context-aware command suggestion
76
+
77
+ When a user's free-form prompt matches a command's purpose, the agent
78
+ surfaces matches as a numbered-options block with an always-present
79
+ "run the prompt as-is" escape. **Nothing auto-executes** — the user
80
+ picks every time. Engine: `scripts/command_suggester/`. Rule:
81
+ [`.agent-src/rules/command-suggestion.md`](.agent-src/rules/command-suggestion.md).
82
+ Locked eligibility table, scoring contract, and hardening list:
83
+ [`docs/contracts/adr-command-suggestion.md`](docs/contracts/adr-command-suggestion.md)
84
+ and
85
+ [`docs/contracts/command-suggestion-flow.md`](docs/contracts/command-suggestion-flow.md) (beta).
86
+
60
87
  ## Key rules for agents editing this repo
61
88
 
62
89
  | Rule | File |
@@ -73,9 +100,9 @@ check-refs, check-portability, lint-skills, test, lint-readme.
73
100
 
74
101
  ```
75
102
  .agent-src.uncompressed/ ← edit here
76
- skills/ (124 skills)
77
- rules/ (46 rules)
78
- commands/ (73 commands)
103
+ skills/ (128 skills)
104
+ rules/ (55 rules)
105
+ commands/ (77 commands)
79
106
  guidelines/ (46 guidelines)
80
107
  personas/ (7 personas)
81
108
  templates/ (AGENTS.md, copilot-instructions.md, skill.md, …)
@@ -101,9 +128,12 @@ agents/ ← this package's own roadmaps / sessions / context
101
128
  | Cline | `.clinerules/` | Symlinks |
102
129
  | Windsurf | `.windsurfrules` | Concatenated file |
103
130
  | Gemini CLI | `GEMINI.md` | Symlink → AGENTS.md |
131
+ | Claude.ai Web / Skills API | `dist/cloud/<skill>.zip` | `task build-cloud-bundles-all` (T3-H gated) |
104
132
 
105
133
  Skills follow the [Agent Skills open standard](https://agentskills.io). Commands
106
134
  are converted to Claude Code Skills with `disable-model-invocation: true`.
135
+ Cloud bundles enforce description budgets and prepend a sandbox note for
136
+ T2/T3-S skills — see [`docs/architecture.md`](docs/architecture.md#cloud-bundle-pipeline).
107
137
 
108
138
  ## Contributing
109
139