@event4u/agent-config 1.14.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 (106) hide show
  1. package/.agent-src/commands/agent-handoff.md +1 -1
  2. package/.agent-src/commands/bug-fix.md +2 -2
  3. package/.agent-src/commands/chat-history-checkpoint.md +2 -2
  4. package/.agent-src/commands/chat-history-clear.md +1 -1
  5. package/.agent-src/commands/chat-history-resume.md +2 -2
  6. package/.agent-src/commands/chat-history.md +2 -2
  7. package/.agent-src/commands/check-current-md.md +43 -32
  8. package/.agent-src/commands/commit-in-chunks.md +43 -23
  9. package/.agent-src/commands/compress.md +34 -2
  10. package/.agent-src/commands/feature-roadmap.md +2 -2
  11. package/.agent-src/commands/fix-portability.md +2 -2
  12. package/.agent-src/commands/onboard.md +14 -5
  13. package/.agent-src/commands/optimize-augmentignore.md +9 -0
  14. package/.agent-src/commands/refine-ticket.md +9 -7
  15. package/.agent-src/commands/review-changes.md +35 -8
  16. package/.agent-src/commands/roadmap-create.md +13 -2
  17. package/.agent-src/commands/roadmap-execute.md +9 -7
  18. package/.agent-src/commands/set-cost-profile.md +8 -0
  19. package/.agent-src/commands/sync-agent-settings.md +9 -0
  20. package/.agent-src/commands/tests-execute.md +2 -3
  21. package/.agent-src/rules/artifact-engagement-recording.md +1 -1
  22. package/.agent-src/rules/augment-portability.md +56 -37
  23. package/.agent-src/rules/chat-history-cadence.md +109 -0
  24. package/.agent-src/rules/chat-history-ownership.md +123 -0
  25. package/.agent-src/rules/chat-history-visibility.md +96 -0
  26. package/.agent-src/rules/cli-output-handling.md +1 -1
  27. package/.agent-src/rules/command-suggestion.md +3 -2
  28. package/.agent-src/rules/commit-policy.md +44 -34
  29. package/.agent-src/rules/direct-answers.md +1 -1
  30. package/.agent-src/rules/language-and-tone.md +19 -15
  31. package/.agent-src/rules/non-destructive-by-default.md +18 -18
  32. package/.agent-src/rules/roadmap-progress-sync.md +133 -74
  33. package/.agent-src/rules/role-mode-adherence.md +1 -1
  34. package/.agent-src/rules/size-enforcement.md +2 -1
  35. package/.agent-src/rules/user-interaction.md +28 -4
  36. package/.agent-src/scripts/update_roadmap_progress.py +56 -4
  37. package/.agent-src/skills/blade-ui/SKILL.md +29 -10
  38. package/.agent-src/skills/command-writing/SKILL.md +15 -4
  39. package/.agent-src/skills/existing-ui-audit/SKILL.md +24 -9
  40. package/.agent-src/skills/fe-design/SKILL.md +20 -15
  41. package/.agent-src/skills/file-editor/SKILL.md +9 -0
  42. package/.agent-src/skills/livewire/SKILL.md +26 -7
  43. package/.agent-src/skills/refine-ticket/SKILL.md +30 -24
  44. package/.agent-src/skills/roadmap-management/SKILL.md +22 -16
  45. package/.agent-src/skills/skill-writing/SKILL.md +3 -3
  46. package/.agent-src/skills/upstream-contribute/SKILL.md +2 -2
  47. package/.agent-src/templates/agent-settings.md +1 -1
  48. package/.agent-src/templates/roadmaps.md +9 -8
  49. package/.agent-src/templates/scripts/memory_lookup.py +1 -1
  50. package/.agent-src/templates/scripts/work_engine/__init__.py +2 -2
  51. package/.agent-src/templates/scripts/work_engine/cli.py +64 -461
  52. package/.agent-src/templates/scripts/work_engine/cli_args.py +116 -0
  53. package/.agent-src/templates/scripts/work_engine/delivery_state.py +3 -3
  54. package/.agent-src/templates/scripts/work_engine/directives/backend/__init__.py +1 -1
  55. package/.agent-src/templates/scripts/work_engine/directives/backend/implement.py +1 -1
  56. package/.agent-src/templates/scripts/work_engine/directives/backend/memory.py +1 -1
  57. package/.agent-src/templates/scripts/work_engine/directives/backend/plan.py +1 -1
  58. package/.agent-src/templates/scripts/work_engine/directives/backend/report.py +1 -1
  59. package/.agent-src/templates/scripts/work_engine/dispatcher.py +1 -1
  60. package/.agent-src/templates/scripts/work_engine/emitters.py +43 -0
  61. package/.agent-src/templates/scripts/work_engine/errors.py +19 -0
  62. package/.agent-src/templates/scripts/work_engine/hook_bootstrap.py +76 -0
  63. package/.agent-src/templates/scripts/work_engine/input_builders.py +163 -0
  64. package/.agent-src/templates/scripts/work_engine/migration/v0_to_v1.py +34 -2
  65. package/.agent-src/templates/scripts/work_engine/persona_policy.py +1 -1
  66. package/.agent-src/templates/scripts/work_engine/resolvers/prompt.py +1 -1
  67. package/.agent-src/templates/scripts/work_engine/state_io.py +202 -0
  68. package/.claude-plugin/marketplace.json +1 -1
  69. package/AGENTS.md +6 -4
  70. package/CHANGELOG.md +83 -8
  71. package/README.md +24 -23
  72. package/docs/MIGRATION.md +122 -0
  73. package/docs/architecture.md +83 -34
  74. package/docs/contracts/STABILITY.md +95 -0
  75. package/docs/contracts/adr-chat-history-split.md +132 -0
  76. package/docs/contracts/adr-command-suggestion.md +146 -0
  77. package/docs/contracts/adr-implement-ticket-runtime.md +122 -0
  78. package/docs/contracts/adr-product-ui-track.md +384 -0
  79. package/docs/contracts/adr-prompt-driven-execution.md +187 -0
  80. package/docs/contracts/agent-memory-contract.md +149 -0
  81. package/docs/contracts/artifact-engagement-flow.md +262 -0
  82. package/docs/contracts/command-clusters.md +126 -0
  83. package/docs/contracts/command-suggestion-flow.md +148 -0
  84. package/docs/contracts/implement-ticket-flow.md +628 -0
  85. package/docs/contracts/linear-ai-rules-inclusion.md +143 -0
  86. package/docs/contracts/linear-ai-three-layers.md +131 -0
  87. package/docs/contracts/rule-interactions.md +107 -0
  88. package/docs/contracts/rule-interactions.yml +142 -0
  89. package/docs/contracts/ui-stack-extension.md +236 -0
  90. package/docs/contracts/ui-track-flow.md +338 -0
  91. package/docs/getting-started.md +2 -2
  92. package/docs/installation.md +42 -6
  93. package/docs/migrations/commands-1.15.0.md +112 -0
  94. package/docs/ui-track-mental-model.md +121 -0
  95. package/package.json +1 -1
  96. package/scripts/build_linear_digest.py +4 -4
  97. package/scripts/check_portability.py +2 -0
  98. package/scripts/check_public_links.py +185 -0
  99. package/scripts/check_references.py +1 -0
  100. package/scripts/lint_no_new_atomic_commands.py +179 -0
  101. package/scripts/lint_rule_interactions.py +149 -0
  102. package/scripts/memory_lookup.py +1 -1
  103. package/scripts/release.py +297 -64
  104. package/scripts/skill_linter.py +14 -0
  105. package/scripts/update_counts.py +10 -0
  106. package/.agent-src/rules/chat-history.md +0 -200
@@ -1,200 +0,0 @@
1
- ---
2
- type: "always"
3
- description: "Persist the conversation to .agent-chat-history for crash recovery — read on first turn, detect match/returning/foreign/missing, append on progress, honor per-profile frequency and overflow settings"
4
- alwaysApply: true
5
- source: package
6
- ---
7
-
8
- <!-- cloud_safe: noop -->
9
-
10
- # Chat History
11
-
12
- Persists the conversation to `.agent-chat-history` (JSONL, project root,
13
- git-ignored) so a crashed or switched agent session can be resumed. File
14
- I/O is owned by [`scripts/chat_history.py`](../../../scripts/chat_history.py)
15
- — this rule says **when** to call it, not how the file is structured.
16
-
17
- ## Two paths — platform decides which Iron Law applies
18
-
19
- Population of `.agent-chat-history` is **structural** (platform-driven)
20
- on platforms with native lifecycle hooks, and **cooperative**
21
- (agent-driven) on platforms without. Both paths converge on the same
22
- JSONL schema; only the trigger differs. Per-platform classification
23
- lives in
24
- [`agents/contexts/chat-history-platform-hooks.md`](../../../agents/contexts/chat-history-platform-hooks.md).
25
-
26
- | Path | Platforms / Surfaces | Trigger | Agent's role |
27
- |---|---|---|---|
28
- | **HOOK** | Claude Code, Augment CLI, Cursor 1.7+, Cline non-Windows, Windsurf, Gemini CLI | Platform fires native lifecycle hooks → `./agent-config chat-history:hook --platform <name>` | Read-only — observe, do not duplicate appends |
29
- | **ENGINE** | `/implement-ticket`, `/work`, any flow driven by `scripts/work_engine/cli.py` | `work_engine` fires `turn-check` (before-dispatch), `append --type phase` (per successful step), `--type decision` (on-halt), `heartbeat` (after-dispatch) via the hook layer | Read-only during engine-driven turns — do not duplicate appends. See [`agents/contexts/work-engine-hooks.md`](../../../agents/contexts/work-engine-hooks.md) |
30
- | **CHECKPOINT** | Augment IDE plugin, Cursor < 1.7, Cline on Windows | Agent invokes `/chat-history-checkpoint` at phase boundaries | Cooperative — the three gates below are mandatory |
31
- | **MANUAL** | Cloud surfaces (Claude.ai Web, Skills API) | Rule is inert — see Cloud Behavior | None |
32
-
33
- Detect the path on first turn: read `chat_history.platform` from
34
- `.agent-settings.yml` if set, else fall back to `chat_history.path`
35
- (`hook` / `checkpoint` / `manual`). Missing both → assume CHECKPOINT
36
- (safest cooperative default; HOOK platforms install the platform
37
- config explicitly via `scripts/install.py`).
38
-
39
- ## Iron Law (CHECKPOINT path) — three gates, skipping any one is a rule violation
40
-
41
- ```
42
- 1. turn-check — first tool call of every session
43
- 2. append — at every cadence boundary, with --first-user-msg
44
- 3. heartbeat — last line of every reply, from current subprocess
45
- stdout (NEVER from memory)
46
- ```
47
-
48
- **Overrides** token-efficiency, conversation momentum, "the turn was
49
- trivial". Three enforcement layers: **turn-check** non-zero on
50
- `missing`/`foreign`/`returning`, **append refusal** (exit `3` on
51
- ownership mismatch), **script-generated heartbeat** (silent skip
52
- becomes immediately visible).
53
-
54
- On the HOOK and ENGINE paths the platform / engine performs gates 1 + 2
55
- structurally; the agent **must not** also call `turn-check` or `append`
56
- (double-write risk). Engine-driven turns inherit the structural guarantee
57
- for the duration of the dispatch cycle — once the engine returns control,
58
- free-form prose around the engine output falls back to whatever path the
59
- platform supplies. Heartbeat (gate 3) stays useful for visibility on
60
- every path — see below.
61
-
62
- ### Turn-start gate — MANDATORY first tool call
63
-
64
- ```bash
65
- scripts/chat_history.py turn-check --first-user-msg "<first-user-msg>"
66
- ```
67
-
68
- Exit codes: `0` = `ok`/`disabled` (proceed), `10` = `missing`
69
- (run `init --first-user-msg "..." --freq <freq>`), `11` = `foreign`
70
- (render Foreign-Prompt + stop), `12` = `returning` (render
71
- Returning-Prompt + stop). The script also writes a one-line
72
- `ACTION REQUIRED:` hint to stderr on non-zero exits.
73
-
74
- ### Append cadence — MANDATORY at boundaries
75
-
76
- Cadence comes from `chat_history.frequency`:
77
-
78
- - `per_turn` → one entry at the end of every agent turn.
79
- - `per_phase` → at phase boundaries (user question answered, decision
80
- taken, task-list item completed, significant tool sequence finished).
81
- Pure clarification turns may skip.
82
- - `per_tool` → after each tool-call sequence.
83
-
84
- Every append goes through
85
-
86
- ```bash
87
- scripts/chat_history.py append --first-user-msg "<msg>" \
88
- --type <user|agent|tool|decision|phase> --json '<obj>'
89
- ```
90
-
91
- Never write the file directly. Prefer `phase` over `agent` for boundaries.
92
- Exit `3` (`OWNERSHIP_REFUSED`) means turn-start was skipped or the file
93
- was hijacked — surface it, do not swallow it. Cadence is the trigger, not
94
- reply length; do not batch missed turns (crashes happen between turns).
95
-
96
- ### Heartbeat marker — visibility gated by `chat_history.heartbeat`
97
-
98
- Run silently before emitting the final reply:
99
-
100
- ```bash
101
- scripts/chat_history.py heartbeat --first-user-msg "<first-user-msg>"
102
- ```
103
-
104
- Stdout is **at most** one line, e.g.
105
- `📒 chat-history: ok · 9 entries · per_phase · last 30s ago`. Non-empty →
106
- paste **verbatim** as the last line of the reply. Empty → emit nothing.
107
- Always exits 0 — observability, not a gate.
108
-
109
- **Visibility modes** — `chat_history.heartbeat`:
110
-
111
- | Mode | When marker prints | Token cost |
112
- |---|---|---|
113
- | `on` | every reply (legacy) | ~20 tokens / reply |
114
- | `off` | never — full silence | 0 |
115
- | `hybrid` *(default)* | drift states only (`missing`/`foreign`/`returning`) | 0 in normal flow, ~20 on drift |
116
-
117
- `hybrid` ships zero tokens when healthy, loud on ownership drift. YAML 1.1
118
- booleanizes bare `on`/`off`; the reader coerces both back, so
119
- `heartbeat: on` works unquoted.
120
-
121
- ### Memory-typing the marker — rule violation, not a slip
122
-
123
- Format is memorizable; counts and timestamps are not. A typed-from-
124
- memory line shows stale entries and a healthy-looking `ok` while the
125
- file is silently behind — observability collapses, invisible until
126
- `status` is checked. Heartbeat is the script output of the **current
127
- turn**, verbatim, or nothing.
128
-
129
- **Self-check before send — MANDATORY.** (1) Did `heartbeat` run on
130
- this turn? (2) Is the line byte-identical to that subprocess stdout?
131
- (3) Empty stdout → no marker line. Any "no" → drop it.
132
-
133
- **Slip handling.** Stale marker called out → acknowledge once in the
134
- user's language; run `status`; on CHECKPOINT `append` missed phase-
135
- boundaries; run a real `heartbeat`; paste stdout verbatim or nothing.
136
- Don't promise "from now on" — only behaviour proves compliance
137
- (mirrors `language-and-tone` § slip handling).
138
-
139
- ## Activation & handshake
140
-
141
- Read `chat_history.*` from `.agent-settings.yml` **once per conversation**
142
- (first turn) and cache. `enabled: false` or section missing → rule is a
143
- **no-op** (do not read, write, or mention the file). Otherwise cache
144
- `frequency`, `max_size_kb`, `on_overflow`, and the **path** (HOOK /
145
- CHECKPOINT / MANUAL — see the table above).
146
-
147
- **HOOK path** — skip `turn-check` entirely. The platform's
148
- `SessionStart` hook already initialized the file; the agent's job is to
149
- read `status` once for context awareness (header preview, entry count)
150
- and otherwise leave I/O to the hook dispatcher. Foreign / Returning
151
- prompts still apply because hooks call into the same ownership state
152
- machine — when the dispatcher reports `foreign` or `returning` via
153
- exit code or stderr, render the corresponding prompt.
154
-
155
- **CHECKPOINT path** — run `turn-check` as the first tool call. State
156
- token branches to one of: `missing` → `init`, `ok` → continue,
157
- `foreign` → Foreign-Prompt, `returning` → Returning-Prompt. Cooperative
158
- gates 1 + 2 + 3 are mandatory; `/chat-history-checkpoint` is the
159
- recommended way to satisfy gate 2 at phase boundaries.
160
-
161
- In `foreign` and `returning`, **always read the file's current contents
162
- into the agent's working context before any write** — the user chose to
163
- log history for a reason; losing it silently is never acceptable. The
164
- legacy `state` subcommand still works for shell scripts; agents prefer
165
- `turn-check` (folds in `enabled` + distinct exit codes).
166
-
167
- ## Foreign / Returning prompts — full mechanics
168
-
169
- When `turn-check` exits `11` (foreign) or `12` (returning), render the
170
- matching numbered-options block from
171
- [`agents/contexts/chat-history-handshake.md`](../../../agents/contexts/chat-history-handshake.md).
172
- That doc holds the prompt bodies, the option → script-call mapping
173
- (`adopt` / `init` / `prepend` / `reset`), the in-memory entries-list
174
- shape, free-text fallbacks, and the overflow handling per
175
- `on_overflow` (`rotate` / `compress`). Read it once on first foreign
176
- or returning event; cache the chosen option for the rest of the
177
- conversation.
178
-
179
- ## What this rule does NOT do
180
-
181
- Display/reload/clear (`/chat-history*` commands). Auto-flip `enabled` or
182
- `on_overflow`. Run when `enabled: false` (no silent logging, no
183
- telemetry). Decide ownership heuristically — only `state` does that.
184
- Double-write on HOOK platforms — when hooks fire structurally, the
185
- agent does **not** also call `append`.
186
-
187
- ## Cloud Behavior
188
-
189
- On cloud surfaces (Claude.ai Web, Skills API) the rule is **fully inert** —
190
- no `.agent-chat-history`, no `scripts/`, no Iron Law gates, no heartbeat,
191
- no foreign/returning prompts, no overflow warning. Treat
192
- `chat_history.enabled` as `false`; persistence is a local-agent concern.
193
-
194
- ## Interactions & references
195
-
196
- - `ask-when-uncertain` + `user-interaction` — foreign/returning prompts use numbered options, one question per turn.
197
- - `language-and-tone` — prompt translated at runtime; `.md` stays English.
198
- - `onboarding-gate` — runs first; this rule activates only after it clears.
199
- - `token-efficiency` — never load the full log; use `status` / `read --last N`.
200
- - API: [`scripts/chat_history.py`](../../../scripts/chat_history.py). Commands: [`/chat-history`](../commands/chat-history.md), [`/chat-history-resume`](../commands/chat-history-resume.md), [`/chat-history-clear`](../commands/chat-history-clear.md), [`/chat-history-checkpoint`](../commands/chat-history-checkpoint.md). Settings: [`agent-settings`](../templates/agent-settings.md). Platform classification: [`agents/contexts/chat-history-platform-hooks.md`](../../../agents/contexts/chat-history-platform-hooks.md). Types: [`rule-type-governance`](rule-type-governance.md).