@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
|
@@ -5,7 +5,7 @@ description: "Scope control — no unsolicited architectural changes, refactors,
|
|
|
5
5
|
alwaysApply: true
|
|
6
6
|
source: package
|
|
7
7
|
load_context:
|
|
8
|
-
-
|
|
8
|
+
- ../contexts/authority/scope-mechanics.md
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# Scope Control
|
|
@@ -14,73 +14,35 @@ load_context:
|
|
|
14
14
|
- Do NOT replace existing patterns with alternatives.
|
|
15
15
|
- Do NOT refactor existing code solely to comply with current rules.
|
|
16
16
|
- Do NOT suggest new libraries unless explicitly requested.
|
|
17
|
-
-
|
|
18
|
-
- New
|
|
19
|
-
- Stay within
|
|
20
|
-
- When unsure about
|
|
17
|
+
- Modify existing code only when directly related to the current change, required for bug fixes / security, or explicitly requested.
|
|
18
|
+
- New / modified code MUST follow all coding rules.
|
|
19
|
+
- Stay within established project structure and conventions.
|
|
20
|
+
- When unsure about scope, ask the user.
|
|
21
21
|
|
|
22
22
|
## Git operations — permission-gated
|
|
23
23
|
|
|
24
|
-
The user decides the git shape
|
|
25
|
-
|
|
26
|
-
> **Commit specifics:** see the canonical [`commit-policy`](commit-policy.md)
|
|
27
|
-
> rule — narrower than the general "no git ops without permission"
|
|
28
|
-
> below (covers the never-ask-about-committing default and the
|
|
29
|
-
> roadmap-authorized exception).
|
|
24
|
+
The user decides the git shape. Never improvise. Commit specifics: canonical [`commit-policy`](commit-policy.md).
|
|
30
25
|
|
|
31
26
|
- NEVER commit, push, merge, rebase, or force-push without explicit user permission.
|
|
32
|
-
- NEVER create a
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
- NEVER
|
|
36
|
-
|
|
37
|
-
- NEVER push a tag or create a release without explicit user permission.
|
|
38
|
-
- NEVER include version numbers, target releases, deprecation dates,
|
|
39
|
-
release-tied milestones, or git tags inside roadmaps, plans, tickets,
|
|
40
|
-
or any other planning artifact. Roadmaps plan **work**; releases and
|
|
41
|
-
tags are a separate decision the user makes outside the roadmap.
|
|
42
|
-
Never surface "which release should this ship in?" as an option in
|
|
43
|
-
numbered choices, ADRs, or roadmap text. If the user wants a release
|
|
44
|
-
pinned to a milestone, they will say so explicitly.
|
|
45
|
-
- If a task seems to need a separate branch or PR, STOP and **brief
|
|
46
|
-
the user before asking** — see
|
|
47
|
-
[`scope-mechanics`](../contexts/authority/scope-mechanics.md)
|
|
48
|
-
§ Brief-before-asking for the required Why / What / How sequence.
|
|
27
|
+
- NEVER create / switch / delete a branch without explicit permission — includes spike, scratch, throwaway, worktree branches.
|
|
28
|
+
- NEVER create, close, reopen, or change the target of a pull request without permission.
|
|
29
|
+
- NEVER push a tag or create a release without permission.
|
|
30
|
+
- NEVER include version numbers, target releases, deprecation dates, release-tied milestones, or git tags in roadmaps, plans, tickets, or any planning artifact. Roadmaps plan **work**; releases / tags are a separate decision outside the roadmap. Never surface "which release should this ship in?" as a numbered choice. User pins by saying so explicitly.
|
|
31
|
+
- Task seems to need a separate branch / PR → STOP and **brief before asking** ([`scope-mechanics § Brief-before-asking`](../contexts/authority/scope-mechanics.md)).
|
|
49
32
|
|
|
50
|
-
"Explicit permission"
|
|
51
|
-
standing instruction they have not revoked**. Earlier permission for a
|
|
52
|
-
different operation does not carry over.
|
|
33
|
+
"Explicit permission" = user said so **this turn or in a standing instruction not yet revoked**. Earlier permission for a different operation does not carry over.
|
|
53
34
|
|
|
54
35
|
## Production, infrastructure, bulk-destructive — Hard Floor
|
|
55
36
|
|
|
56
|
-
A subset
|
|
57
|
-
auto-permitted by a standing autonomy directive. Canonical rule:
|
|
58
|
-
[`non-destructive-by-default`](non-destructive-by-default.md). The
|
|
59
|
-
trigger list (production-branch merges, deploys / releases, prod
|
|
60
|
-
data / infra, bulk-destructive ops) and the
|
|
61
|
-
"authorization is this turn, not earlier" clarification live in
|
|
62
|
-
[`scope-mechanics`](../contexts/authority/scope-mechanics.md)
|
|
63
|
-
§ Production, infrastructure, bulk-destructive.
|
|
37
|
+
A subset is **never** autonomous and never auto-permitted by a standing autonomy directive. Canonical: [`non-destructive-by-default`](non-destructive-by-default.md). Trigger list (prod-branch merges, deploys / releases, prod data / infra, bulk-destructive ops) and the "authorization is this turn, not earlier" clarification: [`scope-mechanics § Production, infrastructure, bulk-destructive`](../contexts/authority/scope-mechanics.md).
|
|
64
38
|
|
|
65
39
|
## Decline = silence — no re-asking on the same task
|
|
66
40
|
|
|
67
|
-
After the user **declines** a proposal (branch switch, PR creation,
|
|
68
|
-
tag/release entry, separate worktree, version pinning in a roadmap),
|
|
69
|
-
do **not** raise the same proposal again on the same task. The decline
|
|
70
|
-
stands until the user reopens the topic themselves.
|
|
71
|
-
|
|
72
|
-
Timing and "is this worth asking?" guidance lives in
|
|
73
|
-
[`scope-mechanics`](../contexts/authority/scope-mechanics.md)
|
|
74
|
-
§ Decline = silence — context.
|
|
41
|
+
After the user **declines** a proposal (branch switch, PR creation, tag/release entry, separate worktree, version pinning), do **not** raise it again on the same task. Decline stands until the user reopens the topic. Timing / "is this worth asking?": [`scope-mechanics § Decline = silence`](../contexts/authority/scope-mechanics.md).
|
|
75
42
|
|
|
76
43
|
## Fenced step — user-set review gates
|
|
77
44
|
|
|
78
|
-
|
|
79
|
-
yet"*, *"plan only"*, *"just write the roadmap, I'll review"*,
|
|
80
|
-
*"review first"*, *"erst Roadmap, ich schau drüber"*, *"nichts
|
|
81
|
-
implementieren"*, *"nur planen"*, *"erstmal nur X, dann ich"* — the
|
|
82
|
-
agent's reply is **the deliverable plus a handoff**, never the
|
|
83
|
-
deliverable plus *"shall we start?"*.
|
|
45
|
+
User explicitly fences off the next step — *"don't implement yet"*, *"plan only"*, *"just write the roadmap, I'll review"*, *"review first"*, *"erst Roadmap, ich schau drüber"*, *"nichts implementieren"*, *"nur planen"*, *"erstmal nur X, dann ich"* — reply is **the deliverable plus a handoff**, never deliverable plus *"shall we start?"*.
|
|
84
46
|
|
|
85
47
|
```
|
|
86
48
|
USER FENCED OFF EXECUTION → DELIVER + HAND BACK.
|
|
@@ -89,13 +51,6 @@ NO "READY TO IMPLEMENT?" RE-ASK.
|
|
|
89
51
|
NO "STARTEN WIR MIT PHASE 1?" PIVOT.
|
|
90
52
|
```
|
|
91
53
|
|
|
92
|
-
|
|
93
|
-
like `Decline = silence` above. Permitted follow-up questions on the
|
|
94
|
-
same turn cover **the deliverable** (adjust scope, fix wording, add a
|
|
95
|
-
section), never **its execution**.
|
|
54
|
+
Fence stands until the user reopens, exactly like `Decline = silence`. Permitted follow-up questions cover **the deliverable** (adjust scope, fix wording, add a section), never **its execution**.
|
|
96
55
|
|
|
97
|
-
|
|
98
|
-
delivery, hand-off-to-execution drift, inferring acceptance from a
|
|
99
|
-
thumbs-up) and the explicit bypass phrases that lift the fence, see
|
|
100
|
-
[`scope-mechanics`](../contexts/authority/scope-mechanics.md)
|
|
101
|
-
§ Fenced step.
|
|
56
|
+
Failure-mode catalog (Option 1 = "start now", re-asking after delivery, hand-off-to-execution drift, inferring acceptance from a thumbs-up) and explicit bypass phrases: [`scope-mechanics § Fenced step`](../contexts/authority/scope-mechanics.md).
|
|
@@ -4,6 +4,12 @@ tier: "2a"
|
|
|
4
4
|
alwaysApply: false
|
|
5
5
|
description: "Security-sensitive paths — auth, billing, tenant boundaries, secrets, file uploads, external integrations, webhooks, public endpoints — stop and run threat analysis BEFORE editing"
|
|
6
6
|
source: package
|
|
7
|
+
triggers:
|
|
8
|
+
- keyword: "auth"
|
|
9
|
+
- keyword: "billing"
|
|
10
|
+
- keyword: "tenant"
|
|
11
|
+
- keyword: "secret"
|
|
12
|
+
- keyword: "webhook"
|
|
7
13
|
---
|
|
8
14
|
|
|
9
15
|
# Security-Sensitive Stop Rule
|
|
@@ -43,7 +49,7 @@ STOP writing code. Run the matching analysis skill first:
|
|
|
43
49
|
| Wide refactor of security-sensitive code | `blast-radius-analyzer` |
|
|
44
50
|
|
|
45
51
|
**Before running the analysis, consult memory for prior incidents** on
|
|
46
|
-
this surface. Via [`memory-access`](
|
|
52
|
+
this surface. Via [`memory-access`](../docs/guidelines/agent-infra/memory-access.md):
|
|
47
53
|
|
|
48
54
|
```python
|
|
49
55
|
from scripts.memory_lookup import retrieve
|
|
@@ -4,6 +4,11 @@ tier: "mechanical-already"
|
|
|
4
4
|
description: "Creating or editing rules, skills, commands, guidelines, AGENTS.md, or copilot-instructions.md — enforce size and scope limits"
|
|
5
5
|
alwaysApply: false
|
|
6
6
|
source: package
|
|
7
|
+
triggers:
|
|
8
|
+
- intent: "create rule"
|
|
9
|
+
- intent: "create skill"
|
|
10
|
+
- intent: "create command"
|
|
11
|
+
- intent: "create guideline"
|
|
7
12
|
---
|
|
8
13
|
|
|
9
14
|
# size-enforcement
|
|
@@ -23,7 +28,7 @@ source: package
|
|
|
23
28
|
- Rules and system instructions should stay well below 200 lines
|
|
24
29
|
- Smaller (≈60 lines) is strongly preferred
|
|
25
30
|
|
|
26
|
-
→ Size limits and details:
|
|
31
|
+
→ Size limits and details: `../docs/guidelines/agent-infra/size-and-scope.md`
|
|
27
32
|
|
|
28
33
|
→ Frontmatter contract: schemas live in `scripts/schemas/` and are enforced by
|
|
29
34
|
`python3 scripts/validate_frontmatter.py`.
|
|
@@ -2,58 +2,18 @@
|
|
|
2
2
|
type: "auto"
|
|
3
3
|
tier: "2a"
|
|
4
4
|
description: "After completing a meaningful task — trigger post-task learning capture if pipelines.skill_improvement is enabled"
|
|
5
|
-
alwaysApply: false
|
|
6
5
|
source: package
|
|
6
|
+
triggers:
|
|
7
|
+
- phrase: "after completing"
|
|
8
|
+
- keyword: "improvement"
|
|
9
|
+
- keyword: "pipeline"
|
|
10
|
+
routes_to:
|
|
11
|
+
- "skill:skill-improvement-pipeline"
|
|
7
12
|
---
|
|
8
13
|
|
|
9
14
|
# Skill Improvement Trigger
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
**Iron Law.** After a meaningful task, trigger the post-task learning capture if `pipelines.skill_improvement` is enabled.
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- **If `false` or missing** → do nothing. Stop here.
|
|
16
|
-
- **If `true`** → continue.
|
|
17
|
-
|
|
18
|
-
## What counts as "meaningful task"
|
|
19
|
-
|
|
20
|
-
Trigger after completing tasks that involve:
|
|
21
|
-
- Debugging a non-trivial bug (root cause wasn't obvious)
|
|
22
|
-
- Implementing a feature that required learning something new
|
|
23
|
-
- A pattern that worked well and should be remembered
|
|
24
|
-
- A mistake that cost >5 minutes to diagnose
|
|
25
|
-
- A workaround for a tool limitation
|
|
26
|
-
|
|
27
|
-
## What does NOT trigger
|
|
28
|
-
|
|
29
|
-
- Config changes, typos, docs-only edits
|
|
30
|
-
- Routine tasks with no surprises
|
|
31
|
-
- Tasks where the agent is just following instructions step by step
|
|
32
|
-
- Tasks shorter than 3 messages
|
|
33
|
-
|
|
34
|
-
## Trigger behavior
|
|
35
|
-
|
|
36
|
-
After completing a qualifying task, do a **quick mental check** (not a full workflow):
|
|
37
|
-
|
|
38
|
-
1. Was there a concrete, actionable learning?
|
|
39
|
-
2. Is it generalizable (not project-specific one-off)?
|
|
40
|
-
3. Is it NOT already covered by an existing rule or skill?
|
|
41
|
-
|
|
42
|
-
If all 3 are YES → propose to the user:
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
> 💡 Learning detected: "{one-sentence summary}"
|
|
46
|
-
>
|
|
47
|
-
> 1. Capture & improve — run the improvement pipeline
|
|
48
|
-
> 2. Skip — not worth capturing
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
If user picks 1 → invoke the `skill-improvement-pipeline` skill.
|
|
52
|
-
If user picks 2 → stop, do not ask again for this task.
|
|
53
|
-
|
|
54
|
-
## Important
|
|
55
|
-
|
|
56
|
-
- **Never auto-run the pipeline** — always ask first.
|
|
57
|
-
- **Max 1 trigger per task** — don't ask repeatedly.
|
|
58
|
-
- **Be honest** — if the learning is vague ("be more careful"), skip it silently.
|
|
59
|
-
- **Do not interrupt the user's flow** — only trigger AFTER the task is done.
|
|
18
|
+
Body migrated to `skill:skill-improvement-pipeline` (per P4 of `road-to-kernel-and-router.md`).
|
|
19
|
+
Trigger-set above activates this routing under the `balanced` and `full` profiles.
|
|
@@ -2,122 +2,16 @@
|
|
|
2
2
|
type: "auto"
|
|
3
3
|
tier: "mechanical-already"
|
|
4
4
|
description: "Creating, editing, or reviewing skills — minimum quality standard, every skill must be executable, validated, and self-contained"
|
|
5
|
-
alwaysApply: false
|
|
6
5
|
source: package
|
|
7
|
-
|
|
8
|
-
- .agent-src.uncompressed/
|
|
6
|
+
triggers:
|
|
7
|
+
- path_prefix: ".agent-src.uncompressed/skills/"
|
|
8
|
+
routes_to:
|
|
9
|
+
- "guideline:agent-infra/skill-quality-checklist"
|
|
9
10
|
---
|
|
10
11
|
|
|
11
12
|
# Skill Quality
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
**Iron Law.** Every skill must be executable, validated, and self-contained — full checklist in the guideline.
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
| # | Question | Section | Standard |
|
|
18
|
-
|---|---|---|---|
|
|
19
|
-
| 1 | When should I use this? | `When to use` | Concrete trigger, not generic |
|
|
20
|
-
| 2 | What exactly do I do? | `Procedure` | Executable steps with decisions |
|
|
21
|
-
| 3 | How do I verify it worked? | `Procedure` (validation step) | Concrete checks, not "verify it works" |
|
|
22
|
-
| 4 | What common failure must I avoid? | `Gotcha` + `Do NOT` | Real failure patterns, not platitudes |
|
|
23
|
-
|
|
24
|
-
## Required Sections
|
|
25
|
-
|
|
26
|
-
Every skill MUST have: `When to use`, `Procedure`, `Gotcha`, `Output format`, `Do NOT`.
|
|
27
|
-
|
|
28
|
-
## Frontmatter Contract
|
|
29
|
-
|
|
30
|
-
Every skill's YAML frontmatter MUST validate against `scripts/schemas/skill.schema.json`.
|
|
31
|
-
Violations are reported by `scripts/skill_linter.py` as `schema_<rule>` errors
|
|
32
|
-
and fail `python3 scripts/validate_frontmatter.py` and the full CI pipeline.
|
|
33
|
-
|
|
34
|
-
## Description Triggering
|
|
35
|
-
|
|
36
|
-
Claude routes skills by their frontmatter `description`. Pushy,
|
|
37
|
-
trigger-rich descriptions are required — polite or hedged ones cause
|
|
38
|
-
undertriggering. The full recipe (concrete verb phrase, ≥2 triggers,
|
|
39
|
-
`even if they don't explicitly ask for …` tail, ≤200 chars,
|
|
40
|
-
litmus test) lives in
|
|
41
|
-
[`contexts/communication/rules-auto/skill-quality-mechanics.md`](../contexts/communication/rules-auto/skill-quality-mechanics.md)
|
|
42
|
-
§ Description Triggering.
|
|
43
|
-
|
|
44
|
-
## Skill Independence
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
If a skill is not executable without opening a guideline, it is broken.
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
- Skills MAY reference guidelines for detailed conventions
|
|
51
|
-
- Skills MUST NOT outsource their core workflow to guidelines
|
|
52
|
-
- If removing guideline references makes the skill useless → the skill is too weak
|
|
53
|
-
|
|
54
|
-
**Litmus test:** Cover all guideline references in the Procedure. Is it still executable?
|
|
55
|
-
If not → the skill needs more own steps, decisions, and validation — not more guideline links.
|
|
56
|
-
|
|
57
|
-
## Merge & Compression Preservation
|
|
58
|
-
|
|
59
|
-
When merging or compressing skills, the result MUST preserve the
|
|
60
|
-
strongest validation, strongest examples, all anti-patterns, all
|
|
61
|
-
decision criteria, and trigger quality. Full preservation invariants
|
|
62
|
-
and "merge is invalid if …" / "compression may remove …" lists in
|
|
63
|
-
[`contexts/communication/rules-auto/skill-quality-mechanics.md`](../contexts/communication/rules-auto/skill-quality-mechanics.md)
|
|
64
|
-
§ Merge Preservation and § Compression Preservation.
|
|
65
|
-
|
|
66
|
-
## Refactor Safety
|
|
67
|
-
|
|
68
|
-
When refactoring or optimizing skills:
|
|
69
|
-
|
|
70
|
-
- NEVER weaken validation to pass linter
|
|
71
|
-
- NEVER remove anti-patterns to reduce size
|
|
72
|
-
- NEVER replace concrete checks with "verify it works"
|
|
73
|
-
- NEVER merge skills if the result is broader than either source
|
|
74
|
-
- ALWAYS run linter before and after — fail count must not increase
|
|
75
|
-
|
|
76
|
-
## Senior-Tier Required Structure
|
|
77
|
-
|
|
78
|
-
Skills with `tier: senior` in YAML frontmatter MUST carry four named
|
|
79
|
-
blocks beyond the standard required sections:
|
|
80
|
-
|
|
81
|
-
| # | Block | Heading / Location | Standard |
|
|
82
|
-
|---|---|---|---|
|
|
83
|
-
| 1 | Context-First lead | Frontmatter `description` | First sentence anchors the cognition cluster (domain + senior role); second sentence names the trigger. |
|
|
84
|
-
| 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). |
|
|
85
|
-
| 3 | Proactive Triggers | `## When the agent should load this` | 3–5 concrete user-prompt patterns (paraphrases users actually type), not abstract categories. |
|
|
86
|
-
| 4 | Output Artifacts | `## Output` | 1–4 named artifacts with shape (file path, table, markdown structure) — orchestrator-citable identifier each. |
|
|
87
|
-
|
|
88
|
-
**Forward-only.** `scripts/skill_linter.py` enforces these blocks for
|
|
89
|
-
`tier: senior` skills only; mid-tier and untiered skills skip the
|
|
90
|
-
check. No retrofit pass on existing Wing-1 skills.
|
|
91
|
-
|
|
92
|
-
Subsection specs (≤ 6-line spec + 1 reference example each), good /
|
|
93
|
-
bad pattern pairs, and the WHEN-NOT routing peer rules live in
|
|
94
|
-
[`contexts/communication/rules-auto/skill-quality-mechanics.md`](../contexts/communication/rules-auto/skill-quality-mechanics.md)
|
|
95
|
-
§ Senior-tier patterns.
|
|
96
|
-
|
|
97
|
-
## Structural Malice Floor
|
|
98
|
-
|
|
99
|
-
`scripts/skill_linter.py` runs five regex patterns against every
|
|
100
|
-
skill / rule / command body — credential exfiltration, remote
|
|
101
|
-
execution, force-push to a protected ref, world-readable secret
|
|
102
|
-
files, and shell-injection in subprocess calls. A match emits
|
|
103
|
-
``Issue("error", "malice:<pattern>", "<line>:<matched>")`` and the
|
|
104
|
-
linter exits with code **3** (security-failure), distinct from
|
|
105
|
-
exit 2 (build-failure) so CI surfaces can split the two.
|
|
106
|
-
|
|
107
|
-
The check is **structural**, not semantic — it catches the shapes
|
|
108
|
-
the [`tool-safety`](tool-safety.md) rule denies in prose: hidden
|
|
109
|
-
credentials, arbitrary execution, write-without-approval. Fixtures
|
|
110
|
-
and the exit-code-3 contract live in
|
|
111
|
-
[`tests/test_skill_linter_malice.py`](../../tests/test_skill_linter_malice.py).
|
|
112
|
-
|
|
113
|
-
## Confidence Tagging
|
|
114
|
-
|
|
115
|
-
Senior-tier procedure steps MAY append `[CONFIDENCE: high|medium|low]`
|
|
116
|
-
at the end of multi-step chains where the agent's evidence varies
|
|
117
|
-
across steps. Optional but recommended when a step's output feeds a
|
|
118
|
-
downstream decision.
|
|
119
|
-
|
|
120
|
-
Text-tag form is deliberate. Emoji 🟢 / 🟡 / 🔴 is **not** allowed —
|
|
121
|
-
collides with [`direct-answers`](direct-answers.md) § Emoji scope
|
|
122
|
-
(functional markers only). Linter does not enforce the tag itself;
|
|
123
|
-
the rule documents the placement so authors converge on one form.
|
|
16
|
+
Body migrated to `guideline:agent-infra/skill-quality-checklist` (per P4 of `road-to-kernel-and-router.md`).
|
|
17
|
+
Trigger-set above activates this routing under the `balanced` and `full` profiles.
|
|
@@ -2,71 +2,19 @@
|
|
|
2
2
|
type: "auto"
|
|
3
3
|
tier: "1"
|
|
4
4
|
description: "When user types a slash command like /create-pr, /commit, or pastes command file content"
|
|
5
|
-
alwaysApply: false
|
|
6
5
|
source: package
|
|
7
|
-
|
|
8
|
-
-
|
|
6
|
+
triggers:
|
|
7
|
+
- keyword: "/create-pr"
|
|
8
|
+
- keyword: "/commit"
|
|
9
|
+
- keyword: "/fix-ci"
|
|
10
|
+
- phrase: "slash command"
|
|
11
|
+
routes_to:
|
|
12
|
+
- "skill:command-routing"
|
|
9
13
|
---
|
|
10
14
|
|
|
11
|
-
#
|
|
15
|
+
# Slash Command Routing Policy
|
|
12
16
|
|
|
13
|
-
|
|
14
|
-
**execute it immediately**. No questions, no opinions, no summaries, no confirmations.
|
|
17
|
+
**Iron Law.** On a slash-command invocation or pasted command body, route to the matching command file; never improvise.
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
- Ask only when the command itself says "ask the user".
|
|
19
|
-
- If the user pastes the **content** of a command file, treat it as an invocation — not a question.
|
|
20
|
-
- **NEVER** respond with "looks good" or ask "shall I execute?" — just execute.
|
|
21
|
-
- **NEVER** respond with "this is the current version" or "do you want to change something?" — just execute.
|
|
22
|
-
- **NEVER** treat pasted command content as a review request — it's ALWAYS an invocation.
|
|
23
|
-
- The only exception: the user's message contains an explicit instruction about the command
|
|
24
|
-
(e.g., "update this command" or "review this command"). In that case, follow the instruction instead.
|
|
25
|
-
|
|
26
|
-
## Open files are irrelevant for command detection
|
|
27
|
-
|
|
28
|
-
The editor may report that the user has a file open (e.g., "The user has file `compress.md` open").
|
|
29
|
-
This is **irrelevant** for command detection.
|
|
30
|
-
|
|
31
|
-
- If the user types `/compress`, they want to **run** the compress command — even if `compress.md` is open in the editor.
|
|
32
|
-
- If command file content appears in the context alongside an open file, the **command invocation takes priority**.
|
|
33
|
-
- Do NOT confuse "file is open" with "user wants to discuss this file".
|
|
34
|
-
- The user's typed message determines intent — not editor state.
|
|
35
|
-
|
|
36
|
-
## Read the whole prompt — command is the operator, prose is the target
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
/<command> IS THE OPERATOR.
|
|
40
|
-
THE REST OF THE USER MESSAGE NAMES THE TARGET.
|
|
41
|
-
NEVER ASSUME THE COMMAND NAME IS THE TARGET.
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Slash token = **what to do**; surrounding prose = **what to do it on**.
|
|
45
|
-
|
|
46
|
-
- `/council and analyse chat-history` → target is `chat-history`,
|
|
47
|
-
not `council`. Council is the *tool*, prose names the *artefact*.
|
|
48
|
-
- `/work the memory bug from PROJ-123` → target is "the memory bug
|
|
49
|
-
from PROJ-123".
|
|
50
|
-
- `/fix ci and then open a PR` → target is "CI failure"; trailing
|
|
51
|
-
"open a PR" is a follow-up needing separate permission (per
|
|
52
|
-
`scope-control`).
|
|
53
|
-
|
|
54
|
-
### Pre-flight before expensive operations
|
|
55
|
-
|
|
56
|
-
Before any operation costing real time or money — external API call,
|
|
57
|
-
large codebase analysis, multi-file refactor, council run, generated
|
|
58
|
-
test suite — run silently:
|
|
59
|
-
|
|
60
|
-
1. Re-read the **whole** user message, not just slash + first token.
|
|
61
|
-
2. Identify the target the prose actually names.
|
|
62
|
-
3. Target unambiguous → execute, no question.
|
|
63
|
-
4. Target **genuinely** ambiguous after re-reading (prose names *two*
|
|
64
|
-
artefacts, can't tell which is the operand) → ask ONE
|
|
65
|
-
disambiguating numbered-options question per
|
|
66
|
-
[`ask-when-uncertain`](ask-when-uncertain.md), then proceed.
|
|
67
|
-
|
|
68
|
-
**Not** a license to re-introduce cheap questions (`no-cheap-questions`
|
|
69
|
-
still binds). Threshold: *"would this guess waste the user's tokens,
|
|
70
|
-
money, or trust?"* — not *"I'd feel safer asking"*. Single failure
|
|
71
|
-
mode to avoid: spending API spend on the wrong artefact because the
|
|
72
|
-
agent fixated on the command name.
|
|
19
|
+
Body migrated to `skill:command-routing` (per P4 of `road-to-kernel-and-router.md`).
|
|
20
|
+
Trigger-set above activates this routing under the `balanced` and `full` profiles.
|
|
@@ -4,100 +4,35 @@ tier: "2b"
|
|
|
4
4
|
description: "Before coding, modifying, or debugging — analyze first, verify with real tools, never guess or trial-and-error"
|
|
5
5
|
alwaysApply: false
|
|
6
6
|
source: package
|
|
7
|
+
load_context:
|
|
8
|
+
- ../contexts/communication/rules-auto/think-before-action-mechanics.md
|
|
9
|
+
triggers:
|
|
10
|
+
- intent: "before coding"
|
|
11
|
+
- intent: "before debugging"
|
|
12
|
+
- intent: "before modifying"
|
|
7
13
|
---
|
|
8
14
|
|
|
9
15
|
# think-before-action
|
|
10
16
|
|
|
11
|
-
|
|
12
|
-
- Never guess behavior — verify using code, data, or tools
|
|
13
|
-
- Prefer targeted inspection over brute-force trial-and-error
|
|
14
|
-
- Use efficient tooling (e.g. jq, debugger, logs) instead of loading full data
|
|
15
|
-
- Always verify results after changes (API calls, UI tests, etc.)
|
|
16
|
-
- When behavior can be defined, prefer test-first or test-driven work
|
|
17
|
-
- If requirements are unclear, ask a precise clarification question instead of making hidden assumptions
|
|
18
|
-
- Refactors must preserve behavior, validation, examples, and anti-failure guidance unless there is an explicit reason to change them
|
|
19
|
-
- Do NOT modify code you do not fully understand — read it first, trace the flow, then change it
|
|
20
|
-
- When multiple valid frameworks/patterns already exist in the codebase (e.g. Tailwind + Flux, multiple form libraries, competing state stores), do NOT pick one silently — ask which to use. See [`no blind implementation`](../../docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md#2-no-blind-implementation)
|
|
17
|
+
## The Iron Law
|
|
21
18
|
|
|
22
|
-
|
|
19
|
+
```
|
|
20
|
+
ANALYZE BEFORE CODING. VERIFY WITH REAL TOOLS. NEVER GUESS.
|
|
21
|
+
NO BLIND TRIAL-AND-ERROR. MAX 2 RETRIES PER APPROACH.
|
|
22
|
+
```
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
- Always analyze before coding or modifying anything.
|
|
25
|
+
- Never guess behavior — verify using code, data, or tools.
|
|
26
|
+
- Prefer targeted inspection (jq, debugger, logs) over brute-force.
|
|
27
|
+
- Always verify results after changes (API, UI, tests).
|
|
28
|
+
- When behavior can be defined → prefer test-first / TDD.
|
|
29
|
+
- Unclear requirements → precise clarification question, not hidden assumptions.
|
|
30
|
+
- Refactors must preserve behavior, validation, examples, and anti-failure guidance unless explicitly changed.
|
|
31
|
+
- Do NOT modify code you do not fully understand — read it, trace the flow, then change it.
|
|
32
|
+
- Multiple valid frameworks/patterns coexist (Tailwind + Flux, multiple form libs, competing state stores) → do NOT pick one silently — ask. See [`no blind implementation`](../docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md#2-no-blind-implementation).
|
|
25
33
|
|
|
26
|
-
|
|
27
|
-
2. **Analyze** — Read affected code, trace data flow, compare with requirements and existing patterns.
|
|
28
|
-
3. **Plan** — Decide what to change, what NOT to change, and how to verify success.
|
|
29
|
-
4. **Implement** — Make focused changes. Follow existing patterns. No unrelated rewrites.
|
|
30
|
-
5. **Verify** — Run tests, hit the endpoint, check the UI. Real execution, not "should work".
|
|
34
|
+
## Mechanics — workflow, minimum read set, verify-with-real-tools, no blind retries
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## Minimum read set — read before you write
|
|
35
|
-
|
|
36
|
-
Before editing code, read the minimum set that defines its behavior:
|
|
37
|
-
|
|
38
|
-
1. **Symbol under edit** — full method/function body, not just the planned line.
|
|
39
|
-
2. **Direct callers** — one level up (`grep -rn "<symbol>"` + open the matches).
|
|
40
|
-
3. **Tests** — if a test file exists, it encodes the contract.
|
|
41
|
-
4. **One layer of related abstractions** — interface, parent class, or trait (one hop, not the full hierarchy).
|
|
42
|
-
5. **Data changes:** the migration that created the column + any seeder/factory that references it.
|
|
43
|
-
|
|
44
|
-
Stop expanding once you can explain, in your own words, what the symbol does, who calls
|
|
45
|
-
it, and what breaks if you change its behavior. If you cannot → read more. Never write
|
|
46
|
-
code based on guessed behavior.
|
|
47
|
-
|
|
48
|
-
### Consult memory before editing
|
|
49
|
-
|
|
50
|
-
Prior decisions and invariants live in the memory layer. Via
|
|
51
|
-
[`memory-access`](../../docs/guidelines/agent-infra/memory-access.md), call
|
|
52
|
-
`retrieve(types=["architecture-decisions", "domain-invariants"], keys=<touched paths>, limit=3)`.
|
|
53
|
-
A matching `architecture-decision` explains *why* the current shape
|
|
54
|
-
exists; a matching `domain-invariant` is a hard constraint you cannot
|
|
55
|
-
violate. Cite the `id` if a match influences the plan.
|
|
56
|
-
|
|
57
|
-
## Verify with real tools
|
|
58
|
-
|
|
59
|
-
Always verify changes with actual execution — not by reading code and assuming it works.
|
|
60
|
-
|
|
61
|
-
| What changed | How to verify |
|
|
62
|
-
|---|---|
|
|
63
|
-
| **Backend/API** | `curl`, Postman (or Postman MCP if available), test endpoint |
|
|
64
|
-
| **Frontend/UI** | Playwright MCP or browser — check rendered state, interactions |
|
|
65
|
-
| **Logic/flow** | Xdebug (or Xdebug MCP if available) — trace execution, inspect variables |
|
|
66
|
-
| **CLI/Jobs** | Run the command, check side effects, verify exit code |
|
|
67
|
-
| **Database** | Query the result, check migrations ran correctly |
|
|
68
|
-
|
|
69
|
-
If a debugging/testing tool is available as MCP server — prefer it over manual alternatives.
|
|
70
|
-
|
|
71
|
-
If verification is not possible (no endpoint, no UI, no test): explicitly state what is missing
|
|
72
|
-
and explain how the change should be tested.
|
|
73
|
-
|
|
74
|
-
## Reduce output — targeted tools over full dumps
|
|
75
|
-
|
|
76
|
-
Never load full datasets into context. Extract what you need:
|
|
77
|
-
|
|
78
|
-
- `jq` for JSON: `curl -s /api/users | jq '.[0] | {id, email}'` — not the full response
|
|
79
|
-
- `rg` / `grep` for text: search specific patterns, not full files
|
|
80
|
-
- `head`, `tail`, `cut`, `sort`, `uniq` for narrowing results
|
|
81
|
-
- `--filter`, `--json`, `--format` flags on CLI tools — use them
|
|
82
|
-
- Laravel: `route:list --json | jq` over raw `route:list` dump
|
|
83
|
-
- Logs: filter by request ID, timestamp, or error type — not full log files
|
|
84
|
-
|
|
85
|
-
## No blind retries
|
|
86
|
-
|
|
87
|
-
- If something fails: **read the error**, analyze the cause, then fix it
|
|
88
|
-
- Do NOT retry the same approach hoping for a different result
|
|
89
|
-
- Do NOT loop through trial-and-error when one targeted inspection would reveal the cause
|
|
90
|
-
- Max 2 retries for the same approach — then stop and rethink
|
|
91
|
-
|
|
92
|
-
## Open files are context, not intent
|
|
93
|
-
|
|
94
|
-
The editor may report that the user has a file open. This is **background context only** —
|
|
95
|
-
it does NOT mean the user's message is about that file.
|
|
96
|
-
|
|
97
|
-
- **The user's message determines intent** — not which file is open.
|
|
98
|
-
- A user can have `README.md` open and type `/compress` — the intent is to compress, not to discuss the README.
|
|
99
|
-
- A user can have `UserController.php` open and ask "how do tests work?" — the intent is testing, not the controller.
|
|
100
|
-
- Only treat the open file as relevant when the user's message explicitly references it
|
|
101
|
-
(e.g., "fix this file", "what does this do?", "update the open file").
|
|
36
|
+
The five-step Understand → Analyze → Plan → Implement → Verify workflow, the minimum read set (symbol, callers, tests, abstractions, data), the memory-consult step, the verification matrix, the output-reduction patterns, the no-blind-retries protocol, and the "open files are context, not intent" clause all live in [`contexts/communication/rules-auto/think-before-action-mechanics.md`](../contexts/communication/rules-auto/think-before-action-mechanics.md). The rule above is the obligation surface; the mechanics file is the lookup material.
|
|
102
37
|
|
|
103
38
|
If analysis is skipped → results are unreliable.
|