@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.
- package/.agent-src/commands/agent-handoff.md +4 -1
- package/.agent-src/commands/agent-status.md +3 -0
- package/.agent-src/commands/agents-audit.md +4 -0
- package/.agent-src/commands/agents-cleanup.md +6 -1
- package/.agent-src/commands/agents-prepare.md +3 -0
- package/.agent-src/commands/analyze-reference-repo.md +4 -0
- package/.agent-src/commands/bug-fix.md +7 -3
- package/.agent-src/commands/bug-investigate.md +4 -0
- package/.agent-src/commands/chat-history-checkpoint.md +126 -0
- package/.agent-src/commands/chat-history-clear.md +6 -1
- package/.agent-src/commands/chat-history-resume.md +7 -2
- package/.agent-src/commands/chat-history.md +7 -2
- package/.agent-src/commands/check-current-md.md +137 -0
- package/.agent-src/commands/commit-in-chunks.md +118 -0
- package/.agent-src/commands/commit.md +4 -0
- package/.agent-src/commands/compress.md +37 -2
- package/.agent-src/commands/context-create.md +4 -0
- package/.agent-src/commands/context-refactor.md +4 -0
- package/.agent-src/commands/copilot-agents-init.md +3 -0
- package/.agent-src/commands/copilot-agents-optimize.md +3 -0
- package/.agent-src/commands/create-pr-description.md +4 -0
- package/.agent-src/commands/create-pr.md +4 -0
- package/.agent-src/commands/do-and-judge.md +4 -1
- package/.agent-src/commands/do-in-steps.md +3 -0
- package/.agent-src/commands/e2e-heal.md +4 -0
- package/.agent-src/commands/e2e-plan.md +4 -0
- package/.agent-src/commands/estimate-ticket.md +4 -1
- package/.agent-src/commands/feature-dev.md +4 -0
- package/.agent-src/commands/feature-explore.md +4 -0
- package/.agent-src/commands/feature-plan.md +4 -0
- package/.agent-src/commands/feature-refactor.md +4 -0
- package/.agent-src/commands/feature-roadmap.md +6 -0
- package/.agent-src/commands/fix-ci.md +4 -0
- package/.agent-src/commands/fix-portability.md +5 -2
- package/.agent-src/commands/fix-pr-bot-comments.md +4 -0
- package/.agent-src/commands/fix-pr-comments.md +4 -0
- package/.agent-src/commands/fix-pr-developer-comments.md +4 -0
- package/.agent-src/commands/fix-references.md +3 -0
- package/.agent-src/commands/fix-seeder.md +4 -0
- package/.agent-src/commands/implement-ticket.md +39 -13
- package/.agent-src/commands/jira-ticket.md +4 -0
- package/.agent-src/commands/judge.md +3 -0
- package/.agent-src/commands/memory-add.md +5 -3
- package/.agent-src/commands/memory-full.md +5 -2
- package/.agent-src/commands/memory-promote.md +7 -6
- package/.agent-src/commands/mode.md +3 -0
- package/.agent-src/commands/module-create.md +4 -0
- package/.agent-src/commands/module-explore.md +4 -0
- package/.agent-src/commands/onboard.md +33 -0
- package/.agent-src/commands/optimize-agents.md +4 -0
- package/.agent-src/commands/optimize-augmentignore.md +12 -0
- package/.agent-src/commands/optimize-rtk-filters.md +3 -0
- package/.agent-src/commands/optimize-skills.md +4 -0
- package/.agent-src/commands/override-create.md +4 -0
- package/.agent-src/commands/override-manage.md +4 -0
- package/.agent-src/commands/package-reset.md +3 -0
- package/.agent-src/commands/package-test.md +3 -0
- package/.agent-src/commands/prepare-for-review.md +4 -0
- package/.agent-src/commands/project-analyze.md +4 -0
- package/.agent-src/commands/project-health.md +4 -0
- package/.agent-src/commands/propose-memory.md +6 -8
- package/.agent-src/commands/quality-fix.md +4 -0
- package/.agent-src/commands/refine-ticket.md +12 -7
- package/.agent-src/commands/review-changes.md +39 -8
- package/.agent-src/commands/review-routing.md +4 -0
- package/.agent-src/commands/roadmap-create.md +18 -0
- package/.agent-src/commands/roadmap-execute.md +14 -1
- package/.agent-src/commands/rule-compliance-audit.md +4 -0
- package/.agent-src/commands/set-cost-profile.md +11 -0
- package/.agent-src/commands/sync-agent-settings.md +12 -0
- package/.agent-src/commands/sync-gitignore.md +3 -0
- package/.agent-src/commands/tests-create.md +4 -0
- package/.agent-src/commands/tests-execute.md +6 -3
- package/.agent-src/commands/threat-model.md +4 -0
- package/.agent-src/commands/update-form-request-messages.md +4 -0
- package/.agent-src/commands/upstream-contribute.md +4 -0
- package/.agent-src/commands/work.md +161 -0
- package/.agent-src/guidelines/agent-infra/engineering-memory-data-format.md +2 -6
- package/.agent-src/guidelines/agent-infra/layered-settings.md +0 -1
- package/.agent-src/guidelines/agent-infra/memory-access.md +0 -7
- package/.agent-src/guidelines/agent-infra/role-contracts.md +2 -4
- package/.agent-src/guidelines/agent-infra/self-improvement-pipeline.md +0 -1
- package/.agent-src/guidelines/php/patterns/strategy.md +180 -2
- package/.agent-src/personas/README.md +0 -1
- package/.agent-src/rules/artifact-drafting-protocol.md +7 -2
- package/.agent-src/rules/artifact-engagement-recording.md +133 -0
- package/.agent-src/rules/ask-when-uncertain.md +18 -13
- package/.agent-src/rules/augment-portability.md +64 -37
- package/.agent-src/rules/autonomous-execution.md +158 -0
- package/.agent-src/rules/chat-history-cadence.md +109 -0
- package/.agent-src/rules/chat-history-ownership.md +123 -0
- package/.agent-src/rules/chat-history-visibility.md +96 -0
- package/.agent-src/rules/cli-output-handling.md +27 -4
- package/.agent-src/rules/command-suggestion.md +134 -0
- package/.agent-src/rules/commit-policy.md +109 -0
- package/.agent-src/rules/direct-answers.md +114 -0
- package/.agent-src/rules/docs-sync.md +36 -0
- package/.agent-src/rules/downstream-changes.md +10 -9
- package/.agent-src/rules/improve-before-implement.md +9 -6
- package/.agent-src/rules/language-and-tone.md +85 -6
- package/.agent-src/rules/non-destructive-by-default.md +117 -0
- package/.agent-src/rules/package-ci-checks.md +4 -0
- package/.agent-src/rules/preservation-guard.md +20 -0
- package/.agent-src/rules/roadmap-progress-sync.md +159 -27
- package/.agent-src/rules/role-mode-adherence.md +1 -1
- package/.agent-src/rules/scope-control.md +42 -1
- package/.agent-src/rules/size-enforcement.md +2 -3
- package/.agent-src/rules/skill-quality.md +3 -8
- package/.agent-src/rules/ui-audit-before-build.md +106 -0
- package/.agent-src/rules/user-interaction.md +107 -51
- package/.agent-src/scripts/update_roadmap_progress.py +73 -9
- package/.agent-src/skills/blade-ui/SKILL.md +47 -3
- package/.agent-src/skills/command-routing/SKILL.md +32 -0
- package/.agent-src/skills/command-writing/SKILL.md +52 -2
- package/.agent-src/skills/description-assist/SKILL.md +21 -0
- package/.agent-src/skills/estimate-ticket/SKILL.md +0 -1
- package/.agent-src/skills/existing-ui-audit/SKILL.md +202 -0
- package/.agent-src/skills/fe-design/SKILL.md +78 -61
- package/.agent-src/skills/file-editor/SKILL.md +9 -0
- package/.agent-src/skills/finishing-a-development-branch/SKILL.md +4 -0
- package/.agent-src/skills/flux/SKILL.md +31 -4
- package/.agent-src/skills/guideline-writing/SKILL.md +24 -2
- package/.agent-src/skills/learning-to-rule-or-skill/SKILL.md +51 -9
- package/.agent-src/skills/livewire/SKILL.md +49 -4
- package/.agent-src/skills/md-language-check/SKILL.md +103 -0
- package/.agent-src/skills/php-coder/SKILL.md +24 -0
- package/.agent-src/skills/react-shadcn-ui/SKILL.md +121 -0
- package/.agent-src/skills/refine-prompt/SKILL.md +220 -0
- package/.agent-src/skills/refine-ticket/SKILL.md +32 -28
- package/.agent-src/skills/roadmap-management/SKILL.md +24 -11
- package/.agent-src/skills/rule-writing/SKILL.md +23 -1
- package/.agent-src/skills/skill-writing/SKILL.md +3 -5
- package/.agent-src/skills/upstream-contribute/SKILL.md +3 -3
- package/.agent-src/skills/using-git-worktrees/SKILL.md +3 -1
- package/.agent-src/templates/AGENTS.md +24 -6
- package/.agent-src/templates/agent-settings.md +149 -0
- package/.agent-src/templates/roadmaps.md +11 -4
- package/.agent-src/templates/scripts/implement_ticket/__init__.py +63 -26
- package/.agent-src/templates/scripts/implement_ticket/__main__.py +8 -2
- package/.agent-src/templates/scripts/memory_lookup.py +1 -1
- package/.agent-src/templates/scripts/telemetry/__init__.py +42 -0
- package/.agent-src/templates/scripts/telemetry/aggregator.py +154 -0
- package/.agent-src/templates/scripts/telemetry/boundary.py +171 -0
- package/.agent-src/templates/scripts/telemetry/engagement.py +238 -0
- package/.agent-src/templates/scripts/telemetry/report_renderer.py +170 -0
- package/.agent-src/templates/scripts/telemetry/settings.py +112 -0
- package/.agent-src/templates/scripts/telemetry_record.py +166 -0
- package/.agent-src/templates/scripts/telemetry_report.py +161 -0
- package/.agent-src/templates/scripts/telemetry_status.py +142 -0
- package/.agent-src/templates/scripts/work_engine/__init__.py +58 -0
- package/.agent-src/templates/scripts/work_engine/__main__.py +9 -0
- package/.agent-src/templates/scripts/work_engine/cli.py +195 -0
- package/.agent-src/templates/scripts/work_engine/cli_args.py +116 -0
- package/.agent-src/templates/scripts/{implement_ticket → work_engine}/delivery_state.py +10 -3
- package/.agent-src/templates/scripts/work_engine/directives/__init__.py +33 -0
- package/.agent-src/templates/scripts/work_engine/directives/backend/__init__.py +98 -0
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/analyze.py +1 -1
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/implement.py +3 -3
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/memory.py +2 -2
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/plan.py +2 -2
- package/.agent-src/templates/scripts/work_engine/directives/backend/refine.py +396 -0
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/report.py +37 -5
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/test.py +2 -2
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/verify.py +2 -2
- package/.agent-src/templates/scripts/work_engine/directives/mixed/__init__.py +116 -0
- package/.agent-src/templates/scripts/work_engine/directives/mixed/contract.py +254 -0
- package/.agent-src/templates/scripts/work_engine/directives/mixed/stitch.py +229 -0
- package/.agent-src/templates/scripts/work_engine/directives/mixed/ui.py +231 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/__init__.py +113 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/_passthrough.py +44 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/apply.py +241 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/audit.py +414 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/design.py +335 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/polish.py +510 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/review.py +468 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/__init__.py +119 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/_skipped.py +37 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/apply.py +165 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/refine.py +66 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/report.py +62 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/test.py +115 -0
- package/.agent-src/templates/scripts/work_engine/dispatcher.py +331 -0
- package/.agent-src/templates/scripts/work_engine/emitters.py +43 -0
- package/.agent-src/templates/scripts/work_engine/errors.py +19 -0
- package/.agent-src/templates/scripts/work_engine/hook_bootstrap.py +76 -0
- package/.agent-src/templates/scripts/work_engine/hooks/__init__.py +54 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/__init__.py +32 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/_chat_history_base.py +103 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_append.py +44 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_halt_append.py +42 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_heartbeat.py +50 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_turn_check.py +49 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/directive_set_guard.py +53 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/halt_surface_audit.py +50 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/state_shape_validation.py +52 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/trace.py +84 -0
- package/.agent-src/templates/scripts/work_engine/hooks/context.py +66 -0
- package/.agent-src/templates/scripts/work_engine/hooks/events.py +44 -0
- package/.agent-src/templates/scripts/work_engine/hooks/exceptions.py +79 -0
- package/.agent-src/templates/scripts/work_engine/hooks/registry.py +60 -0
- package/.agent-src/templates/scripts/work_engine/hooks/runner.py +73 -0
- package/.agent-src/templates/scripts/work_engine/hooks/settings.py +141 -0
- package/.agent-src/templates/scripts/work_engine/input_builders.py +163 -0
- package/.agent-src/templates/scripts/work_engine/intent/__init__.py +47 -0
- package/.agent-src/templates/scripts/work_engine/intent/classify.py +280 -0
- package/.agent-src/templates/scripts/work_engine/migration/__init__.py +8 -0
- package/.agent-src/templates/scripts/work_engine/migration/v0_to_v1.py +231 -0
- package/.agent-src/templates/scripts/{implement_ticket → work_engine}/persona_policy.py +1 -1
- package/.agent-src/templates/scripts/work_engine/resolvers/__init__.py +22 -0
- package/.agent-src/templates/scripts/work_engine/resolvers/diff.py +106 -0
- package/.agent-src/templates/scripts/work_engine/resolvers/file.py +113 -0
- package/.agent-src/templates/scripts/work_engine/resolvers/prompt.py +90 -0
- package/.agent-src/templates/scripts/work_engine/scoring/__init__.py +14 -0
- package/.agent-src/templates/scripts/work_engine/scoring/confidence.py +300 -0
- package/.agent-src/templates/scripts/work_engine/stack/__init__.py +31 -0
- package/.agent-src/templates/scripts/work_engine/stack/detect.py +187 -0
- package/.agent-src/templates/scripts/work_engine/state.py +641 -0
- package/.agent-src/templates/scripts/work_engine/state_io.py +202 -0
- package/.claude-plugin/marketplace.json +105 -2
- package/AGENTS.md +38 -8
- package/CHANGELOG.md +609 -0
- package/README.md +136 -14
- package/config/agent-settings.template.yml +45 -0
- package/config/gitignore-block.txt +4 -0
- package/docs/MIGRATION.md +122 -0
- package/docs/architecture.md +111 -35
- package/docs/contracts/STABILITY.md +95 -0
- package/docs/contracts/adr-chat-history-split.md +132 -0
- package/docs/contracts/adr-command-suggestion.md +146 -0
- package/docs/contracts/adr-implement-ticket-runtime.md +122 -0
- package/docs/contracts/adr-product-ui-track.md +384 -0
- package/docs/contracts/adr-prompt-driven-execution.md +187 -0
- package/docs/contracts/agent-memory-contract.md +149 -0
- package/docs/contracts/artifact-engagement-flow.md +262 -0
- package/docs/contracts/command-clusters.md +126 -0
- package/docs/contracts/command-suggestion-flow.md +148 -0
- package/docs/contracts/implement-ticket-flow.md +628 -0
- package/docs/contracts/linear-ai-rules-inclusion.md +143 -0
- package/docs/contracts/linear-ai-three-layers.md +131 -0
- package/docs/contracts/rule-interactions.md +107 -0
- package/docs/contracts/rule-interactions.yml +142 -0
- package/docs/contracts/ui-stack-extension.md +236 -0
- package/docs/contracts/ui-track-flow.md +338 -0
- package/docs/development.md +1 -1
- package/docs/getting-started.md +3 -3
- package/docs/installation.md +124 -2
- package/docs/migrations/commands-1.15.0.md +112 -0
- package/docs/showcase.md +204 -0
- package/docs/ui-track-mental-model.md +121 -0
- package/package.json +1 -1
- package/scripts/agent-config +199 -0
- package/scripts/audit_cloud_compatibility.py +288 -0
- package/scripts/build_cloud_bundle.py +458 -0
- package/scripts/build_linear_digest.py +263 -0
- package/scripts/chat_history.py +796 -7
- package/scripts/check_compression.py +139 -0
- package/scripts/check_iron_law_prominence.py +143 -0
- package/scripts/check_md_language.py +159 -0
- package/scripts/check_portability.py +38 -0
- package/scripts/check_public_links.py +185 -0
- package/scripts/check_references.py +1 -0
- package/scripts/check_reply_consistency.py +140 -0
- package/scripts/command_suggester/__init__.py +51 -0
- package/scripts/command_suggester/cooldown.py +132 -0
- package/scripts/command_suggester/loader.py +70 -0
- package/scripts/command_suggester/match.py +180 -0
- package/scripts/command_suggester/rank.py +120 -0
- package/scripts/command_suggester/render.py +86 -0
- package/scripts/command_suggester/sanitize.py +113 -0
- package/scripts/command_suggester/settings.py +125 -0
- package/scripts/command_suggester/types.py +78 -0
- package/scripts/hooks/augment-chat-history.sh +56 -0
- package/scripts/install-hooks.sh +67 -0
- package/scripts/install.py +150 -33
- package/scripts/lint_marketplace.py +27 -0
- package/scripts/lint_no_new_atomic_commands.py +179 -0
- package/scripts/lint_rule_interactions.py +149 -0
- package/scripts/memory_lookup.py +1 -1
- package/scripts/migrate_command_suggestions.py +151 -0
- package/scripts/release.py +297 -64
- package/scripts/schemas/command.schema.json +41 -0
- package/scripts/skill_linter.py +81 -0
- package/scripts/sync_agent_settings.py +42 -12
- package/scripts/update_counts.py +10 -0
- package/templates/consumer-settings/augment-cli-hooks.json +54 -0
- package/templates/consumer-settings/claude-settings.json +55 -1
- package/.agent-src/rules/chat-history.md +0 -171
- package/.agent-src/templates/scripts/implement_ticket/cli.py +0 -171
- package/.agent-src/templates/scripts/implement_ticket/dispatcher.py +0 -134
- package/.agent-src/templates/scripts/implement_ticket/steps/__init__.py +0 -49
- package/.agent-src/templates/scripts/implement_ticket/steps/refine.py +0 -140
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Lint docs/contracts/rule-interactions.yml.
|
|
3
|
+
|
|
4
|
+
Validates:
|
|
5
|
+
- Schema (required fields per pair)
|
|
6
|
+
- All rule slugs in `rules:` exist as `.agent-src.uncompressed/rules/<slug>.md`
|
|
7
|
+
- Every pair references rules listed in the top-level `rules:` block
|
|
8
|
+
- `relation` is one of the allowed values
|
|
9
|
+
- All `evidence:` entries point at real files (anchors are advisory, not checked)
|
|
10
|
+
- Pair `id`s are unique
|
|
11
|
+
- The anchor pair from `road-to-post-pr29-optimize.md` Phase 2 is present:
|
|
12
|
+
`non-destructive-by-default` × {autonomous-execution, scope-control,
|
|
13
|
+
commit-policy, ask-when-uncertain, verify-before-complete}.
|
|
14
|
+
|
|
15
|
+
Exits non-zero on any failure. Used in CI via Taskfile target
|
|
16
|
+
`lint-rule-interactions`.
|
|
17
|
+
"""
|
|
18
|
+
from __future__ import annotations
|
|
19
|
+
|
|
20
|
+
import sys
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
|
|
23
|
+
import yaml
|
|
24
|
+
|
|
25
|
+
ROOT = Path(__file__).resolve().parent.parent
|
|
26
|
+
MATRIX = ROOT / "docs" / "contracts" / "rule-interactions.yml"
|
|
27
|
+
RULES_DIR = ROOT / ".agent-src.uncompressed" / "rules"
|
|
28
|
+
|
|
29
|
+
ALLOWED_RELATIONS = {
|
|
30
|
+
"overrides",
|
|
31
|
+
"narrows",
|
|
32
|
+
"defers_to",
|
|
33
|
+
"restates",
|
|
34
|
+
"gates",
|
|
35
|
+
"complements",
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
REQUIRED_PAIR_FIELDS = {"id", "rules", "relation", "conflict", "resolution", "evidence"}
|
|
39
|
+
|
|
40
|
+
ANCHOR_PARTNERS = {
|
|
41
|
+
"autonomous-execution",
|
|
42
|
+
"scope-control",
|
|
43
|
+
"commit-policy",
|
|
44
|
+
"ask-when-uncertain",
|
|
45
|
+
"verify-before-complete",
|
|
46
|
+
}
|
|
47
|
+
ANCHOR_RULE = "non-destructive-by-default"
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def fail(errors: list[str]) -> None:
|
|
51
|
+
print(f"❌ rule-interactions.yml — {len(errors)} issue(s):")
|
|
52
|
+
for e in errors:
|
|
53
|
+
print(f" • {e}")
|
|
54
|
+
sys.exit(1)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def main() -> int:
|
|
58
|
+
if not MATRIX.exists():
|
|
59
|
+
fail([f"{MATRIX.relative_to(ROOT)} is missing"])
|
|
60
|
+
|
|
61
|
+
data = yaml.safe_load(MATRIX.read_text())
|
|
62
|
+
errors: list[str] = []
|
|
63
|
+
|
|
64
|
+
if not isinstance(data, dict):
|
|
65
|
+
fail(["top-level YAML must be a mapping"])
|
|
66
|
+
|
|
67
|
+
if data.get("version") != 1:
|
|
68
|
+
errors.append("version must be 1")
|
|
69
|
+
|
|
70
|
+
declared_rules = data.get("rules") or []
|
|
71
|
+
if not isinstance(declared_rules, list) or not declared_rules:
|
|
72
|
+
errors.append("`rules:` must be a non-empty list of slugs")
|
|
73
|
+
|
|
74
|
+
for slug in declared_rules:
|
|
75
|
+
if not isinstance(slug, str):
|
|
76
|
+
errors.append(f"rule slug not a string: {slug!r}")
|
|
77
|
+
continue
|
|
78
|
+
rule_path = RULES_DIR / f"{slug}.md"
|
|
79
|
+
if not rule_path.exists():
|
|
80
|
+
errors.append(f"rule slug `{slug}` has no file at {rule_path.relative_to(ROOT)}")
|
|
81
|
+
|
|
82
|
+
pairs = data.get("pairs") or []
|
|
83
|
+
if not isinstance(pairs, list) or not pairs:
|
|
84
|
+
errors.append("`pairs:` must be a non-empty list")
|
|
85
|
+
|
|
86
|
+
seen_ids: set[str] = set()
|
|
87
|
+
declared_set = set(declared_rules) if isinstance(declared_rules, list) else set()
|
|
88
|
+
anchor_partners_seen: set[str] = set()
|
|
89
|
+
|
|
90
|
+
for idx, pair in enumerate(pairs):
|
|
91
|
+
if not isinstance(pair, dict):
|
|
92
|
+
errors.append(f"pair[{idx}] is not a mapping")
|
|
93
|
+
continue
|
|
94
|
+
missing = REQUIRED_PAIR_FIELDS - set(pair)
|
|
95
|
+
if missing:
|
|
96
|
+
errors.append(f"pair[{idx}] missing fields: {sorted(missing)}")
|
|
97
|
+
continue
|
|
98
|
+
|
|
99
|
+
pid = pair["id"]
|
|
100
|
+
if pid in seen_ids:
|
|
101
|
+
errors.append(f"duplicate pair id: {pid}")
|
|
102
|
+
seen_ids.add(pid)
|
|
103
|
+
|
|
104
|
+
rules_pair = pair["rules"]
|
|
105
|
+
if not (isinstance(rules_pair, list) and len(rules_pair) == 2):
|
|
106
|
+
errors.append(f"pair `{pid}` rules must be a 2-element list")
|
|
107
|
+
continue
|
|
108
|
+
for r in rules_pair:
|
|
109
|
+
if r not in declared_set:
|
|
110
|
+
errors.append(f"pair `{pid}` references undeclared rule `{r}`")
|
|
111
|
+
|
|
112
|
+
if pair["relation"] not in ALLOWED_RELATIONS:
|
|
113
|
+
errors.append(
|
|
114
|
+
f"pair `{pid}` relation `{pair['relation']}` not in {sorted(ALLOWED_RELATIONS)}"
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
evidence = pair.get("evidence") or []
|
|
118
|
+
if not isinstance(evidence, list) or not evidence:
|
|
119
|
+
errors.append(f"pair `{pid}` evidence must be a non-empty list")
|
|
120
|
+
for citation in evidence:
|
|
121
|
+
if not isinstance(citation, str):
|
|
122
|
+
errors.append(f"pair `{pid}` evidence item not a string: {citation!r}")
|
|
123
|
+
continue
|
|
124
|
+
file_part = citation.split("#", 1)[0]
|
|
125
|
+
if not (ROOT / file_part).exists():
|
|
126
|
+
errors.append(f"pair `{pid}` evidence path does not exist: {file_part}")
|
|
127
|
+
|
|
128
|
+
# Anchor coverage check
|
|
129
|
+
if ANCHOR_RULE in rules_pair:
|
|
130
|
+
partner = next((r for r in rules_pair if r != ANCHOR_RULE), None)
|
|
131
|
+
if partner in ANCHOR_PARTNERS:
|
|
132
|
+
anchor_partners_seen.add(partner)
|
|
133
|
+
|
|
134
|
+
missing_anchors = ANCHOR_PARTNERS - anchor_partners_seen
|
|
135
|
+
if missing_anchors:
|
|
136
|
+
errors.append(
|
|
137
|
+
f"anchor pairs missing for `{ANCHOR_RULE}` × {sorted(missing_anchors)} "
|
|
138
|
+
"(required by road-to-post-pr29-optimize.md P2.2)"
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
if errors:
|
|
142
|
+
fail(errors)
|
|
143
|
+
|
|
144
|
+
print(f"✅ rule-interactions.yml clean — {len(declared_rules)} rules, {len(pairs)} pairs.")
|
|
145
|
+
return 0
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
if __name__ == "__main__":
|
|
149
|
+
sys.exit(main())
|
package/scripts/memory_lookup.py
CHANGED
|
@@ -246,7 +246,7 @@ def _apply_conflict_rule(
|
|
|
246
246
|
# says retrieval should route through `@event4u/agent-memory`. The package
|
|
247
247
|
# CLI is purely **semantic** (`memory retrieve <query> --type T …`); the
|
|
248
248
|
# shared `retrieve(types, keys, …)` API is **key-based**. The hybrid
|
|
249
|
-
# resolution agreed in `
|
|
249
|
+
# resolution agreed in `docs/contracts/agent-memory-contract.md` synthesises
|
|
250
250
|
# `keys` into a single natural-language query for the package call, while
|
|
251
251
|
# the file fallback continues to do glob/substring matching on the same
|
|
252
252
|
# keys. Both legs land in the same `Hit` shape so the conflict rule can
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""One-shot migration: inject the `suggestion:` frontmatter block into every
|
|
3
|
+
command under `.agent-src.uncompressed/commands/`.
|
|
4
|
+
|
|
5
|
+
Source-of-truth table: `agents/contexts/command-suggestion-eligibility.md`
|
|
6
|
+
(locked at end of road-to-context-aware-command-suggestion Phase 1).
|
|
7
|
+
|
|
8
|
+
Idempotent: if `suggestion:` is already present for a command, the file is
|
|
9
|
+
left untouched. Re-runnable.
|
|
10
|
+
"""
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
import re
|
|
14
|
+
import sys
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
ROOT = Path(__file__).resolve().parent.parent
|
|
18
|
+
COMMANDS_DIR = ROOT / ".agent-src.uncompressed" / "commands"
|
|
19
|
+
|
|
20
|
+
INELIGIBLE: dict[str, str] = {
|
|
21
|
+
"agent-handoff": "Explicit fresh-chat handoff — must be deliberate, never inferred from prose.",
|
|
22
|
+
"agent-status": "Pure status display; no natural-language trigger distinct from idle small-talk.",
|
|
23
|
+
"agents-cleanup": "Consumes prior audit output; only meaningful right after /agents-audit.",
|
|
24
|
+
"agents-prepare": "One-shot project scaffolding; only run during initial setup.",
|
|
25
|
+
"chat-history": "Status display only; no NL trigger distinct from 'show status'.",
|
|
26
|
+
"chat-history-clear": "Destructive log wipe — must be deliberate.",
|
|
27
|
+
"chat-history-resume": "Explicit resume mechanic with foreign/returning state machine.",
|
|
28
|
+
"compress": "Package-internal tooling; only the event4u/agent-config repo runs this.",
|
|
29
|
+
"copilot-agents-init": "Project init — only deliberately during onboarding.",
|
|
30
|
+
"copilot-agents-optimize": "Maintenance refactor; only when the maintainer chooses to run it.",
|
|
31
|
+
"do-and-judge": "Subagent orchestration — overlaps /work and judge skills; keep explicit.",
|
|
32
|
+
"do-in-steps": "Subagent orchestration — overlaps /work and /roadmap-execute; keep explicit.",
|
|
33
|
+
"fix-portability": "Package-internal — only the event4u/agent-config repo runs this.",
|
|
34
|
+
"fix-references": "Package-internal — only the event4u/agent-config repo runs this.",
|
|
35
|
+
"judge": "Sibling of /review-changes — eligibility routed there; keep this explicit.",
|
|
36
|
+
"memory-full": "Description states 'never auto-triggered' — opt-in deep-load only.",
|
|
37
|
+
"memory-promote": "Curation pipeline — overlaps /memory-add; keep explicit.",
|
|
38
|
+
"mode": "Role-mode switch is a deliberate context change.",
|
|
39
|
+
"onboard": "Gated by the onboarding-gate rule already; never inferred from prose.",
|
|
40
|
+
"optimize-augmentignore": "Niche maintenance tool with no recurring NL trigger.",
|
|
41
|
+
"optimize-rtk-filters": "Niche maintenance tool with no recurring NL trigger.",
|
|
42
|
+
"package-reset": "Package-internal destructive reset.",
|
|
43
|
+
"package-test": "Package-internal — only the event4u/agent-config repo runs this.",
|
|
44
|
+
"propose-memory": "Programmatic intake fallback — overlaps /memory-add; keep explicit.",
|
|
45
|
+
"set-cost-profile": "Settings mutation — must be deliberate.",
|
|
46
|
+
"sync-agent-settings": "Settings sync — must be deliberate.",
|
|
47
|
+
"sync-gitignore": "Settings sync — must be deliberate.",
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
# (trigger_description, trigger_context)
|
|
51
|
+
ELIGIBLE: dict[str, tuple[str, str]] = {
|
|
52
|
+
"agents-audit": ("audit my agent docs, check the state of the agents/ directory", "stale files under agents/ or recent edits to .augment/ without doc updates"),
|
|
53
|
+
"analyze-reference-repo": ("look at how X does this, compare with that other repo, study this competitor's approach", "external repo URL or path mentioned in the prompt"),
|
|
54
|
+
"bug-fix": ("fix this bug, patch the issue, resolve this error", "branch name matches fix/* or bug/*"),
|
|
55
|
+
"bug-investigate": ("why is this broken, investigate this error, trace the root cause", "Sentry URL, Jira bug ticket key, or stack trace pasted in the prompt"),
|
|
56
|
+
"commit": ("commit my changes, save this to git, create commits for these changes", "git status shows uncommitted changes"),
|
|
57
|
+
"commit-in-chunks": ("commit everything autonomously, split and commit without confirmation", "autonomous mode active and uncommitted changes present"),
|
|
58
|
+
"context-create": ("document this part of the codebase, create a context doc for X", "working in a module without an agents/contexts/ doc"),
|
|
59
|
+
"context-refactor": ("update the context doc, refresh this context document", "existing agents/contexts/*.md referenced in the prompt"),
|
|
60
|
+
"create-pr": ("open a PR, create a pull request, make a PR for this branch", "branch is ahead of base and not yet on a PR"),
|
|
61
|
+
"create-pr-description": ("write a PR description, draft the PR text", "PR exists or branch ready for review without description"),
|
|
62
|
+
"e2e-heal": ("fix the failing E2E tests, playwright tests are red", "failing test output from tests/e2e/"),
|
|
63
|
+
"e2e-plan": ("plan E2E tests for this feature, what should we cover in playwright", "new feature or page added without tests/e2e/ coverage"),
|
|
64
|
+
"estimate-ticket": ("how big is this ticket, estimate PROJ-123, should we split this", "ticket key matching [A-Z]+-[0-9]+ in the prompt and no plan yet"),
|
|
65
|
+
"feature-dev": ("build this feature end-to-end, run the full feature workflow", "long-form feature description spanning multiple components"),
|
|
66
|
+
"feature-explore": ("brainstorm this idea, explore this feature concept", "open-ended feature idea without acceptance criteria"),
|
|
67
|
+
"feature-plan": ("plan this feature, create a feature spec for X", "feature idea referenced and no plan doc exists"),
|
|
68
|
+
"feature-refactor": ("update the feature plan, refine the feature spec", "existing agents/features/*.md referenced in the prompt"),
|
|
69
|
+
"feature-roadmap": ("turn this feature into a roadmap, generate the implementation roadmap", "existing feature plan without linked roadmap"),
|
|
70
|
+
"fix-ci": ("CI is failing, fix the GitHub Actions errors, the pipeline is red", "open PR with failing checks"),
|
|
71
|
+
"fix-pr-bot-comments": ("address the Copilot/Greptile comments, fix the bot review feedback", "open PR with bot review comments unresolved"),
|
|
72
|
+
"fix-pr-comments": ("fix all PR review comments, resolve the review feedback", "open PR with unresolved comments (bot + human)"),
|
|
73
|
+
"fix-pr-developer-comments": ("fix the human reviewer comments, address the developer feedback", "open PR with unresolved human-reviewer comments"),
|
|
74
|
+
"fix-seeder": ("the seeder is broken, foreign key errors in seeders", "seeder error output or recent edits in database/seeders/"),
|
|
75
|
+
"implement-ticket": ("implement this ticket, setze ticket X um, build PROJ-123", "ticket key matching [A-Z]+-[0-9]+ in branch name or prompt"),
|
|
76
|
+
"jira-ticket": ("implement the ticket on this branch, work on the Jira ticket from the branch", "branch name matching feat/PROJ-123-* or similar"),
|
|
77
|
+
"memory-add": ("remember this for later, add this to engineering memory, capture this learning", "post-incident or post-decision conversation"),
|
|
78
|
+
"module-create": ("create a new module, scaffold a module for X", "prompt mentions a new domain area without an existing module"),
|
|
79
|
+
"module-explore": ("show me the X module, load the module context", "existing Modules/<Name>/ referenced in the prompt"),
|
|
80
|
+
"optimize-agents": ("audit agent infrastructure, tune the agent setup", "maintainer working on .augment/ files"),
|
|
81
|
+
"optimize-skills": ("audit my skills, find duplicate skills", "maintainer working on .augment/skills/ files"),
|
|
82
|
+
"override-create": ("override this skill for the project, customize this rule locally", "prompt names a shared skill/rule needing project-specific behavior"),
|
|
83
|
+
"override-manage": ("review my overrides, update the project overrides", "existing entries under agents/overrides/"),
|
|
84
|
+
"prepare-for-review": ("get this branch ready for review, rebase and prep for PR", "branch behind base or part of a PR chain"),
|
|
85
|
+
"project-analyze": ("analyze the project structure, do a full project audit", "new project or after a major refactor"),
|
|
86
|
+
"project-health": ("check project health, what's the state of my docs and modules", "routine health check, no destructive intent"),
|
|
87
|
+
"quality-fix": ("fix the quality errors, run PHPStan and fix issues, fix code style", "PHPStan/Rector/ECS output in recent tool results"),
|
|
88
|
+
"refine-ticket": ("refine PROJ-123, tighten the acceptance criteria, is this ticket clear", "ticket key in prompt with vague acceptance criteria"),
|
|
89
|
+
"review-changes": ("self-review my changes, judge this diff before PR", "uncommitted or staged changes pre-PR"),
|
|
90
|
+
"review-routing": ("who should review this, suggest reviewers for this PR", "PR open without assigned reviewers"),
|
|
91
|
+
"roadmap-create": ("create a roadmap for X, plan this work as a roadmap", "multi-phase work without an existing agents/roadmaps/*.md"),
|
|
92
|
+
"roadmap-execute": ("execute the roadmap, work through the roadmap step by step", "existing agents/roadmaps/*.md referenced in the prompt"),
|
|
93
|
+
"rule-compliance-audit": ("audit my rules, check rule trigger quality", "maintainer working on .augment/rules/ files"),
|
|
94
|
+
"tests-create": ("write tests for these changes, add tests for this branch", "code changes on the branch without matching test changes"),
|
|
95
|
+
"tests-execute": ("run the tests, execute the test suite", "code changes pending verification"),
|
|
96
|
+
"threat-model": ("threat model this change, what could go wrong security-wise", "changes touching auth, webhooks, uploads, secrets, or public endpoints"),
|
|
97
|
+
"update-form-request-messages": ("sync the form request messages, update the validation messages", "edits to app/Http/Requests/*.php referencing rules without messages"),
|
|
98
|
+
"upstream-contribute": ("contribute this back to agent-config, upstream this learning", "project-local skill/rule that fits the shared package"),
|
|
99
|
+
"work": ("build this, implement this, drive this end-to-end", "free-form prompt without a ticket key"),
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
FRONTMATTER_RE = re.compile(r"^(---\n)(.*?)(\n---\n)", re.DOTALL)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def build_block(name: str) -> str:
|
|
106
|
+
if name in INELIGIBLE:
|
|
107
|
+
rationale = INELIGIBLE[name].replace('"', '\\"')
|
|
108
|
+
return f'suggestion:\n eligible: false\n rationale: "{rationale}"'
|
|
109
|
+
if name in ELIGIBLE:
|
|
110
|
+
td, tc = ELIGIBLE[name]
|
|
111
|
+
td_e = td.replace('"', '\\"')
|
|
112
|
+
tc_e = tc.replace('"', '\\"')
|
|
113
|
+
return (f'suggestion:\n eligible: true\n'
|
|
114
|
+
f' trigger_description: "{td_e}"\n'
|
|
115
|
+
f' trigger_context: "{tc_e}"')
|
|
116
|
+
raise SystemExit(f"command not classified: {name}")
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def migrate_one(path: Path) -> str:
|
|
120
|
+
name = path.stem
|
|
121
|
+
text = path.read_text(encoding="utf-8")
|
|
122
|
+
if "\nsuggestion:" in text.split("\n---\n", 1)[0]:
|
|
123
|
+
return "skip"
|
|
124
|
+
m = FRONTMATTER_RE.search(text)
|
|
125
|
+
if not m:
|
|
126
|
+
return "no-frontmatter"
|
|
127
|
+
body = m.group(2)
|
|
128
|
+
block = build_block(name)
|
|
129
|
+
new_body = body.rstrip() + "\n" + block
|
|
130
|
+
new_text = text[: m.start()] + m.group(1) + new_body + m.group(3) + text[m.end():]
|
|
131
|
+
path.write_text(new_text, encoding="utf-8")
|
|
132
|
+
return "ok"
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def main() -> int:
|
|
136
|
+
files = sorted(COMMANDS_DIR.glob("*.md"))
|
|
137
|
+
counts = {"ok": 0, "skip": 0, "no-frontmatter": 0}
|
|
138
|
+
for f in files:
|
|
139
|
+
status = migrate_one(f)
|
|
140
|
+
counts[status] += 1
|
|
141
|
+
print(f"migrated {counts['ok']}, skipped {counts['skip']}, "
|
|
142
|
+
f"no-frontmatter {counts['no-frontmatter']}, total {len(files)}")
|
|
143
|
+
expected = len(INELIGIBLE) + len(ELIGIBLE)
|
|
144
|
+
if len(files) != expected:
|
|
145
|
+
print(f"WARNING: file count {len(files)} != table count {expected}", file=sys.stderr)
|
|
146
|
+
return 1
|
|
147
|
+
return 0
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
if __name__ == "__main__":
|
|
151
|
+
sys.exit(main())
|