@event4u/agent-config 1.20.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/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 +60 -64
- 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 +17 -5
- package/.agent-src/commands/council.md +1 -1
- 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/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/slash-command-routing-policy-mechanics.md +1 -1
- 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 +128 -5
- 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 -50
- 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 +41 -106
- 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 +5 -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 +7 -0
- 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 -113
- 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 +22 -108
- 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 +65 -0
- 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/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 +1 -1
- 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/migration-creator/SKILL.md +7 -7
- package/.agent-src/skills/multi-tenancy/SKILL.md +8 -8
- 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/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/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/universal-project-analysis/SKILL.md +1 -1
- package/.agent-src/templates/AGENTS.md +1 -1
- package/.agent-src/templates/agent-settings.md +21 -16
- 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/.claude-plugin/marketplace.json +4 -1
- package/AGENTS.md +32 -5
- package/CHANGELOG.md +69 -3
- package/README.md +22 -21
- package/config/agent-settings.template.yml +44 -10
- package/config/gitignore-block.txt +7 -0
- package/docs/architecture.md +86 -5
- package/docs/catalog.md +16 -6
- package/docs/contracts/agent-memory-contract.md +1 -1
- package/docs/contracts/context-paths.md +2 -1
- package/docs/contracts/file-ownership-matrix.json +354 -500
- 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/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 +17 -6
- 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 +2 -2
- 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/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/ai_council/session.py +107 -5
- package/scripts/build_linear_digest.py +3 -5
- 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 +2 -0
- 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 +9 -5
- package/scripts/council_prune.py +81 -0
- package/scripts/count_token_optimizer_usage.sh +54 -0
- package/scripts/install.sh +44 -2
- package/scripts/iron_law_sha.py +98 -0
- 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/schemas/rule.schema.json +55 -6
- package/scripts/skill_linter.py +196 -6
- package/scripts/smoke_path_resolution.py +93 -0
- package/scripts/validate_frontmatter.py +41 -1
- 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/{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
|
@@ -115,7 +115,7 @@ Your agent is now:
|
|
|
115
115
|
- **Respecting your codebase** โ no conflicting patterns
|
|
116
116
|
- **Following standards** โ consistent code quality
|
|
117
117
|
|
|
118
|
-
This is enforced automatically by
|
|
118
|
+
This is enforced automatically by 58 rules. No configuration needed.
|
|
119
119
|
|
|
120
120
|
---
|
|
121
121
|
|
|
@@ -153,7 +153,7 @@ Your agent now understands slash commands:
|
|
|
153
153
|
| `/quality-fix` | Run and fix all quality checks |
|
|
154
154
|
| `/chat-history` | Inspect the persistent chat-history log (read-only `show`) |
|
|
155
155
|
|
|
156
|
-
โ [Browse all
|
|
156
|
+
โ [Browse all 95 active commands](../.agent-src/commands/)
|
|
157
157
|
|
|
158
158
|
---
|
|
159
159
|
|
|
@@ -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.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Php Coding
|
|
2
|
+
|
|
3
|
+
> Writing or reviewing PHP code โ strict types, naming, comparisons, early returns, Eloquent conventions
|
|
4
|
+
|
|
5
|
+
_Origin: migrated from `.agent-src.uncompressed/rules/php-coding.md` per P4.2 of `road-to-kernel-and-router.md`._
|
|
6
|
+
|
|
7
|
+
# PHP Coding Rules
|
|
8
|
+
|
|
9
|
+
- Use `declare(strict_types=1)` in every **new** PHP file. Not required when modifying existing files that don't have it.
|
|
10
|
+
- If the project has a `Math` helper class, use it for ALL business calculations. Never use native PHP arithmetic operators (`+`, `-`, `*`, `/`) for business calculations. Search for the `Math` class in the project.
|
|
11
|
+
- Never use `var_dump()`, `print_r()`, or `dd()` โ they are disallowed by PHPStan config. Exception: legacy projects where these are already used and no alternative is feasible.
|
|
12
|
+
- Never use `float` for money โ use `decimal` or the `Math` helper.
|
|
13
|
+
- Always use `===` / `!==` (strict comparison), Yoda style: `null === $var`.
|
|
14
|
+
- Early return over nested if/else.
|
|
15
|
+
- No one-liner if statements.
|
|
16
|
+
- Single quotes for strings without interpolation. `sprintf()` for complex strings.
|
|
17
|
+
- Variables: `camelCase`. Array keys: `snake_case`. Constants: `UPPER_SNAKE_CASE`.
|
|
18
|
+
- Typed properties, parameters, and return types โ always.
|
|
19
|
+
- Constructor property promotion where it makes sense.
|
|
20
|
+
|
|
21
|
+
## Eloquent Models โ Attribute Access
|
|
22
|
+
|
|
23
|
+
Read `eloquent.access_style` from `.agent-settings.yml` to determine the preferred style.
|
|
24
|
+
Default: `getters_setters`. See the `eloquent` skill for the full reference table and examples.
|
|
25
|
+
|
|
26
|
+
- **`getters_setters`** (strict): Every attribute has a typed getter + fluent setter. Inside the model: `getAttribute('column_name')`/`setAttribute('column_name', $value)`. Outside: always getters/setters. If a getter doesn't exist yet, create it first.
|
|
27
|
+
- **`get_attribute`**: Use `getAttribute('column_name')`/`setAttribute('column_name', $value)` everywhere, no getters/setters needed.
|
|
28
|
+
- **`magic_properties`**: Laravel default `$model->column_name` everywhere.
|
|
29
|
+
|
|
30
|
+
### Relationship Getters
|
|
31
|
+
|
|
32
|
+
- Every relationship MUST have a typed getter method **above** the relationship method.
|
|
33
|
+
- **Inside the getter:** use `$this->getAttribute('relationship_name')`, NEVER `$this->relationship_name`.
|
|
34
|
+
- **Outside the model:** ALWAYS use the getter (`$model->getEquipment()`), NEVER access the magic property (`$model->equipment`).
|
|
35
|
+
- Use `instanceof` checks instead of `null ===` when checking relationship results.
|
|
36
|
+
|
|
37
|
+
## Eloquent Models โ Observers over `booted()`
|
|
38
|
+
|
|
39
|
+
- Do NOT use `booted()` / `boot()` for model lifecycle hooks (saving, saved, deleted, etc.).
|
|
40
|
+
- Use a dedicated **Observer** class registered via `#[ObservedBy]` attribute.
|
|
41
|
+
- This keeps models slim and lifecycle logic testable and discoverable.
|
|
42
|
+
|
|
43
|
+
## PHPStan
|
|
44
|
+
|
|
45
|
+
- Always fix the root cause. Do NOT add entries to `phpstan-baseline.neon`.
|
|
46
|
+
- Adding `ignoreErrors` to `phpstan.neon` is allowed for **structural toolchain limitations** (e.g., Pest runtime bindings). NOT for individual code issues. **If unsure โ ask the user.**
|
|
47
|
+
- If a fix is truly impossible (confirmed false positive), use an inline ignore as last resort:
|
|
48
|
+
```php
|
|
49
|
+
// @phpstan-ignore-next-line โ false positive: reason here
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Testing
|
|
53
|
+
|
|
54
|
+
- Always write tests in **Pest**, not PHPUnit class syntax โ unless the user explicitly asks for PHPUnit.
|
|
55
|
+
- Pest tests in `tests/Unit/` automatically use `UnitTestCase` as the base class (configured in `tests/Pest.php`).
|
|
56
|
+
|
|
57
|
+
## PHPDoc
|
|
58
|
+
|
|
59
|
+
- Only add PHPDoc when type hints are insufficient (e.g. generic arrays: `@param array<int, MyObject> $items`).
|
|
60
|
+
- Do NOT add PHPDoc that just repeats the method signature.
|
|
61
|
+
- One docblock per method โ never split into multiple `/** */` blocks.
|
|
62
|
+
- Tag order: `@param` โ `@return` โ `@throws`.
|