@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
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# ADR — Rule Kernel and Router (Roadmap Closure)
|
|
2
|
+
|
|
3
|
+
- **Status:** Accepted (2026-05-06)
|
|
4
|
+
- **Closes:** `agents/roadmaps/road-to-kernel-and-router.md`
|
|
5
|
+
- **Sibling roadmaps closed in the same window:**
|
|
6
|
+
`agents/roadmaps/road-to-token-optimization.md`
|
|
7
|
+
(Phase 1 shipped, Phase 2/3 deferred-with-trigger by design),
|
|
8
|
+
`agents/roadmaps/road-to-package-optimization.md`
|
|
9
|
+
(closed with null result per P1.1 binary acceptance gate).
|
|
10
|
+
- **Related ADRs:** ADR-001 (kernel-swap deferred), ADR-002
|
|
11
|
+
(kernel-bucket cap raise 25k → 26k, per-rule Iron-Law overrides).
|
|
12
|
+
|
|
13
|
+
## Context
|
|
14
|
+
|
|
15
|
+
The agent rule set was an "always-loaded" surface: every conversation
|
|
16
|
+
paid the full 193k-char rule cost regardless of task. There was no
|
|
17
|
+
deterministic way to load only the policy actually relevant to the
|
|
18
|
+
current intent, and no mechanical guard against rule-bucket creep.
|
|
19
|
+
|
|
20
|
+
## Decision
|
|
21
|
+
|
|
22
|
+
Adopt a **Kernel + Router** loading model with three tiers and three
|
|
23
|
+
cost profiles, governed by a compiled router manifest and CI-enforced
|
|
24
|
+
size budgets.
|
|
25
|
+
|
|
26
|
+
### What shipped
|
|
27
|
+
|
|
28
|
+
- **Kernel:** 9 always-loaded Iron-Law rules (`agent-authority`,
|
|
29
|
+
`ask-when-uncertain`, `commit-policy`, `direct-answers`,
|
|
30
|
+
`language-and-tone`, `no-cheap-questions`,
|
|
31
|
+
`non-destructive-by-default`, `scope-control`,
|
|
32
|
+
`verify-before-complete`). Locked set:
|
|
33
|
+
[`docs/contracts/kernel-membership.md`](../contracts/kernel-membership.md).
|
|
34
|
+
- **Router:** `router.json` compiled deterministically from rule
|
|
35
|
+
frontmatter (`tier:`, `triggers:`, `routes_to:`) by
|
|
36
|
+
`scripts/compile_router.py`. Contract:
|
|
37
|
+
[`docs/contracts/rule-router.md`](../contracts/rule-router.md).
|
|
38
|
+
- **Cost profiles:** `minimal` = kernel only · `balanced` = kernel +
|
|
39
|
+
tier-1 (default) · `full` = kernel + tier-1 + tier-2.
|
|
40
|
+
- **Budget gates:** `task lint-rule-budget` enforces kernel ≤ 26k chars
|
|
41
|
+
and per-rule ≤ 2.5k (Iron-Law overrides up to 4.0k via ADR-002).
|
|
42
|
+
Daily snapshots in `agents/.rule-budget-history.jsonl`.
|
|
43
|
+
- **Compression discipline:** P4.3 brought the auto-bucket from
|
|
44
|
+
~75k → 59 220 chars (under the 60k target) without behaviour drift.
|
|
45
|
+
|
|
46
|
+
### What we cut
|
|
47
|
+
|
|
48
|
+
- **P4.1 / P4.2** — auto-rule → skill / guideline migrations.
|
|
49
|
+
Cancelled as scope-cut after P4.3 compression alone landed the
|
|
50
|
+
auto-bucket under target. The migrations were a means, not an end.
|
|
51
|
+
- **road-to-package-optimization Phase 1.2 / 1.3 / Phase 2 / Phase 3**
|
|
52
|
+
— cancelled per P1.1's binary acceptance gate. The prototype
|
|
53
|
+
contradiction linter scanned 317 artefacts in 0.034 s and flagged
|
|
54
|
+
zero cross-artefact contradictions. The artefact surface is
|
|
55
|
+
empirically already well-governed on the heuristics tested; building
|
|
56
|
+
a production linter for a non-existent failure mode is not honest.
|
|
57
|
+
- **road-to-token-optimization Phase 2 / Phase 3** — *not* cut, just
|
|
58
|
+
trigger-deferred by design (telemetry threshold + `/cost:report`
|
|
59
|
+
ship). Will reopen autonomously when their declared signals fire.
|
|
60
|
+
|
|
61
|
+
### What stayed
|
|
62
|
+
|
|
63
|
+
- All Iron-Law fences. SHA-verified preserved by
|
|
64
|
+
`scripts/iron_law_sha.py` across the kernel compression pass.
|
|
65
|
+
- Behaviour parity. Golden transcripts pass under all three profiles.
|
|
66
|
+
- The pre-existing `auto`-tier rules; only their compressed bodies
|
|
67
|
+
changed, never their obligation surface.
|
|
68
|
+
|
|
69
|
+
## Profile semantics
|
|
70
|
+
|
|
71
|
+
| Profile | Buckets loaded | Use case |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| `minimal` | kernel only | Tightly bounded automation, CLI shell-outs, "run this one command" |
|
|
74
|
+
| `balanced` *(default)* | kernel + tier-1 | Day-to-day engineering work; matches pre-roadmap behaviour superset |
|
|
75
|
+
| `full` | kernel + tier-1 + tier-2 | Architectural / cross-wing / governance sessions |
|
|
76
|
+
|
|
77
|
+
Consumer projects opt in via `personal.cost_profile` in
|
|
78
|
+
`.agent-settings.yml`. The install script keeps user-set values; only
|
|
79
|
+
the template default is `balanced`.
|
|
80
|
+
|
|
81
|
+
## Reversibility
|
|
82
|
+
|
|
83
|
+
If the Kernel + Router model needs unwinding:
|
|
84
|
+
|
|
85
|
+
1. Set every rule's frontmatter `tier:` to `kernel` and rebuild
|
|
86
|
+
`router.json` — every rule loads on every turn (legacy behaviour).
|
|
87
|
+
2. Drop `lint-rule-budget` from `task ci`.
|
|
88
|
+
3. The compiled `router.json` is a derived artefact; deleting it and
|
|
89
|
+
running `compile_router.py --no-router` returns the always-loaded
|
|
90
|
+
model.
|
|
91
|
+
|
|
92
|
+
No data migration, no irreversible compression. Iron-Law SHA fences
|
|
93
|
+
mean Iron Laws can be diffed against the pre-roadmap baseline at any
|
|
94
|
+
point.
|
|
95
|
+
|
|
96
|
+
## Final measurements (2026-05-06)
|
|
97
|
+
|
|
98
|
+
| Metric | Pre-roadmap | Post-roadmap | Δ |
|
|
99
|
+
|---|---:|---:|---:|
|
|
100
|
+
| kernel bucket | n/a (always-loaded) | 25 590 | new gate |
|
|
101
|
+
| auto bucket | ~75 000 | 59 220 | −21 % |
|
|
102
|
+
| total rule chars | ~193 000 | 84 810 | −56 % |
|
|
103
|
+
| rule count | 56 | 57 (added `token-optimizer-maintenance`) | +1 |
|
|
104
|
+
| skills count | 134 | 135 (added `token-optimizer`) | +1 |
|
|
105
|
+
|
|
106
|
+
Kernel-bucket-check: PASS. Per-rule cap: 16 rules over 2.5k target,
|
|
107
|
+
all within 4.0k Iron-Law override per ADR-002. Trend snapshot
|
|
108
|
+
appended to `agents/.rule-budget-history.jsonl`.
|
|
109
|
+
|
|
110
|
+
## Consequences
|
|
111
|
+
|
|
112
|
+
- New rule submissions must declare `tier:` + `triggers:` + (when
|
|
113
|
+
applicable) `routes_to:` in frontmatter; the router compiler
|
|
114
|
+
rejects malformed entries.
|
|
115
|
+
- Editing Iron-Law-fenced bodies requires a fresh
|
|
116
|
+
`scripts/iron_law_sha.py --update` pass; CI fails on hash drift.
|
|
117
|
+
- The `token-optimizer` skill is now the single consult surface for
|
|
118
|
+
token-cost decisions; editing any cited asset requires a same-commit
|
|
119
|
+
catalog update per `token-optimizer-maintenance` rule (CI-backstopped
|
|
120
|
+
by `scripts/check_token_optimizer_freshness.py`).
|
|
121
|
+
- Deferred phases (token-opt P2/P3, kernel-swap from ADR-001) remain
|
|
122
|
+
reopenable on their declared triggers without further roadmap work.
|
package/docs/getting-started.md
CHANGED
|
@@ -151,41 +151,33 @@ Your agent now understands slash commands:
|
|
|
151
151
|
| `/optimize skills` | Audit skills, find duplicates, run linter |
|
|
152
152
|
| `/feature plan` | Interactively plan a feature |
|
|
153
153
|
| `/quality-fix` | Run and fix all quality checks |
|
|
154
|
-
| `/chat-history` | Inspect the persistent chat-history log |
|
|
155
|
-
| `/chat-history-resume` | Recover context after a crashed or switched session |
|
|
156
|
-
| `/chat-history-clear` | Wipe the chat-history log (with confirmation) |
|
|
154
|
+
| `/chat-history` | Inspect the persistent chat-history log (read-only `show`) |
|
|
157
155
|
|
|
158
156
|
→ [Browse all 95 active commands](../.agent-src/commands/)
|
|
159
157
|
|
|
160
158
|
---
|
|
161
159
|
|
|
162
|
-
## Crash recovery —
|
|
160
|
+
## Crash recovery — `agents/.agent-chat-history`
|
|
163
161
|
|
|
164
162
|
When `chat_history.enabled: true` in `.agent-settings.yml` (on by default
|
|
165
163
|
for every profile), the agent keeps a JSONL log of your conversation in
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
`
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
-
|
|
182
|
-
|
|
183
|
-
Run `/chat-history-resume` to walk through the prompts explicitly, or
|
|
184
|
-
let the agent ask on the first turn of a new chat. All merge/replace/
|
|
185
|
-
resume paths read the on-disk entries into context before any write.
|
|
186
|
-
|
|
187
|
-
See the [`chat-history` rule](../.agent-src/rules/chat-history-ownership.md) and
|
|
188
|
-
[`scripts/chat_history.py`](../scripts/chat_history.py) for the mechanics.
|
|
164
|
+
`agents/.agent-chat-history`. The file is git-ignored and rotates at the
|
|
165
|
+
size configured in the profile (`128 KB` on `minimal`, `256 KB` on
|
|
166
|
+
`balanced`, `512 KB` on `full`).
|
|
167
|
+
|
|
168
|
+
Logging is **hook-only**: a structural Augment hook fires on
|
|
169
|
+
`session_start` and binds the log to the current session via auto-adopt
|
|
170
|
+
— no agent prompts, no ownership questions. The file is rewritten
|
|
171
|
+
transparently if the fingerprint does not match (fresh chat) and
|
|
172
|
+
otherwise appended to.
|
|
173
|
+
|
|
174
|
+
Run `/chat-history` (a.k.a. `/chat-history show`) any time to inspect
|
|
175
|
+
the log size, last entries, and current fingerprint. For the rare case
|
|
176
|
+
where auto-adopt misfires (corrupted file, hook misconfiguration), run
|
|
177
|
+
`./agent-config chat-history:adopt` as the manual recovery lever.
|
|
178
|
+
|
|
179
|
+
See [`agents/contexts/chat-history-platform-hooks.md`](../agents/contexts/chat-history-platform-hooks.md)
|
|
180
|
+
and [`scripts/chat_history.py`](../scripts/chat_history.py) for the mechanics.
|
|
189
181
|
|
|
190
182
|
---
|
|
191
183
|
|
|
@@ -106,7 +106,7 @@ Agent: Bevor ich die Roadmap übergebe:
|
|
|
106
106
|
- Welcher Branch?
|
|
107
107
|
- Soll ich PRs erwähnen?
|
|
108
108
|
- Welches Modell für die Fortsetzung?
|
|
109
|
-
- Soll ich
|
|
109
|
+
- Soll ich agents/.agent-chat-history zitieren?
|
|
110
110
|
|
|
111
111
|
Antworte als 1, 2, 3, 4.
|
|
112
112
|
```
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Roadmap Progress Sync
|
|
2
|
+
|
|
3
|
+
> Any touch to agents/roadmaps/ — create/rename/delete/move, edit checkboxes ([x]/[~]/[-]), add/rename/remove phases — must regenerate dashboard and archive if 0 open items, same response
|
|
4
|
+
|
|
5
|
+
_Origin: migrated from `.agent-src.uncompressed/rules/roadmap-progress-sync.md` per P4.2 of `road-to-kernel-and-router.md`._
|
|
6
|
+
|
|
7
|
+
<!-- cloud_safe: degrade -->
|
|
8
|
+
<!-- Authoring discipline applies in cloud; local script + regen are no-ops there. -->
|
|
9
|
+
|
|
10
|
+
# Roadmap Progress Sync
|
|
11
|
+
|
|
12
|
+
> **Enforced by:** [`scripts/roadmap_progress_hook.py`](../../scripts/roadmap_progress_hook.py)
|
|
13
|
+
> on Augment + Claude Code (`PostToolUse`). Hook is primary; the prose
|
|
14
|
+
> below is the specification the hook implements and the fallback when
|
|
15
|
+
> the platform has no hook surface.
|
|
16
|
+
|
|
17
|
+
## Iron Law — dashboard sync
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
ANY ROADMAP TOUCH → REGENERATE THE DASHBOARD, SAME RESPONSE.
|
|
21
|
+
NO EXCEPTIONS. NO "I'LL DO IT AT THE END". NO BATCHING ACROSS TURNS.
|
|
22
|
+
A ROADMAP NOT IN THE DASHBOARD IS A RULE VIOLATION, NOT AN OVERSIGHT.
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Roadmap touch =** create the file, rename it, delete it, move it
|
|
26
|
+
between `roadmaps/` ↔ `archive/` ↔ `skipped/`, add/rename/remove a
|
|
27
|
+
phase, **OR** flip any checkbox (`[ ]` ↔ `[x]` ↔ `[~]` ↔ `[-]`).
|
|
28
|
+
|
|
29
|
+
`agents/roadmaps-progress.md` is the read-only dashboard. Every
|
|
30
|
+
unsynced edit makes it lie to the next reader. Created a roadmap
|
|
31
|
+
without regenerating? The dashboard claims it does not exist. Marked
|
|
32
|
+
8 steps `[x]` and forgot the regen? The dashboard says 0 done.
|
|
33
|
+
|
|
34
|
+
## Iron Law — every active roadmap is trackable
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
EVERY ACTIVE ROADMAP MUST CONTAIN AT LEAST ONE TRACKABLE CHECKBOX
|
|
38
|
+
(`- [ ]`) PER NON-INTRO PHASE. ROADMAPS WITHOUT EXECUTABLE STEPS
|
|
39
|
+
EITHER GET A CHECKLIST OR THE `status: draft` FLAG.
|
|
40
|
+
CI-ENFORCED: `scripts/check_roadmap_trackable.py` (CANNOT BE DEFERRED).
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Active roadmap =** any file in `agents/roadmaps/` (root, not
|
|
44
|
+
`archive/` or `skipped/`) without `status: draft` frontmatter.
|
|
45
|
+
|
|
46
|
+
**Trackable checkbox =** an actionable `- [ ]` line under a `## Phase N`
|
|
47
|
+
or `### Phase N` heading (numeric `Phase 1`, roman `Phase II`, or
|
|
48
|
+
letter-track `Phase A1` — matched by the dashboard's `PHASE_RE`).
|
|
49
|
+
Tables of decisions, ICE matrices, ADR captures, and "block
|
|
50
|
+
sequencing" tables are valid **rationale**, but they do not satisfy
|
|
51
|
+
this rule on their own — they must be paired with at least one
|
|
52
|
+
`## Phase N` section whose checkboxes execute the decision.
|
|
53
|
+
Headings such as `## Phase steps`, `### Sequencing — Phase 1 …`,
|
|
54
|
+
`### P0 #1 — …`, or `## Block A` do **not** count — only the
|
|
55
|
+
canonical `Phase <id>` form parsed by the dashboard.
|
|
56
|
+
|
|
57
|
+
**CI backstop.** `scripts/check_roadmap_trackable.py` (package-shipped,
|
|
58
|
+
wire into the consumer's pre-commit / pre-push / Actions gate) fails
|
|
59
|
+
when an active roadmap has zero canonical `Phase` headings or when
|
|
60
|
+
any parsed phase has zero checkboxes. Last line of defence — real-time
|
|
61
|
+
authoring still flips checkboxes and regenerates the dashboard the
|
|
62
|
+
same response.
|
|
63
|
+
|
|
64
|
+
## Status — binary `ready` (default) vs `draft`
|
|
65
|
+
|
|
66
|
+
```yaml
|
|
67
|
+
---
|
|
68
|
+
status: draft # hidden from the dashboard until flipped
|
|
69
|
+
---
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Two values, no synonyms. Anything else — no frontmatter at all,
|
|
73
|
+
`status: ready`, an unknown value — counts as **ready** and lands
|
|
74
|
+
in the dashboard.
|
|
75
|
+
|
|
76
|
+
- **Ready** is the implicit default. New roadmaps are created
|
|
77
|
+
ready unless the user explicitly says draft. Ready roadmaps are
|
|
78
|
+
listed in the dashboard, count towards open/done totals, and
|
|
79
|
+
trip the "completed but not archived" warning when they close.
|
|
80
|
+
- **Draft** hides the file from the dashboard entirely (not
|
|
81
|
+
counted, not listed). Use it while the roadmap is still being
|
|
82
|
+
authored, while waiting for upstream decisions, or as a
|
|
83
|
+
capture-only synthesis that has not yet been promoted to
|
|
84
|
+
executable phases. Flip to ready (or remove the field) the
|
|
85
|
+
moment the roadmap is ready to track.
|
|
86
|
+
|
|
87
|
+
**Completion = archival, same response.** When the edit takes a
|
|
88
|
+
roadmap to `count_open == 0` (every item is `[x]`, `[~]`, or `[-]`),
|
|
89
|
+
`git mv` it into `agents/roadmaps/archive/` (or `skipped/` if no `[x]`
|
|
90
|
+
at all) **before** regenerating the dashboard. A 100%-complete
|
|
91
|
+
roadmap left under `agents/roadmaps/` is a rule violation, not an
|
|
92
|
+
optional cleanup. See `roadmap-management` skill for the archive vs
|
|
93
|
+
skipped decision table.
|
|
94
|
+
|
|
95
|
+
## Agent-authored roadmaps — placement is mandatory
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
A FILE THE AGENT DROPS INTO agents/roadmaps/ MUST EITHER
|
|
99
|
+
(a) PASS check_roadmap_trackable.py AND LAND IN THE DASHBOARD, OR
|
|
100
|
+
(b) NOT BE IN agents/roadmaps/ AT ALL.
|
|
101
|
+
NO "DECISION MATRIX" / "DESIGN NOTE" SHORTCUT.
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
When the agent autonomously creates a roadmap, it owns the placement
|
|
105
|
+
in the **same response**:
|
|
106
|
+
|
|
107
|
+
- **Phase plan** (checkboxes, multi-turn execution) → `agents/roadmaps/<name>.md`, `status: ready` (default), regen dashboard.
|
|
108
|
+
- **Decision matrix / ADR / pattern / lookup** (no `Phase N`, durable rationale) → `agents/contexts/<name>.md`.
|
|
109
|
+
- **Completed work snapshot** → `agents/roadmaps/archive/<name>.md`.
|
|
110
|
+
|
|
111
|
+
A non-trackable file in `agents/roadmaps/` is a rule violation — the
|
|
112
|
+
trackable CI fails it, the dashboard hides it. The agent that
|
|
113
|
+
created it moves it the same response. If the autonomous run also
|
|
114
|
+
**finishes** the roadmap within the session (every box `[x]`/`[~]`/`[-]`),
|
|
115
|
+
the completion-archival rule above fires too — same response.
|
|
116
|
+
|
|
117
|
+
## Autonomous execution — checkbox cadence
|
|
118
|
+
|
|
119
|
+
When executing a roadmap autonomously (multi-turn, no per-step user
|
|
120
|
+
prompt), the user loses progress visibility unless checkboxes flip
|
|
121
|
+
**as work lands**, not in a batch at the end. Iron Law:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
EVERY DONE STEP FLIPS [ ] → [x] IN NEXT REPLY THAT ACKNOWLEDGES IT.
|
|
125
|
+
NO "I UPDATE ROADMAP AT END OF PHASE."
|
|
126
|
+
NO "FOUR STEPS DONE, ONE COMMIT, ONE REGEN."
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Step counts as completed when:
|
|
130
|
+
|
|
131
|
+
- Code / docs change for that step has been **written and saved** AND
|
|
132
|
+
- Verification cited in the step (project CI command, targeted test, lint) has
|
|
133
|
+
**passed in this response or an earlier one** — fresh output, not memory.
|
|
134
|
+
|
|
135
|
+
Then in the **same reply**: flip the checkbox, regenerate the
|
|
136
|
+
dashboard, commit if commit policy allows.
|
|
137
|
+
|
|
138
|
+
**Forbidden:** four turns of step work, dashboard flat, single regen at the end.
|
|
139
|
+
**Required:** each turn — implement step, flip `[x]`, regen, commit (if policy allows).
|
|
140
|
+
A reply that lands a verified step without flipping its checkbox is a rule violation.
|
|
141
|
+
|
|
142
|
+
**In-progress marker:** when a step takes more than one reply,
|
|
143
|
+
mark it `[~]` the moment work starts on it and regenerate. The
|
|
144
|
+
user sees one row move from `[ ]` to `[~]` to `[x]` instead of
|
|
145
|
+
silent rows. `[~]` is treated as open for `count_open` but moves
|
|
146
|
+
the phase percentage forward in the dashboard.
|
|
147
|
+
|
|
148
|
+
## Mechanics — triggers, regen command, self-check, failures
|
|
149
|
+
|
|
150
|
+
The triggers table, the regen command (`./agent-config roadmap:progress`),
|
|
151
|
+
the mandatory pre-send self-check, the failure-mode catalog, and the
|
|
152
|
+
`Do NOT` list live in
|
|
153
|
+
[`contexts/communication/rules-auto/roadmap-progress-sync-mechanics.md`](../contexts/communication/rules-auto/roadmap-progress-sync-mechanics.md).
|
|
154
|
+
Pull it whenever a trigger fires — the rule above is the obligation
|
|
155
|
+
surface; the mechanics file is the lookup material.
|
|
156
|
+
|
|
157
|
+
## Copilot fallback
|
|
158
|
+
|
|
159
|
+
GitHub Copilot has no `PostToolUse` hook surface, so
|
|
160
|
+
`scripts/roadmap_progress_hook.py` cannot detect roadmap-file writes
|
|
161
|
+
structurally. The dashboard at `agents/roadmaps-progress.md` will
|
|
162
|
+
not regenerate on its own.
|
|
163
|
+
|
|
164
|
+
The cooperative path: every time a roadmap touch fires (per the
|
|
165
|
+
trigger list in the mechanics context above), the agent regenerates
|
|
166
|
+
the dashboard in the same response — which is the same Iron Law the
|
|
167
|
+
hook enforces, just executed manually:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
./agent-config roadmap:progress
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
The hook implementation is the specification; on Copilot the agent
|
|
174
|
+
runs the regenerator itself after the same triggers fire. Skipping
|
|
175
|
+
it is a rule violation, not a hook gap — the Iron Law on dashboard
|
|
176
|
+
sync survives the missing hook surface.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Rule Type Governance
|
|
2
|
+
|
|
3
|
+
> Creating or editing rules, or auditing rule types — decides when a rule should be always vs auto
|
|
4
|
+
|
|
5
|
+
_Origin: migrated from `.agent-src.uncompressed/rules/rule-type-governance.md` per P4.2 of `road-to-kernel-and-router.md`._
|
|
6
|
+
|
|
7
|
+
# rule-type-governance
|
|
8
|
+
|
|
9
|
+
## `always` = loaded every conversation
|
|
10
|
+
|
|
11
|
+
Use ONLY when the rule applies to virtually every interaction:
|
|
12
|
+
|
|
13
|
+
- Universal agent behavior (language, tone, interaction style)
|
|
14
|
+
- Safety constraints (scope control, verification before completion)
|
|
15
|
+
- Token/efficiency constraints
|
|
16
|
+
- First-message checks that cannot wait for auto-trigger
|
|
17
|
+
|
|
18
|
+
## `auto` = loaded on demand by description match
|
|
19
|
+
|
|
20
|
+
Use for everything else:
|
|
21
|
+
|
|
22
|
+
- Language-specific rules (PHP, JS, SQL)
|
|
23
|
+
- Tool-specific rules (Docker, Git, quality tools)
|
|
24
|
+
- Workflow-specific rules (commands, skill creation, E2E testing)
|
|
25
|
+
- Domain-specific rules (translations, architecture)
|
|
26
|
+
|
|
27
|
+
## Decision test
|
|
28
|
+
|
|
29
|
+
> "Does this rule need to be active when the user asks a simple question, reviews a PR, or discusses architecture?"
|
|
30
|
+
|
|
31
|
+
- Yes → `always`
|
|
32
|
+
- No → `auto` with a clear trigger description
|
|
33
|
+
|
|
34
|
+
## Auto description quality
|
|
35
|
+
|
|
36
|
+
The `description` field IS the trigger. It must describe **when** the rule applies, not **what** it contains.
|
|
37
|
+
|
|
38
|
+
- ❌ `"PHP coding standards"` — too vague, won't match reliably
|
|
39
|
+
- ✅ `"Writing or reviewing PHP code — strict types, naming, Eloquent conventions"`
|
|
40
|
+
|
|
41
|
+
## Hard constraint
|
|
42
|
+
|
|
43
|
+
- Default to `auto`. Justify `always`.
|
|
44
|
+
- If >50% of conversations don't need a rule → it must be `auto`.
|
|
45
|
+
- `optimize-agents` command checks this and suggests changes.
|
|
46
|
+
|
|
47
|
+
## Hardening tier — required on new or edited rules
|
|
48
|
+
|
|
49
|
+
Every new rule, and every edited rule whose body changes the trigger
|
|
50
|
+
or the obligation, MUST classify itself against the hardening tiers
|
|
51
|
+
documented in [`rule-trigger-matrix.md`](../../agents/contexts/rule-trigger-matrix.md):
|
|
52
|
+
|
|
53
|
+
| Tier | Meaning |
|
|
54
|
+
|---|---|
|
|
55
|
+
| `1` | Mechanically enforceable — hook acts, rule body stays minimal. |
|
|
56
|
+
| `2a` | Marker nudge — hook injects signal, agent acts on it. |
|
|
57
|
+
| `2b` | Structured injection / tool-call gate — hook reads/writes state, may deny. |
|
|
58
|
+
| `3` | Soft, judgment-bound — no platform surface; self-check rule. |
|
|
59
|
+
| `safety-floor` | Iron-Law subset, never modified. |
|
|
60
|
+
| `mechanical-already` | Precedent — script enforces, rule body documents. |
|
|
61
|
+
|
|
62
|
+
Classification surface: the optional `tier:` frontmatter field
|
|
63
|
+
(declared in `scripts/schemas/rule.schema.json`). Recommended for new
|
|
64
|
+
rules; bulk-retrofit of existing rules is tracked separately.
|
|
65
|
+
|
|
66
|
+
Tier 3 dispositions are recorded centrally in
|
|
67
|
+
[`agents/contexts/tier-3-dispositions.md`](../../agents/contexts/tier-3-dispositions.md)
|
|
68
|
+
with a 6-month re-audit clock. New Tier 3 rules append to that list
|
|
69
|
+
on landing.
|
|
70
|
+
|
|
71
|
+
The `optimize-agents` command checks the tier alongside `type`/`source`
|
|
72
|
+
and suggests escalations when a rule's trigger matches a hardening
|
|
73
|
+
opportunity that has shipped since the rule was authored.
|
|
@@ -33,6 +33,11 @@ Size is a signal — not the goal.
|
|
|
33
33
|
- Acceptable: **< 100–120 lines**
|
|
34
34
|
- Hard limit: **< 200 lines**
|
|
35
35
|
|
|
36
|
+
Linter (council review 2026-05-06): the > 40 / > 60 line warnings are
|
|
37
|
+
**density-gated** — rules with ≥ 30 % fenced content (verbatim Iron-Law
|
|
38
|
+
blocks, worked-example fences) are exempt from the line-count warning.
|
|
39
|
+
The 200-line hard error stays unconditional.
|
|
40
|
+
|
|
36
41
|
Reason:
|
|
37
42
|
- Loaded frequently
|
|
38
43
|
- Must be reliably followed
|
|
@@ -43,8 +48,10 @@ Reason:
|
|
|
43
48
|
## Skills
|
|
44
49
|
|
|
45
50
|
- Target: **300–900 words**
|
|
46
|
-
- Warning: **>
|
|
47
|
-
- Strong split signal:
|
|
51
|
+
- Warning: **> 400 lines** (raised from 300, council review 2026-05-06)
|
|
52
|
+
- Strong split signal: reference-rich skills (analyzer, quality-tool
|
|
53
|
+
catalog, council orchestration) may legitimately sit between 300 and
|
|
54
|
+
400 lines without being split-candidates
|
|
48
55
|
|
|
49
56
|
Focus:
|
|
50
57
|
- scanability
|
|
@@ -57,6 +64,10 @@ Focus:
|
|
|
57
64
|
|
|
58
65
|
- Target: **200–600 words**
|
|
59
66
|
- Acceptable: **up to ~1000 words**
|
|
67
|
+
- Warning: **> 1000 words AND lacks delegation structure** (< 5
|
|
68
|
+
sub-sections OR < 3 code blocks). Well-factored orchestrators with ≥ 5
|
|
69
|
+
sub-sections AND ≥ 3 code blocks are exempt — the size reflects
|
|
70
|
+
dispatch breadth, not bloat (council review 2026-05-06).
|
|
60
71
|
|
|
61
72
|
Commands orchestrate — not implement.
|
|
62
73
|
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Skill Quality
|
|
2
|
+
|
|
3
|
+
> Creating, editing, or reviewing skills — minimum quality standard, every skill must be executable, validated, and self-contained
|
|
4
|
+
|
|
5
|
+
_Origin: migrated from `.agent-src.uncompressed/rules/skill-quality.md` per P4.2 of `road-to-kernel-and-router.md`._
|
|
6
|
+
|
|
7
|
+
# Skill Quality
|
|
8
|
+
|
|
9
|
+
## Minimum Sharpness
|
|
10
|
+
|
|
11
|
+
Every skill must answer four questions. If ANY answer is weak, the skill is not done.
|
|
12
|
+
|
|
13
|
+
| # | Question | Section | Standard |
|
|
14
|
+
|---|---|---|---|
|
|
15
|
+
| 1 | When should I use this? | `When to use` | Concrete trigger, not generic |
|
|
16
|
+
| 2 | What exactly do I do? | `Procedure` | Executable steps with decisions |
|
|
17
|
+
| 3 | How do I verify it worked? | `Procedure` (validation step) | Concrete checks, not "verify it works" |
|
|
18
|
+
| 4 | What common failure must I avoid? | `Gotcha` + `Do NOT` | Real failure patterns, not platitudes |
|
|
19
|
+
|
|
20
|
+
## Required Sections
|
|
21
|
+
|
|
22
|
+
Every skill MUST have: `When to use`, `Procedure`, `Gotcha`, `Output format`, `Do NOT`.
|
|
23
|
+
|
|
24
|
+
## Frontmatter Contract
|
|
25
|
+
|
|
26
|
+
Every skill's YAML frontmatter MUST validate against `scripts/schemas/skill.schema.json`.
|
|
27
|
+
Violations are reported by `scripts/skill_linter.py` as `schema_<rule>` errors
|
|
28
|
+
and fail `python3 scripts/validate_frontmatter.py` and the full CI pipeline.
|
|
29
|
+
|
|
30
|
+
## Description Triggering
|
|
31
|
+
|
|
32
|
+
Claude routes skills by their frontmatter `description`. Pushy,
|
|
33
|
+
trigger-rich descriptions are required — polite or hedged ones cause
|
|
34
|
+
undertriggering. The full recipe (concrete verb phrase, ≥2 triggers,
|
|
35
|
+
`even if they don't explicitly ask for …` tail, ≤200 chars,
|
|
36
|
+
litmus test) lives in
|
|
37
|
+
[`contexts/communication/rules-auto/skill-quality-mechanics.md`](../contexts/communication/rules-auto/skill-quality-mechanics.md)
|
|
38
|
+
§ Description Triggering.
|
|
39
|
+
|
|
40
|
+
## Skill Independence
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
If a skill is not executable without opening a guideline, it is broken.
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- Skills MAY reference guidelines for detailed conventions
|
|
47
|
+
- Skills MUST NOT outsource their core workflow to guidelines
|
|
48
|
+
- If removing guideline references makes the skill useless → the skill is too weak
|
|
49
|
+
|
|
50
|
+
**Litmus test:** Cover all guideline references in the Procedure. Is it still executable?
|
|
51
|
+
If not → the skill needs more own steps, decisions, and validation — not more guideline links.
|
|
52
|
+
|
|
53
|
+
## Merge & Compression Preservation
|
|
54
|
+
|
|
55
|
+
When merging or compressing skills, the result MUST preserve the
|
|
56
|
+
strongest validation, strongest examples, all anti-patterns, all
|
|
57
|
+
decision criteria, and trigger quality. Full preservation invariants
|
|
58
|
+
and "merge is invalid if …" / "compression may remove …" lists in
|
|
59
|
+
[`contexts/communication/rules-auto/skill-quality-mechanics.md`](../contexts/communication/rules-auto/skill-quality-mechanics.md)
|
|
60
|
+
§ Merge Preservation and § Compression Preservation.
|
|
61
|
+
|
|
62
|
+
## Refactor Safety
|
|
63
|
+
|
|
64
|
+
When refactoring or optimizing skills:
|
|
65
|
+
|
|
66
|
+
- NEVER weaken validation to pass linter
|
|
67
|
+
- NEVER remove anti-patterns to reduce size
|
|
68
|
+
- NEVER replace concrete checks with "verify it works"
|
|
69
|
+
- NEVER merge skills if the result is broader than either source
|
|
70
|
+
- ALWAYS run linter before and after — fail count must not increase
|
|
71
|
+
|
|
72
|
+
## Senior-Tier Required Structure
|
|
73
|
+
|
|
74
|
+
Skills with `tier: senior` in YAML frontmatter MUST carry four named
|
|
75
|
+
blocks beyond the standard required sections:
|
|
76
|
+
|
|
77
|
+
| # | Block | Heading / Location | Standard |
|
|
78
|
+
|---|---|---|---|
|
|
79
|
+
| 1 | Context-First lead | Frontmatter `description` | First sentence anchors the cognition cluster (domain + senior role); second sentence names the trigger. |
|
|
80
|
+
| 2 | Related Skills | `## Related Skills` | Two-list pattern — `**WHEN to use this**` (situations this skill resolves) + `**WHEN NOT to use this**` (route-elsewhere peers, named). |
|
|
81
|
+
| 3 | Proactive Triggers | `## When the agent should load this` | 3–5 concrete user-prompt patterns (paraphrases users actually type), not abstract categories. |
|
|
82
|
+
| 4 | Output Artifacts | `## Output` | 1–4 named artifacts with shape (file path, table, markdown structure) — orchestrator-citable identifier each. |
|
|
83
|
+
|
|
84
|
+
**Forward-only.** `scripts/skill_linter.py` enforces these blocks for
|
|
85
|
+
`tier: senior` skills only; mid-tier and untiered skills skip the
|
|
86
|
+
check. No retrofit pass on existing Wing-1 skills.
|
|
87
|
+
|
|
88
|
+
Subsection specs (≤ 6-line spec + 1 reference example each), good /
|
|
89
|
+
bad pattern pairs, and the WHEN-NOT routing peer rules live in
|
|
90
|
+
[`contexts/communication/rules-auto/skill-quality-mechanics.md`](../contexts/communication/rules-auto/skill-quality-mechanics.md)
|
|
91
|
+
§ Senior-tier patterns.
|
|
92
|
+
|
|
93
|
+
## Structural Malice Floor
|
|
94
|
+
|
|
95
|
+
`scripts/skill_linter.py` runs five regex patterns against every
|
|
96
|
+
skill / rule / command body — credential exfiltration, remote
|
|
97
|
+
execution, force-push to a protected ref, world-readable secret
|
|
98
|
+
files, and shell-injection in subprocess calls. A match emits
|
|
99
|
+
``Issue("error", "malice:<pattern>", "<line>:<matched>")`` and the
|
|
100
|
+
linter exits with code **3** (security-failure), distinct from
|
|
101
|
+
exit 2 (build-failure) so CI surfaces can split the two.
|
|
102
|
+
|
|
103
|
+
The check is **structural**, not semantic — it catches the shapes
|
|
104
|
+
the [`tool-safety`](tool-safety.md) rule denies in prose: hidden
|
|
105
|
+
credentials, arbitrary execution, write-without-approval. Fixtures
|
|
106
|
+
and the exit-code-3 contract live in
|
|
107
|
+
[`tests/test_skill_linter_malice.py`](../../tests/test_skill_linter_malice.py).
|
|
108
|
+
|
|
109
|
+
## Confidence Tagging
|
|
110
|
+
|
|
111
|
+
Senior-tier procedure steps MAY append `[CONFIDENCE: high|medium|low]`
|
|
112
|
+
at the end of multi-step chains where the agent's evidence varies
|
|
113
|
+
across steps. Optional but recommended when a step's output feeds a
|
|
114
|
+
downstream decision.
|
|
115
|
+
|
|
116
|
+
Text-tag form is deliberate. Emoji 🟢 / 🟡 / 🔴 is **not** allowed —
|
|
117
|
+
collides with [`direct-answers`](direct-answers.md) § Emoji scope
|
|
118
|
+
(functional markers only). Linter does not enforce the tag itself;
|
|
119
|
+
the rule documents the placement so authors converge on one form.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Augment Portability
|
|
2
|
+
|
|
3
|
+
> Editing or creating files inside .augment/ directory — skills, rules, commands, templates, contexts must be project-agnostic
|
|
4
|
+
|
|
5
|
+
_Origin: migrated from `.agent-src.uncompressed/rules/augment-portability.md` per P4.2 of `road-to-kernel-and-router.md`._
|
|
6
|
+
|
|
7
|
+
# Package Portability
|
|
8
|
+
|
|
9
|
+
Everything that ships with the `event4u/agent-config` package MUST be
|
|
10
|
+
**project-agnostic**. That includes:
|
|
11
|
+
|
|
12
|
+
- Everything inside `.augment/` (skills, rules, commands, guidelines,
|
|
13
|
+
templates, contexts)
|
|
14
|
+
- The package repo's own root `AGENTS.md`
|
|
15
|
+
- The package repo's own `.github/copilot-instructions.md`
|
|
16
|
+
|
|
17
|
+
All three are either installed into consumer projects (`.augment/` via
|
|
18
|
+
`install.sh`) or read by AI tools when working on the package itself
|
|
19
|
+
(`AGENTS.md`, `copilot-instructions.md`). Leaking consumer-specific
|
|
20
|
+
content into any of them pollutes downstream projects or misleads agents.
|
|
21
|
+
|
|
22
|
+
## Rules
|
|
23
|
+
|
|
24
|
+
- NEVER reference a specific consumer project, repo name, domain, or tech
|
|
25
|
+
stack directly. The package repo itself (`event4u/agent-config`) MAY be
|
|
26
|
+
named inside its own root `AGENTS.md` and `copilot-instructions.md` —
|
|
27
|
+
that is meta about the package, not a leak.
|
|
28
|
+
- NEVER hardcode consumer-project paths, class names, or conventions.
|
|
29
|
+
- Write content so it works as a **reusable package** across any project.
|
|
30
|
+
- Project-specific behavior belongs in the **consumer's** `.agent-settings.yml`,
|
|
31
|
+
`AGENTS.md`, or `agents/` — never in files shipped by this package.
|
|
32
|
+
- If a skill or rule needs project-specific input, read it from
|
|
33
|
+
`.agent-settings.yml` or accept it as a parameter.
|
|
34
|
+
- When reviewing or editing package files, always ask: "Would this still
|
|
35
|
+
make sense in a completely different project?"
|
|
36
|
+
|
|
37
|
+
## Runtime invocations — no `task` commands
|
|
38
|
+
|
|
39
|
+
Skills, rules, commands, guidelines, personas, and context docs run in
|
|
40
|
+
**consumer projects**, which may not have Task installed. **Never**
|
|
41
|
+
reference a `task <something>` invocation inside any artefact file
|
|
42
|
+
under `.agent-src.uncompressed/{skills,rules,commands,guidelines,personas,contexts}/`
|
|
43
|
+
(and therefore also not in the compressed mirror under `.agent-src/`).
|
|
44
|
+
Use direct script invocations instead.
|
|
45
|
+
|
|
46
|
+
## Consumer CLI — `./agent-config`
|
|
47
|
+
|
|
48
|
+
A subset of package scripts is exposed through a project-local CLI
|
|
49
|
+
wrapper `./agent-config` (written into the project root by the
|
|
50
|
+
installer, gitignored). Artefacts MUST prefer the CLI over raw
|
|
51
|
+
`python3 scripts/…` paths for every command the CLI already covers.
|
|
52
|
+
|
|
53
|
+
## Translation tables — see mechanics
|
|
54
|
+
|
|
55
|
+
The full `task`-to-script translation table, the `./agent-config`
|
|
56
|
+
CLI mapping, and the rationale (Task absence on consumers,
|
|
57
|
+
maintainer-vs-artefact split) all live in
|
|
58
|
+
[`contexts/communication/rules-auto/augment-portability-mechanics.md`](../contexts/communication/rules-auto/augment-portability-mechanics.md).
|
|
59
|
+
Pull it whenever an artefact is about to mention a runtime
|
|
60
|
+
invocation.
|
|
61
|
+
|
|
62
|
+
## Enforcement
|
|
63
|
+
|
|
64
|
+
`scripts/check_portability.py` scans `.augment/`, `.agent-src.uncompressed/`,
|
|
65
|
+
and the package repo's root `AGENTS.md` + `.github/copilot-instructions.md`
|
|
66
|
+
for forbidden identifiers, for any `task <name>` invocation inside
|
|
67
|
+
artefact files, and for direct script invocations that bypass the
|
|
68
|
+
`./agent-config` CLI. It runs in CI and must pass before any PR.
|