@event4u/agent-config 1.19.0 → 1.21.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.
- package/.agent-src/commands/agent-handoff.md +14 -10
- package/.agent-src/commands/agents.md +1 -1
- package/.agent-src/commands/bug-fix.md +1 -1
- package/.agent-src/commands/bug-investigate.md +2 -2
- package/.agent-src/commands/chat-history/import.md +166 -0
- package/.agent-src/commands/chat-history/learn.md +178 -0
- package/.agent-src/commands/chat-history/show.md +17 -18
- package/.agent-src/commands/chat-history.md +26 -25
- package/.agent-src/commands/compress.md +12 -0
- package/.agent-src/commands/context/create.md +2 -2
- package/.agent-src/commands/context.md +1 -1
- package/.agent-src/commands/copilot-agents.md +1 -1
- package/.agent-src/commands/council/default.md +21 -12
- package/.agent-src/commands/council.md +1 -1
- package/.agent-src/commands/create-pr.md +28 -8
- package/.agent-src/commands/e2e-heal.md +1 -1
- package/.agent-src/commands/e2e-plan.md +1 -1
- package/.agent-src/commands/feature/dev.md +3 -3
- package/.agent-src/commands/feature.md +1 -1
- package/.agent-src/commands/fix/seeder.md +2 -2
- package/.agent-src/commands/fix.md +1 -1
- package/.agent-src/commands/jira-ticket.md +1 -1
- package/.agent-src/commands/judge.md +2 -2
- package/.agent-src/commands/memory.md +1 -1
- package/.agent-src/commands/mode.md +5 -5
- package/.agent-src/commands/module.md +1 -1
- package/.agent-src/commands/onboard.md +4 -4
- package/.agent-src/commands/optimize/augmentignore.md +1 -1
- package/.agent-src/commands/optimize-prompt.md +61 -0
- package/.agent-src/commands/optimize.md +1 -1
- package/.agent-src/commands/override.md +1 -1
- package/.agent-src/commands/review-changes.md +1 -1
- package/.agent-src/commands/review-routing.md +1 -1
- package/.agent-src/commands/roadmap.md +1 -1
- package/.agent-src/commands/set-cost-profile.md +3 -3
- package/.agent-src/commands/sync-agent-settings.md +2 -2
- package/.agent-src/commands/sync-gitignore.md +1 -1
- package/.agent-src/commands/tests/create.md +2 -2
- package/.agent-src/commands/tests.md +1 -1
- package/.agent-src/commands/threat-model.md +4 -4
- package/.agent-src/contexts/authority/commit-mechanics.md +14 -1
- package/.agent-src/contexts/authority/destructive-mechanics.md +14 -1
- package/.agent-src/contexts/authority/scope-mechanics.md +5 -0
- package/.agent-src/contexts/communication/rules-auto/guidelines-mechanics.md +76 -0
- package/.agent-src/contexts/communication/rules-auto/skill-quality-mechanics.md +76 -0
- package/.agent-src/contexts/communication/rules-auto/slash-command-routing-policy-mechanics.md +4 -4
- package/.agent-src/contexts/communication/rules-auto/think-before-action-mechanics.md +98 -0
- package/.agent-src/contexts/communication/rules-auto/token-efficiency-mechanics.md +93 -0
- package/.agent-src/contexts/communication/rules-auto/user-interaction-mechanics.md +125 -9
- package/.agent-src/contexts/execution/autonomy-mechanics.md +44 -0
- package/.agent-src/contexts/model-recommendations.md +2 -2
- package/.agent-src/contexts/override-system.md +1 -1
- package/.agent-src/personas/product-owner.md +2 -2
- package/.agent-src/personas/qa.md +1 -1
- package/.agent-src/rules/agent-authority.md +5 -6
- package/.agent-src/rules/agent-docs.md +11 -53
- package/.agent-src/rules/analysis-skill-routing.md +10 -40
- package/.agent-src/rules/architecture.md +6 -1
- package/.agent-src/rules/artifact-drafting-protocol.md +5 -0
- package/.agent-src/rules/artifact-engagement-recording.md +23 -59
- package/.agent-src/rules/ask-when-uncertain.md +24 -47
- package/.agent-src/rules/augment-portability.md +14 -62
- package/.agent-src/rules/augment-source-of-truth.md +10 -1
- package/.agent-src/rules/autonomous-execution.md +17 -98
- package/.agent-src/rules/capture-learnings.md +9 -80
- package/.agent-src/rules/cli-output-handling.md +12 -42
- package/.agent-src/rules/command-suggestion-policy.md +25 -73
- package/.agent-src/rules/commit-conventions.md +9 -58
- package/.agent-src/rules/commit-policy.md +16 -47
- package/.agent-src/rules/context-hygiene.md +5 -0
- package/.agent-src/rules/direct-answers.md +21 -42
- package/.agent-src/rules/docker-commands.md +11 -45
- package/.agent-src/rules/docs-sync.md +10 -56
- package/.agent-src/rules/downstream-changes.md +5 -0
- package/.agent-src/rules/e2e-testing.md +9 -44
- package/.agent-src/rules/guidelines.md +13 -75
- package/.agent-src/rules/improve-before-implement.md +10 -2
- package/.agent-src/rules/language-and-tone.md +35 -69
- package/.agent-src/rules/laravel-translations.md +11 -40
- package/.agent-src/rules/markdown-safe-codeblocks.md +4 -0
- package/.agent-src/rules/minimal-safe-diff.md +4 -0
- package/.agent-src/rules/missing-tool-handling.md +4 -0
- package/.agent-src/rules/model-recommendation.md +9 -61
- package/.agent-src/rules/no-attribution-footers.md +53 -0
- package/.agent-src/rules/no-cheap-questions.md +11 -27
- package/.agent-src/rules/no-council-references.md +76 -0
- package/.agent-src/rules/no-roadmap-references.md +8 -1
- package/.agent-src/rules/non-destructive-by-default.md +13 -43
- package/.agent-src/rules/onboarding-gate.md +9 -117
- package/.agent-src/rules/package-ci-checks.md +10 -37
- package/.agent-src/rules/php-coding.md +10 -55
- package/.agent-src/rules/preservation-guard.md +9 -0
- package/.agent-src/rules/review-routing-awareness.md +9 -97
- package/.agent-src/rules/reviewer-awareness.md +8 -83
- package/.agent-src/rules/roadmap-progress-sync.md +7 -170
- package/.agent-src/rules/role-mode-adherence.md +6 -2
- package/.agent-src/rules/rule-type-governance.md +8 -66
- package/.agent-src/rules/runtime-safety.md +5 -0
- package/.agent-src/rules/scope-control.md +17 -62
- package/.agent-src/rules/security-sensitive-stop.md +7 -1
- package/.agent-src/rules/size-enforcement.md +6 -1
- package/.agent-src/rules/skill-improvement-trigger.md +9 -49
- package/.agent-src/rules/skill-quality.md +7 -64
- package/.agent-src/rules/slash-command-routing-policy.md +11 -63
- package/.agent-src/rules/think-before-action.md +22 -87
- package/.agent-src/rules/token-efficiency.md +10 -74
- package/.agent-src/rules/token-optimizer-maintenance.md +68 -0
- package/.agent-src/rules/tool-safety.md +4 -0
- package/.agent-src/rules/ui-audit-gate.md +25 -61
- package/.agent-src/rules/upstream-proposal.md +9 -67
- package/.agent-src/rules/user-interaction.md +25 -95
- package/.agent-src/rules/verify-before-complete.md +1 -1
- package/.agent-src/skills/agent-docs-writing/SKILL.md +1 -1
- package/.agent-src/skills/ai-council/SKILL.md +69 -5
- package/.agent-src/skills/analysis-autonomous-mode/SKILL.md +1 -1
- package/.agent-src/skills/analysis-skill-router/SKILL.md +3 -3
- package/.agent-src/skills/artisan-commands/SKILL.md +2 -2
- package/.agent-src/skills/authz-review/SKILL.md +1 -1
- package/.agent-src/skills/aws-infrastructure/SKILL.md +5 -5
- package/.agent-src/skills/blast-radius-analyzer/SKILL.md +8 -8
- package/.agent-src/skills/bug-analyzer/SKILL.md +5 -5
- package/.agent-src/skills/code-refactoring/SKILL.md +4 -4
- package/.agent-src/skills/code-review/SKILL.md +2 -2
- package/.agent-src/skills/command-writing/SKILL.md +11 -0
- package/.agent-src/skills/composer-packages/SKILL.md +2 -2
- package/.agent-src/skills/context-authoring/SKILL.md +11 -0
- package/.agent-src/skills/context-document/SKILL.md +1 -1
- package/.agent-src/skills/copilot-agents-optimization/SKILL.md +23 -0
- package/.agent-src/skills/copilot-config/SKILL.md +1 -1
- package/.agent-src/skills/dcf-modeling/SKILL.md +89 -0
- package/.agent-src/skills/dependency-upgrade/SKILL.md +2 -2
- package/.agent-src/skills/devcontainer/SKILL.md +2 -2
- package/.agent-src/skills/developer-like-execution/SKILL.md +1 -1
- package/.agent-src/skills/docker/SKILL.md +1 -1
- package/.agent-src/skills/dto-creator/SKILL.md +1 -1
- package/.agent-src/skills/estimate-ticket/SKILL.md +2 -2
- package/.agent-src/skills/fe-design/SKILL.md +4 -4
- package/.agent-src/skills/feature-planning/SKILL.md +5 -5
- package/.agent-src/skills/funnel-analysis/SKILL.md +100 -0
- package/.agent-src/skills/laravel/SKILL.md +1 -1
- package/.agent-src/skills/laravel-notifications/SKILL.md +5 -5
- package/.agent-src/skills/laravel-pennant/SKILL.md +1 -1
- package/.agent-src/skills/laravel-pulse/SKILL.md +4 -4
- package/.agent-src/skills/laravel-reverb/SKILL.md +2 -2
- package/.agent-src/skills/laravel-scheduling/SKILL.md +1 -1
- package/.agent-src/skills/md-language-check/SKILL.md +1 -1
- package/.agent-src/skills/migration-creator/SKILL.md +7 -7
- package/.agent-src/skills/multi-tenancy/SKILL.md +8 -8
- package/.agent-src/skills/okr-tree-modeling/SKILL.md +93 -0
- package/.agent-src/skills/performance-analysis/SKILL.md +3 -3
- package/.agent-src/skills/pest-testing/SKILL.md +6 -6
- package/.agent-src/skills/php-service/SKILL.md +2 -2
- package/.agent-src/skills/project-analysis-hypothesis-driven/SKILL.md +3 -3
- package/.agent-src/skills/project-analysis-react/SKILL.md +1 -1
- package/.agent-src/skills/project-analysis-symfony/SKILL.md +1 -1
- package/.agent-src/skills/project-analysis-zend-laminas/SKILL.md +2 -2
- package/.agent-src/skills/project-analyzer/SKILL.md +4 -4
- package/.agent-src/skills/prompt-optimizer/SKILL.md +108 -0
- package/.agent-src/skills/readme-reviewer/SKILL.md +1 -1
- package/.agent-src/skills/rice-prioritization/SKILL.md +100 -0
- package/.agent-src/skills/rule-writing/SKILL.md +33 -0
- package/.agent-src/skills/sentry-integration/SKILL.md +1 -1
- package/.agent-src/skills/skill-writing/SKILL.md +14 -0
- package/.agent-src/skills/subagent-orchestration/SKILL.md +34 -2
- package/.agent-src/skills/terraform/SKILL.md +2 -2
- package/.agent-src/skills/terragrunt/SKILL.md +8 -8
- package/.agent-src/skills/test-performance/SKILL.md +5 -5
- package/.agent-src/skills/threat-modeling/SKILL.md +2 -2
- package/.agent-src/skills/token-optimizer/SKILL.md +110 -0
- package/.agent-src/skills/unit-economics-modeling/SKILL.md +104 -0
- package/.agent-src/skills/universal-project-analysis/SKILL.md +1 -1
- package/.agent-src/skills/using-git-worktrees/SKILL.md +1 -0
- package/.agent-src/templates/AGENTS.md +1 -1
- package/.agent-src/templates/agent-settings.md +25 -41
- package/.agent-src/templates/contexts/tenant-boundaries.md +2 -2
- package/.agent-src/templates/contexts.md +1 -1
- package/.agent-src/templates/copilot-instructions.md +21 -0
- package/.agent-src/templates/copilot-review-instructions.md +76 -0
- package/.agent-src/templates/features.md +1 -1
- package/.agent-src/templates/rule.md +127 -0
- package/.agent-src/templates/scripts/work_engine/hook_bootstrap.py +7 -5
- package/.agent-src/templates/scripts/work_engine/hooks/__init__.py +0 -4
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/__init__.py +0 -4
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/_chat_history_base.py +7 -51
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_append.py +1 -2
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_halt_append.py +1 -2
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/memory_visibility.py +2 -3
- package/.agent-src/templates/skill.md +30 -1
- package/.claude-plugin/marketplace.json +11 -4
- package/AGENTS.md +71 -3
- package/CHANGELOG.md +180 -3
- package/README.md +24 -23
- package/config/agent-settings.template.yml +63 -23
- package/config/gitignore-block.txt +11 -4
- package/docs/architecture.md +84 -3
- package/docs/catalog.md +23 -11
- package/docs/contracts/adr-chat-history-split.md +10 -1
- package/docs/contracts/agent-memory-contract.md +1 -1
- package/docs/contracts/command-clusters.md +1 -1
- package/docs/contracts/context-paths.md +2 -1
- package/docs/contracts/cross-wing-handoff.md +133 -0
- package/docs/contracts/file-ownership-matrix.json +678 -609
- package/docs/contracts/hook-architecture-v1.md +8 -1
- package/docs/contracts/iron-law-overrides.txt +25 -0
- package/docs/contracts/kernel-membership.md +273 -0
- package/docs/contracts/load-context-schema.md +26 -11
- package/docs/contracts/memory-visibility-v1.md +8 -24
- package/docs/contracts/pilot/agent-authority.md +24 -0
- package/docs/contracts/pilot/direct-answers.md +70 -0
- package/docs/contracts/pilot/language-and-tone.md +63 -0
- package/docs/contracts/rule-classification.md +170 -0
- package/docs/contracts/rule-router.md +153 -0
- package/docs/customization.md +18 -7
- package/docs/decisions/ADR-001-kernel-swap-deferred.md +109 -0
- package/docs/decisions/ADR-002-kernel-bucket-overrides.md +124 -0
- package/docs/decisions/ADR-rule-kernel-and-router.md +122 -0
- package/docs/getting-started.md +19 -27
- package/docs/guidelines/agent-infra/ask-when-uncertain-demos.md +1 -1
- package/docs/guidelines/agent-infra/roadmap-progress-mechanics.md +176 -0
- package/docs/guidelines/agent-infra/rule-type-governance.md +73 -0
- package/docs/guidelines/agent-infra/size-and-scope.md +13 -2
- package/docs/guidelines/agent-infra/skill-quality-checklist.md +119 -0
- package/docs/guidelines/augment-portability-patterns.md +68 -0
- package/docs/guidelines/php/php-coding-patterns.md +62 -0
- package/docs/hook-payload-capture.md +221 -0
- package/docs/migrations/commands-1.15.0.md +17 -12
- package/docs/skills-catalog.md +5 -4
- package/llms.txt +4 -3
- package/package.json +1 -1
- package/scripts/_p43_bodies.py +235 -0
- package/scripts/_p43_compress.py +118 -0
- package/scripts/_p4_migrate.py +199 -0
- package/scripts/_pilot_council_question.py +57 -0
- package/scripts/_pilot_measure.py +53 -0
- package/scripts/agent-config +1 -1
- package/scripts/ai_council/_default_prices.py +4 -4
- package/scripts/ai_council/clients.py +1 -1
- package/scripts/ai_council/modes.py +3 -4
- package/scripts/ai_council/pricing.py +10 -9
- package/scripts/ai_council/session.py +107 -5
- package/scripts/build_linear_digest.py +3 -5
- package/scripts/build_rule_trigger_matrix.py +1 -9
- package/scripts/chat_history.py +952 -596
- package/scripts/check_always_budget.py +39 -6
- package/scripts/check_compressed_paths.py +213 -0
- package/scripts/check_compression.py +15 -0
- package/scripts/check_context_paths.py +1 -0
- package/scripts/check_council_layout.py +105 -0
- package/scripts/check_council_references.py +145 -0
- package/scripts/check_portability.py +2 -0
- package/scripts/check_references.py +14 -2
- package/scripts/check_token_optimizer_freshness.py +131 -0
- package/scripts/compile_router.py +148 -0
- package/scripts/compress.py +219 -11
- package/scripts/council_cli.py +63 -9
- package/scripts/council_prune.py +81 -0
- package/scripts/count_token_optimizer_usage.sh +54 -0
- package/scripts/hook_manifest.yaml +33 -0
- package/scripts/hooks/augment-chat-history.sh +10 -0
- package/scripts/hooks/cowork-dispatcher.sh +98 -0
- package/scripts/hooks/dispatch_hook.py +35 -0
- package/scripts/hooks_status.py +12 -1
- package/scripts/install-hooks.sh +2 -2
- package/scripts/install.sh +81 -2
- package/scripts/iron_law_sha.py +98 -0
- package/scripts/lint_handoffs.py +214 -0
- package/scripts/lint_hook_manifest.py +2 -1
- package/scripts/lint_load_context.py +35 -5
- package/scripts/measure_rule_budget.py +314 -0
- package/scripts/prototype_lint_contradictions.py +150 -0
- package/scripts/redact_hook_capture.py +148 -0
- package/scripts/schemas/rule.schema.json +55 -6
- package/scripts/schemas/skill.schema.json +5 -0
- package/scripts/skill_linter.py +359 -7
- package/scripts/smoke_path_resolution.py +93 -0
- package/scripts/update_prices.py +3 -3
- package/scripts/validate_frontmatter.py +41 -1
- package/.agent-src/commands/chat-history/checkpoint.md +0 -126
- package/.agent-src/commands/chat-history/clear.md +0 -103
- package/.agent-src/commands/chat-history/resume.md +0 -183
- package/.agent-src/contexts/communication/rules-auto/artifact-engagement-recording-mechanics.md +0 -72
- package/.agent-src/contexts/communication/rules-auto/augment-portability-mechanics.md +0 -79
- package/.agent-src/contexts/communication/rules-auto/cli-output-handling-mechanics.md +0 -87
- package/.agent-src/contexts/communication/rules-auto/command-suggestion-policy-mechanics.md +0 -62
- package/.agent-src/contexts/communication/rules-auto/docs-sync-mechanics.md +0 -78
- package/.agent-src/contexts/communication/rules-auto/package-ci-checks-mechanics.md +0 -85
- package/.agent-src/contexts/communication/rules-auto/review-routing-awareness-mechanics.md +0 -65
- package/.agent-src/contexts/communication/rules-auto/roadmap-progress-sync-mechanics.md +0 -78
- package/.agent-src/contexts/communication/rules-auto/ui-audit-gate-mechanics.md +0 -53
- package/.agent-src/rules/chat-history-cadence.md +0 -143
- package/.agent-src/rules/chat-history-ownership.md +0 -124
- package/.agent-src/rules/chat-history-visibility.md +0 -97
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_heartbeat.py +0 -50
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_turn_check.py +0 -49
- package/scripts/check_phase_coupling.py +0 -148
- /package/{docs → .agent-src/contexts}/contracts/artifact-engagement-flow.md +0 -0
- /package/{docs → .agent-src/contexts}/contracts/command-suggestion-flow.md +0 -0
|
@@ -66,17 +66,21 @@ Show the handoff prompt in a fenced code block and say:
|
|
|
66
66
|
- **Decisions are important** — prevents the new chat from re-asking settled questions.
|
|
67
67
|
- **File list is optional** — only include if the new chat will need to edit specific files.
|
|
68
68
|
|
|
69
|
-
## When to use this vs.
|
|
69
|
+
## When to use this vs. `agents/.agent-chat-history`
|
|
70
70
|
|
|
71
71
|
- `/agent-handoff` is **push-based**: you copy a short summary into the
|
|
72
72
|
new chat. Works across tools (Augment → Claude Code), across machines,
|
|
73
73
|
and without any persistent file.
|
|
74
|
-
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
`/chat-history
|
|
82
|
-
|
|
74
|
+
- `agents/.agent-chat-history` is **pull-based** and **multi-session**: every
|
|
75
|
+
session writes its own entries tagged with a 16-char session
|
|
76
|
+
fingerprint derived from the platform `session_id` (schema v4, see
|
|
77
|
+
[`chat-history-platform-hooks`](../../agents/contexts/chat-history-platform-hooks.md)).
|
|
78
|
+
Works only on the same machine and same repo, but captures every
|
|
79
|
+
phase / decision any session logged. Inspect with `/chat-history show`;
|
|
80
|
+
pull prior-session context into the current chat verbatim with
|
|
81
|
+
`/chat-history import`; mine a prior session for project-improving
|
|
82
|
+
learnings with `/chat-history learn`.
|
|
83
|
+
|
|
84
|
+
Prefer `/agent-handoff` for planned context switches across tools or
|
|
85
|
+
machines; use `/chat-history import` after a crash or fresh-chat reopen
|
|
86
|
+
on the same workspace to surface prior-session context verbatim.
|
|
@@ -23,7 +23,7 @@ commands with a single entry point + sub-command dispatch.
|
|
|
23
23
|
| `/agents prepare` | `commands/agents/prepare.md` | Scaffold the `agents/` directory structure |
|
|
24
24
|
|
|
25
25
|
Sub-command names match the locked contract in
|
|
26
|
-
[`docs/contracts/command-clusters.md`](
|
|
26
|
+
[`docs/contracts/command-clusters.md`](../docs/contracts/command-clusters.md).
|
|
27
27
|
|
|
28
28
|
## Dispatch
|
|
29
29
|
|
|
@@ -182,4 +182,4 @@ What next?
|
|
|
182
182
|
|
|
183
183
|
## See also
|
|
184
184
|
|
|
185
|
-
- [`role-contracts`](
|
|
185
|
+
- [`role-contracts`](../docs/guidelines/agent-infra/role-contracts.md#developer) — Developer mode output contract (Goal / Plan / Changes / Tests / Open questions)
|
|
@@ -175,5 +175,5 @@ What's next?
|
|
|
175
175
|
|
|
176
176
|
## See also
|
|
177
177
|
|
|
178
|
-
- [`role-contracts`](
|
|
179
|
-
- [`role-contracts`](
|
|
178
|
+
- [`role-contracts`](../docs/guidelines/agent-infra/role-contracts.md#incident) — Incident mode output contract (Symptom / Reproduction / Minimal reversible change / Deferred verification / Follow-up commitment) — use when the bug is a live production issue with `break-glass: true`
|
|
179
|
+
- [`role-contracts`](../docs/guidelines/agent-infra/role-contracts.md#developer) — Developer mode output contract for non-incident bugs
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: chat-history:import
|
|
3
|
+
cluster: chat-history
|
|
4
|
+
sub: import
|
|
5
|
+
description: Surface prior chat-history sessions as a numbered table, let the user pick one, read it silently, and emit a short summary plus a resume offer — selective, user-driven cross-session import
|
|
6
|
+
disable-model-invocation: true
|
|
7
|
+
suggestion:
|
|
8
|
+
eligible: true
|
|
9
|
+
trigger_description: "import a past session into the current chat, pull a prior session into context, pick a session to read"
|
|
10
|
+
trigger_context: "user wants to selectively pull a prior session's context into the current one as a short summary"
|
|
11
|
+
---
|
|
12
|
+
<!-- cloud_safe: noop -->
|
|
13
|
+
|
|
14
|
+
# /chat-history import
|
|
15
|
+
|
|
16
|
+
Read-only, **user-driven** cross-session import. Surfaces prior
|
|
17
|
+
sessions logged in `agents/.agent-chat-history` as a numbered table,
|
|
18
|
+
the user picks **one**, the agent reads that session **silently**
|
|
19
|
+
and emits a 2–5 sentence summary, then offers to resume the last
|
|
20
|
+
task from that session. The agent does **not** render entries
|
|
21
|
+
verbatim, auto-import, or rewrite the user's context without an
|
|
22
|
+
explicit instruction.
|
|
23
|
+
|
|
24
|
+
This is the opt-in counterpart to the read-path filter (Phase 3 of
|
|
25
|
+
`road-to-chat-history-session-isolation`): default reads stay
|
|
26
|
+
session-scoped; `import` is the explicit surface for crossing the
|
|
27
|
+
session boundary. For project-improving learnings derived from a
|
|
28
|
+
prior session, see [`/chat-history learn`](learn.md).
|
|
29
|
+
|
|
30
|
+
## When NOT to use
|
|
31
|
+
|
|
32
|
+
- Inspect the current session — that is the default of
|
|
33
|
+
`/chat-history show` plus `scripts/chat_history.py read`.
|
|
34
|
+
- Generate a learning proposal from a prior session — use
|
|
35
|
+
[`/chat-history learn`](learn.md), which orchestrates
|
|
36
|
+
`learning-to-rule-or-skill` on the picked session.
|
|
37
|
+
- Bulk-import all sessions — out of scope for v1. One session per
|
|
38
|
+
invocation; multi-pick is v2.
|
|
39
|
+
- Search prior sessions by content — out of scope for v1; no fuzzy
|
|
40
|
+
search, no full-text grep. The user picks by `last_ts` and
|
|
41
|
+
`summary` from the listing.
|
|
42
|
+
|
|
43
|
+
## Steps
|
|
44
|
+
|
|
45
|
+
### 1. Check if enabled
|
|
46
|
+
|
|
47
|
+
Read `chat_history.enabled` from `.agent-settings.yml`. If `false`
|
|
48
|
+
or the section is missing, say so and stop:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
> 📒 chat-history is disabled (chat_history.enabled = false).
|
|
52
|
+
> Set it to true in .agent-settings.yml to start logging.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 2. List sessions
|
|
56
|
+
|
|
57
|
+
Run `scripts/chat_history.py sessions --json --limit 20 --summary`.
|
|
58
|
+
The helper returns an array of
|
|
59
|
+
`{id, count, first_ts, last_ts, preview, summary}` sorted by
|
|
60
|
+
`last_ts` desc. The `summary` field is built **inside the helper**
|
|
61
|
+
from at most 10 sampled entries per session (5 oldest + 5 newest) —
|
|
62
|
+
token-cheap, no need to ever read the full body for the picker.
|
|
63
|
+
Default excludes empty buckets — only sessions with at least one
|
|
64
|
+
body entry are surfaced.
|
|
65
|
+
|
|
66
|
+
If the array is empty, stop:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
> 📒 No prior sessions found in agents/.agent-chat-history.
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 3. Surface as a numbered table
|
|
73
|
+
|
|
74
|
+
Render the sessions as a markdown table — the row number is the
|
|
75
|
+
option (per `user-interaction` Iron Law: numbered options for any
|
|
76
|
+
picker). The session `id` is noise to humans; keep it **internal**
|
|
77
|
+
for step 5's `read --session <id>` call and never render it.
|
|
78
|
+
Format:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
Pick a session to import:
|
|
82
|
+
|
|
83
|
+
| # | Date | Entries | Summary |
|
|
84
|
+
|----|------------------|---------|---------|
|
|
85
|
+
| 1 | YYYY-MM-DD HH:MM | N | {summary} |
|
|
86
|
+
| 2 | YYYY-MM-DD HH:MM | N | {summary} |
|
|
87
|
+
| … | | | |
|
|
88
|
+
| N | — | — | abort — do not read any session |
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Format the timestamp as `YYYY-MM-DD HH:MM` (drop seconds and
|
|
92
|
+
timezone — the listing is for orientation, not forensics). Lead the
|
|
93
|
+
`Summary` cell with the helper's `summary` field — that is the
|
|
94
|
+
rough arc the user picks by (`<first user msg> → <last user msg>`
|
|
95
|
+
for normal sessions, or `(N entries — no user prompts; t-mix: …)`
|
|
96
|
+
for tool-only sessions). Do **not** truncate or rewrite `summary` —
|
|
97
|
+
markdown table wrap handles long values. Always include an explicit
|
|
98
|
+
`abort` row as the last numbered option. Track option-number → `id`
|
|
99
|
+
internally so step 5 can call `scripts/chat_history.py read
|
|
100
|
+
--session <id>` with the right id.
|
|
101
|
+
|
|
102
|
+
### 4. Wait for the pick
|
|
103
|
+
|
|
104
|
+
**One question per turn** (per `ask-when-uncertain`). Do not chain
|
|
105
|
+
the listing with anything else; do not auto-pick; do not surface a
|
|
106
|
+
default. Wait for the user's response.
|
|
107
|
+
|
|
108
|
+
If the user picks the abort option, stop without reading.
|
|
109
|
+
|
|
110
|
+
### 5. Read the picked session silently
|
|
111
|
+
|
|
112
|
+
Run `scripts/chat_history.py read --session <id> --last <count>`,
|
|
113
|
+
where `<count>` is the picked row's `count` from step 2. The
|
|
114
|
+
`--last` flag is **required** — the helper defaults to 5 entries,
|
|
115
|
+
which would silently truncate any longer session. The helper returns
|
|
116
|
+
the entries as JSON.
|
|
117
|
+
|
|
118
|
+
**Do not render the entries.** The verbose dump was reversed by the
|
|
119
|
+
user — token cost and scroll fatigue outweighed the verbatim
|
|
120
|
+
contract. Read the JSON in-context, then proceed to step 6.
|
|
121
|
+
|
|
122
|
+
### 6. Summarise and offer to resume
|
|
123
|
+
|
|
124
|
+
Emit a **2–5 sentence** summary of the picked session: the topic,
|
|
125
|
+
what was decided or built, and where it left off (the last task in
|
|
126
|
+
progress, if any). Plain prose — no bullets, no headings, no
|
|
127
|
+
verbatim quotes.
|
|
128
|
+
|
|
129
|
+
Then offer the resume choice as numbered options
|
|
130
|
+
(per `user-interaction`), one question per turn:
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
1. resume — pick up the last task from that session
|
|
134
|
+
2. stop — keep the summary in context, do nothing else
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Wait for the pick. Do **not** auto-resume. If the user picks
|
|
138
|
+
`resume`, hand off to the relevant skill or command for that work;
|
|
139
|
+
do not silently start editing files. The agent does not write to
|
|
140
|
+
the current session's log on the user's behalf without an explicit
|
|
141
|
+
instruction.
|
|
142
|
+
|
|
143
|
+
## Gotchas
|
|
144
|
+
|
|
145
|
+
- **Summary, not verbatim.** Earlier Council R2-2 favoured verbatim
|
|
146
|
+
rendering; reversed in practice — too slow, too token-expensive.
|
|
147
|
+
The agent reads the picked session in-context and emits a 2–5
|
|
148
|
+
sentence summary. Verbatim rendering is no longer part of the
|
|
149
|
+
contract.
|
|
150
|
+
- **One pick per invocation.** Multi-pick is v2. If the user wants
|
|
151
|
+
a second session, run `/chat-history import` again.
|
|
152
|
+
- **Read-only.** This command never writes to `agents/.agent-chat-history`
|
|
153
|
+
and never rotates.
|
|
154
|
+
- **`<legacy>` and `<unknown>` buckets** show up like any other
|
|
155
|
+
session id when they have body entries — the user can pick them
|
|
156
|
+
too. The helper aggregates body entries with no `s` field into
|
|
157
|
+
`<legacy>` and entries with `s == "<unknown>"` into `<unknown>`.
|
|
158
|
+
|
|
159
|
+
## See also
|
|
160
|
+
|
|
161
|
+
- [`/chat-history learn`](learn.md) — pick a prior session and turn it into a project-improving proposal via `learning-to-rule-or-skill`
|
|
162
|
+
- [`/chat-history show`](show.md) — current-session inspector
|
|
163
|
+
- [`chat-history-platform-hooks`](../../../agents/contexts/chat-history-platform-hooks.md) — read contract, isolation default, opt-in cross-session path
|
|
164
|
+
- [`scripts/chat_history.py`](../../../scripts/chat_history.py) — `sessions` and `read --session` CLI surface
|
|
165
|
+
- [`user-interaction`](../../rules/user-interaction.md) — numbered-options Iron Law
|
|
166
|
+
- [`ask-when-uncertain`](../../rules/ask-when-uncertain.md) — one-question-per-turn Iron Law
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: chat-history:learn
|
|
3
|
+
cluster: chat-history
|
|
4
|
+
sub: learn
|
|
5
|
+
skills: [learning-to-rule-or-skill]
|
|
6
|
+
description: Pick a prior chat-history session and mine it for project-improving learnings — runs learning-to-rule-or-skill on the picked session, drafts proposal(s) under agents/proposals/
|
|
7
|
+
disable-model-invocation: true
|
|
8
|
+
suggestion:
|
|
9
|
+
eligible: true
|
|
10
|
+
trigger_description: "extract a learning from a past session, mine chat-history for proposals, what did we learn last session, codify a pattern from a prior session"
|
|
11
|
+
trigger_context: "user wants to derive a rule/skill/guideline proposal from the content of one prior session"
|
|
12
|
+
---
|
|
13
|
+
<!-- cloud_safe: noop -->
|
|
14
|
+
|
|
15
|
+
# /chat-history learn
|
|
16
|
+
|
|
17
|
+
User-driven **learning extraction** from a prior session. Surfaces
|
|
18
|
+
prior sessions logged in `agents/.agent-chat-history` as numbered options,
|
|
19
|
+
the user picks **one**, the agent reads that session's entries and
|
|
20
|
+
runs the [`learning-to-rule-or-skill`](../../skills/learning-to-rule-or-skill/SKILL.md)
|
|
21
|
+
workflow on the content — surfacing repeated mistakes, successful
|
|
22
|
+
patterns, or constraints worth codifying as a rule, skill, or
|
|
23
|
+
guideline proposal.
|
|
24
|
+
|
|
25
|
+
This is the **project-improvement** counterpart to
|
|
26
|
+
[`/chat-history import`](import.md): `import` renders a session
|
|
27
|
+
verbatim into the current chat for the user to act on; `learn`
|
|
28
|
+
mines a session for proposals that improve the agent or the
|
|
29
|
+
project itself.
|
|
30
|
+
|
|
31
|
+
## When NOT to use
|
|
32
|
+
|
|
33
|
+
- Pull a prior session into the current chat verbatim — use
|
|
34
|
+
[`/chat-history import`](import.md).
|
|
35
|
+
- Capture a learning that originated **in the current** session —
|
|
36
|
+
invoke the [`learning-to-rule-or-skill`](../../skills/learning-to-rule-or-skill/SKILL.md)
|
|
37
|
+
skill directly. `learn` is for prior-session mining only.
|
|
38
|
+
- Bulk-mine all sessions — out of scope for v1. One session per
|
|
39
|
+
invocation; multi-pick is v2.
|
|
40
|
+
|
|
41
|
+
## Steps
|
|
42
|
+
|
|
43
|
+
### 1. Check if enabled
|
|
44
|
+
|
|
45
|
+
Read `chat_history.enabled` from `.agent-settings.yml`. If `false`
|
|
46
|
+
or the section is missing, say so and stop:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
> 📒 chat-history is disabled (chat_history.enabled = false).
|
|
50
|
+
> Set it to true in .agent-settings.yml to start logging.
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 2. List sessions
|
|
54
|
+
|
|
55
|
+
Run `scripts/chat_history.py sessions --json --limit 20 --summary`.
|
|
56
|
+
The helper returns an array of
|
|
57
|
+
`{id, count, first_ts, last_ts, preview, summary}` sorted by
|
|
58
|
+
`last_ts` desc. The `summary` field is built inside the helper
|
|
59
|
+
from ≤10 sampled entries per session (5 oldest + 5 newest) —
|
|
60
|
+
token-cheap, no full-body read needed for the picker. Empty
|
|
61
|
+
buckets are excluded by default.
|
|
62
|
+
|
|
63
|
+
If the array is empty, stop:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
> 📒 No prior sessions found in agents/.agent-chat-history.
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 3. Surface as numbered options
|
|
70
|
+
|
|
71
|
+
Render each session as a numbered option (per the `user-interaction`
|
|
72
|
+
rule — Iron Law: numbered options for any picker). Lead with the
|
|
73
|
+
helper's `summary` field — the rough arc the user picks by
|
|
74
|
+
(`<first user msg> → <last user msg>`, or
|
|
75
|
+
`(N entries — no user prompts; t-mix: …)` for tool-only sessions).
|
|
76
|
+
Keep the session `id` **internal** for step 5's `read --session <id>`
|
|
77
|
+
call; never render it in the listing. Format:
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
> Pick a session to mine for learnings:
|
|
81
|
+
>
|
|
82
|
+
> 1. {summary}
|
|
83
|
+
> {YYYY-MM-DD HH:MM} · {count} entries
|
|
84
|
+
> 2. ...
|
|
85
|
+
> ...
|
|
86
|
+
> N. abort — do not extract any learning
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Format the timestamp as `YYYY-MM-DD HH:MM` (drop seconds + timezone
|
|
90
|
+
— orientation, not forensics). Do not truncate or rewrite `summary`
|
|
91
|
+
— the helper already shapes it. Always include an explicit abort
|
|
92
|
+
option last. Track option-number → `id` internally so step 5 calls
|
|
93
|
+
`scripts/chat_history.py read --session <id>` with the right id.
|
|
94
|
+
|
|
95
|
+
### 4. Wait for the pick
|
|
96
|
+
|
|
97
|
+
**One question per turn** (per `ask-when-uncertain`). Do not chain
|
|
98
|
+
the listing with anything else; do not auto-pick; do not surface a
|
|
99
|
+
default. Wait for the user's response.
|
|
100
|
+
|
|
101
|
+
If the user picks the abort option, stop without reading.
|
|
102
|
+
|
|
103
|
+
### 5. Read the picked session
|
|
104
|
+
|
|
105
|
+
Run `scripts/chat_history.py read --session <id>` with the picked
|
|
106
|
+
`id`. Hold the entries in working memory — do **not** render them
|
|
107
|
+
verbatim into the chat. The verbatim path is `import`'s job; here
|
|
108
|
+
the entries are input to step 6.
|
|
109
|
+
|
|
110
|
+
### 6. Run `learning-to-rule-or-skill`
|
|
111
|
+
|
|
112
|
+
Apply the [`learning-to-rule-or-skill`](../../skills/learning-to-rule-or-skill/SKILL.md)
|
|
113
|
+
procedure on the session content:
|
|
114
|
+
|
|
115
|
+
1. **Scan** the entries for candidate learnings — repeated
|
|
116
|
+
mistakes, successful patterns, friction points, or constraints
|
|
117
|
+
stated by the user.
|
|
118
|
+
2. **Pass each candidate through the Promotion Gate** (§ 0 of the
|
|
119
|
+
skill): repetition, impact, failure pattern, non-duplication,
|
|
120
|
+
scope fit, minimal. Drop candidates that fail any gate.
|
|
121
|
+
3. **For each surviving candidate**, run § 4 (search protocol — all
|
|
122
|
+
four steps), then decide rule / skill / guideline / update / no
|
|
123
|
+
action per § 3 of the skill.
|
|
124
|
+
4. **Draft a proposal** for every candidate that warrants one,
|
|
125
|
+
following § 8 of the skill (proposal template under
|
|
126
|
+
`agents/proposals/<id>.md`).
|
|
127
|
+
|
|
128
|
+
If multiple candidates survive, draft them as **separate**
|
|
129
|
+
proposals — do not merge unrelated learnings into one.
|
|
130
|
+
|
|
131
|
+
### 7. Surface the result
|
|
132
|
+
|
|
133
|
+
Hand back to the user with a structured summary per surviving
|
|
134
|
+
candidate:
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
> 📒 Mined session {id} — {N} candidate(s) surfaced
|
|
138
|
+
|
|
139
|
+
> 1. {learning title}
|
|
140
|
+
> Decision: {rule|skill|guideline|update|no action}
|
|
141
|
+
> Proposal: agents/proposals/{proposal_id}.md
|
|
142
|
+
> Gate: {pass|fail — reason}
|
|
143
|
+
> 2. ...
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
If no candidate cleared the Promotion Gate, say so explicitly:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
> 📒 Mined session {id} — no candidate cleared the Promotion Gate.
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Do **not** open a PR, do **not** commit the proposals — proposal
|
|
153
|
+
files land in `agents/proposals/` (gitignored or curated per
|
|
154
|
+
project policy) for the user to review and route via
|
|
155
|
+
`upstream-contribute` or merge into `agents/overrides/`.
|
|
156
|
+
|
|
157
|
+
## Gotchas
|
|
158
|
+
|
|
159
|
+
- **Promotion Gate is hard.** A grep miss is not proof of
|
|
160
|
+
non-duplication — § 4 of the skill mandates the four-step search
|
|
161
|
+
protocol. Do not skip it.
|
|
162
|
+
- **One pick per invocation.** Multi-pick is v2. If the user wants
|
|
163
|
+
to mine a second session, run `/chat-history learn` again.
|
|
164
|
+
- **Read-only on the log.** This command never writes to
|
|
165
|
+
`agents/.agent-chat-history`. It writes proposal drafts under
|
|
166
|
+
`agents/proposals/` only.
|
|
167
|
+
- **No auto-promotion.** Drafted proposals stay in `proposals/`
|
|
168
|
+
until the user routes them. `learn` never invokes
|
|
169
|
+
`upstream-contribute` itself.
|
|
170
|
+
|
|
171
|
+
## See also
|
|
172
|
+
|
|
173
|
+
- [`/chat-history import`](import.md) — verbatim render of a prior session
|
|
174
|
+
- [`learning-to-rule-or-skill`](../../skills/learning-to-rule-or-skill/SKILL.md) — the workflow this command orchestrates
|
|
175
|
+
- [`upstream-contribute`](../../skills/upstream-contribute/SKILL.md) — promote a project-scoped proposal upstream
|
|
176
|
+
- [`scripts/chat_history.py`](../../../scripts/chat_history.py) — `sessions` and `read --session` CLI surface
|
|
177
|
+
- [`user-interaction`](../../rules/user-interaction.md) — numbered-options Iron Law
|
|
178
|
+
- [`ask-when-uncertain`](../../rules/ask-when-uncertain.md) — one-question-per-turn Iron Law
|
|
@@ -11,14 +11,15 @@ suggestion:
|
|
|
11
11
|
<!-- cloud_safe: noop -->
|
|
12
12
|
|
|
13
13
|
# /chat-history show
|
|
14
|
-
Inspect
|
|
15
|
-
|
|
14
|
+
Inspect `agents/.agent-chat-history` — the JSONL log appended by the
|
|
15
|
+
structural chat-history hooks (`ChatHistoryAppendHook`,
|
|
16
|
+
`ChatHistoryHaltAppendHook`) for crash recovery.
|
|
16
17
|
|
|
17
18
|
Shows:
|
|
18
19
|
|
|
19
20
|
- Whether the file exists and whether logging is currently enabled
|
|
20
21
|
- File size vs `max_size_kb`
|
|
21
|
-
- Header metadata:
|
|
22
|
+
- Header metadata: schema version, `started`, `frequency`
|
|
22
23
|
- Entry count and age of the oldest/newest entry
|
|
23
24
|
- A peek at the last 3–5 entries so the user can see what was captured
|
|
24
25
|
|
|
@@ -26,9 +27,8 @@ Read-only — this command never writes to the file.
|
|
|
26
27
|
|
|
27
28
|
## When NOT to use
|
|
28
29
|
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
- Wipe the file → [`/chat-history clear`](chat-history-clear.md).
|
|
30
|
+
- Wipe the file → delete `agents/.agent-chat-history` manually; it is
|
|
31
|
+
git-ignored and will be recreated on the next hook fire.
|
|
32
32
|
- Configure logging behavior → edit `.agent-settings.yml` directly
|
|
33
33
|
(`chat_history.*`); see
|
|
34
34
|
[`layered-settings`](../../docs/guidelines/agent-infra/layered-settings.md#section-aware-merge-rules).
|
|
@@ -66,10 +66,10 @@ Render a concise report:
|
|
|
66
66
|
```
|
|
67
67
|
> 📒 chat-history status
|
|
68
68
|
>
|
|
69
|
-
> File:
|
|
69
|
+
> File: agents/.agent-chat-history ({size_kb} KB / {max_size_kb} KB)
|
|
70
70
|
> Entries: {entries}
|
|
71
|
-
>
|
|
72
|
-
> Frequency: {
|
|
71
|
+
> Schema: v{header.v} (started {header.started})
|
|
72
|
+
> Frequency: {header.freq}
|
|
73
73
|
> Overflow: {on_overflow}
|
|
74
74
|
>
|
|
75
75
|
> Last entries:
|
|
@@ -84,15 +84,16 @@ data, see [`token-efficiency`](../rules/token-efficiency.md)).
|
|
|
84
84
|
|
|
85
85
|
### 5. Offer follow-ups (optional)
|
|
86
86
|
|
|
87
|
-
If the file exists and the fingerprint does **not** match the current
|
|
88
|
-
session, suggest `/chat-history resume` to adopt it.
|
|
89
|
-
|
|
90
87
|
If the file is close to `max_size_kb` (> 80 %), mention it — the next
|
|
91
|
-
append may trigger overflow handling.
|
|
88
|
+
append may trigger overflow handling. To pull a specific prior
|
|
89
|
+
session into the current chat verbatim, point the user at
|
|
90
|
+
`/chat-history import`; to mine a prior session for project-improving
|
|
91
|
+
learnings, `/chat-history learn`. The body filter on `s` is the v4
|
|
92
|
+
isolation surface in both cases.
|
|
92
93
|
|
|
93
94
|
## Gotchas
|
|
94
95
|
|
|
95
|
-
-
|
|
96
|
+
- `agents/.agent-chat-history` is git-ignored. This command never commits.
|
|
96
97
|
- The helper is the only way to read the file — do not cat or parse
|
|
97
98
|
the JSONL directly; entry shape is owned by `scripts/chat_history.py`.
|
|
98
99
|
- If `exists: false` but the rule says logging is enabled, the file is
|
|
@@ -100,8 +101,6 @@ append may trigger overflow handling.
|
|
|
100
101
|
|
|
101
102
|
## See also
|
|
102
103
|
|
|
103
|
-
- [`chat-history`](
|
|
104
|
-
- [`/chat-history resume`](chat-history-resume.md) — adopt + load
|
|
105
|
-
- [`/chat-history clear`](chat-history-clear.md) — wipe
|
|
104
|
+
- [`chat-history-platform-hooks`](../../../agents/contexts/chat-history-platform-hooks.md) — the hook-only contract
|
|
106
105
|
- [`agent-settings` template](../templates/agent-settings.md) — `chat_history.*` reference
|
|
107
|
-
- [`scripts/chat_history.py`](../../../scripts/chat_history.py) — helper API
|
|
106
|
+
- [`scripts/chat_history.py`](../../../scripts/chat_history.py) — helper API (`status`, `read`, `sessions`, `prune-sessions`)
|
|
@@ -1,51 +1,52 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: chat-history
|
|
3
|
-
description: Chat-history orchestrator — routes to show,
|
|
3
|
+
description: Chat-history orchestrator — routes to show, import, learn
|
|
4
4
|
cluster: chat-history
|
|
5
5
|
disable-model-invocation: true
|
|
6
6
|
suggestion:
|
|
7
7
|
eligible: true
|
|
8
|
-
trigger_description: "show chat-history status,
|
|
9
|
-
trigger_context: "user wants to inspect
|
|
8
|
+
trigger_description: "show chat-history status, inspect agents/.agent-chat-history log, import a prior session into the current chat, mine a prior session for project-improving learnings"
|
|
9
|
+
trigger_context: "user wants to inspect the persistent agents/.agent-chat-history log, pull a prior session in verbatim, or extract learnings from a prior session"
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
<!-- cloud_safe: noop -->
|
|
13
13
|
|
|
14
14
|
# /chat-history
|
|
15
15
|
|
|
16
|
-
Top-level orchestrator for the `/chat-history` family.
|
|
17
|
-
|
|
16
|
+
Top-level orchestrator for the `/chat-history` family. After the
|
|
17
|
+
hook-only reduction (`road-to-chat-history-hook-only`) writes and
|
|
18
|
+
overflow handling are driven entirely by platform hooks +
|
|
19
|
+
`scripts/chat_history.py` internals; the surfaced sub-commands are
|
|
20
|
+
read-only on the log itself. Sessions coexist in one log file —
|
|
21
|
+
each entry self-tags via the `s` field — so there is no ownership
|
|
22
|
+
layer to recover from.
|
|
18
23
|
|
|
19
24
|
## Sub-commands
|
|
20
25
|
|
|
21
26
|
| Sub-command | Routes to | Purpose |
|
|
22
27
|
|---|---|---|
|
|
23
|
-
| `/chat-history show` | `commands/chat-history/show.md` | Inspect the log — size, entries,
|
|
24
|
-
| `/chat-history
|
|
25
|
-
| `/chat-history
|
|
26
|
-
| `/chat-history checkpoint` | `commands/chat-history/checkpoint.md` | Append a phase-boundary entry on CHECKPOINT-class platforms |
|
|
27
|
-
|
|
28
|
-
Sub-command names match the locked contract in
|
|
29
|
-
[`docs/contracts/command-clusters.md`](../../docs/contracts/command-clusters.md).
|
|
28
|
+
| `/chat-history show` | `commands/chat-history/show.md` | Inspect the log — size, entries, header, last entries |
|
|
29
|
+
| `/chat-history import` | `commands/chat-history/import.md` | List prior sessions, pick one, render its entries verbatim — selective cross-session import |
|
|
30
|
+
| `/chat-history learn` | `commands/chat-history/learn.md` | List prior sessions, pick one, mine it for project-improving learnings via `learning-to-rule-or-skill` |
|
|
30
31
|
|
|
31
32
|
## Dispatch
|
|
32
33
|
|
|
33
34
|
1. Parse the user's argument: `/chat-history <sub-command> [args]`.
|
|
34
35
|
2. Look up the sub-command in the table above.
|
|
35
|
-
3. Load the body of the routed file and follow its `##
|
|
36
|
-
|
|
37
|
-
4. If the sub-command is unknown or missing
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
> 2. resume — adopt the log into the conversation
|
|
42
|
-
> 3. clear — wipe the file
|
|
43
|
-
> 4. checkpoint — append a phase-boundary entry
|
|
36
|
+
3. Load the body of the routed file and follow its `## Steps`
|
|
37
|
+
section verbatim with the remaining args.
|
|
38
|
+
4. If the sub-command is unknown or missing (including the bare
|
|
39
|
+
`/chat-history` invocation), route to `show` — the safe,
|
|
40
|
+
current-session inspector default. `import` and `learn` are
|
|
41
|
+
opt-in only.
|
|
44
42
|
|
|
45
43
|
## Rules
|
|
46
44
|
|
|
47
|
-
- **Do NOT commit, push, or open a PR**
|
|
48
|
-
|
|
45
|
+
- **Do NOT commit, push, or open a PR** — `show` and `import` are
|
|
46
|
+
read-only; `learn` writes proposal drafts under
|
|
47
|
+
`agents/proposals/` only and does not commit them.
|
|
49
48
|
- **Do NOT chain sub-commands.** One `/chat-history <sub>` per turn.
|
|
50
|
-
-
|
|
51
|
-
|
|
49
|
+
- **`import` and `learn` cross the session boundary** — only run
|
|
50
|
+
them when the user explicitly asked for cross-session reading.
|
|
51
|
+
The default read path (filtered to current session) stays in
|
|
52
|
+
effect for every other tool.
|
|
@@ -50,6 +50,18 @@ For each changed `.md` file:
|
|
|
50
50
|
pleasantries, hedging, connective fluff (however, furthermore, additionally),
|
|
51
51
|
redundant wording, obvious framework knowledge, repeated explanations, decorative prose
|
|
52
52
|
- **Shorten:** "in order to" → "to", "make sure to" → "ensure", use short synonyms
|
|
53
|
+
- **Abbreviate** common terms when context unambiguous: `DB`, `auth`,
|
|
54
|
+
`config`, `req`, `res`, `fn`, `impl`, `env`, `deps`, `ctx`. Skip on
|
|
55
|
+
first occurrence of the concept in the file, or when the
|
|
56
|
+
abbreviation collides with a domain term (`auth` stays
|
|
57
|
+
`authentication` inside an auth-module file). Never abbreviate
|
|
58
|
+
inside code blocks, frontmatter, file paths, command strings, or
|
|
59
|
+
Iron Law fenced blocks.
|
|
60
|
+
- **Arrows for causality:** `X causes Y` / `X leads to Y` / `X, then Y`
|
|
61
|
+
→ `X → Y`. Keep arrows out of code blocks, frontmatter, and Iron
|
|
62
|
+
Law fenced blocks; surrounding prose only. (Example phrases
|
|
63
|
+
backticked on purpose — inline-code protection skips them; never
|
|
64
|
+
strip the backticks.)
|
|
53
65
|
- **Fragments OK:** "Run tests before commit" not "You should always run tests before committing"
|
|
54
66
|
- **Drop:** "you should", "make sure to", "remember to" — state action directly
|
|
55
67
|
- **Merge** redundant bullets that say the same thing differently
|
|
@@ -76,9 +76,9 @@ Based on the type, analyze the relevant code area:
|
|
|
76
76
|
- Identify all models and tables involved
|
|
77
77
|
|
|
78
78
|
**Service context:**
|
|
79
|
-
- Read the service class and its
|
|
79
|
+
- Read the service class and its deps
|
|
80
80
|
- Trace call chain (who calls it, what it calls)
|
|
81
|
-
- Identify configuration and env
|
|
81
|
+
- Identify configuration and env deps
|
|
82
82
|
|
|
83
83
|
**Integration context:**
|
|
84
84
|
- Find API client classes, HTTP calls
|
|
@@ -22,7 +22,7 @@ commands with a single entry point + sub-command dispatch.
|
|
|
22
22
|
| `/context refactor` | `commands/context/refactor.md` | Analyze, update, and extend an existing context document |
|
|
23
23
|
|
|
24
24
|
Sub-command names match the locked contract in
|
|
25
|
-
[`docs/contracts/command-clusters.md`](
|
|
25
|
+
[`docs/contracts/command-clusters.md`](../docs/contracts/command-clusters.md).
|
|
26
26
|
|
|
27
27
|
## Dispatch
|
|
28
28
|
|
|
@@ -22,7 +22,7 @@ standalone commands with a single entry point + sub-command dispatch.
|
|
|
22
22
|
| `/copilot-agents optimize` | `commands/copilot-agents/optimize.md` | Refactor existing AGENTS.md and copilot-instructions.md for line budgets |
|
|
23
23
|
|
|
24
24
|
Sub-command names match the locked contract in
|
|
25
|
-
[`docs/contracts/command-clusters.md`](
|
|
25
|
+
[`docs/contracts/command-clusters.md`](../docs/contracts/command-clusters.md).
|
|
26
26
|
|
|
27
27
|
## Dispatch
|
|
28
28
|
|