@event4u/agent-config 8.12.0 → 9.0.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/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +164 -0
- package/README.md +1 -1
- package/dist/agent-src/commands/agent-handoff.md +35 -0
- package/dist/agent-src/commands/agents/init.md +1 -0
- package/dist/agent-src/commands/agents/optimize.md +1 -0
- package/dist/agent-src/commands/agents/user/accept.md +3 -2
- package/dist/agent-src/commands/agents/user/init.md +5 -4
- package/dist/agent-src/commands/agents/user/update.md +3 -2
- package/dist/agent-src/commands/agents/user.md +1 -0
- package/dist/agent-src/commands/agents.md +1 -0
- package/dist/agent-src/commands/analytics/show.md +1 -0
- package/dist/agent-src/commands/analytics.md +1 -0
- package/dist/agent-src/commands/analyze/decision.md +1 -0
- package/dist/agent-src/commands/analyze/incident.md +1 -0
- package/dist/agent-src/commands/analyze/near-miss.md +1 -0
- package/dist/agent-src/commands/analyze/postmortem.md +1 -0
- package/dist/agent-src/commands/analyze/premortem.md +1 -0
- package/dist/agent-src/commands/analyze/reference-repo.md +1 -0
- package/dist/agent-src/commands/analyze.md +3 -2
- package/dist/agent-src/commands/brand/identity.md +6 -5
- package/dist/agent-src/commands/brand/review.md +6 -5
- package/dist/agent-src/commands/brand/strategy.md +6 -4
- package/dist/agent-src/commands/brand/tokens.md +7 -6
- package/dist/agent-src/commands/brand/voice.md +5 -4
- package/dist/agent-src/commands/brand.md +9 -7
- package/dist/agent-src/commands/bug/fix.md +1 -0
- package/dist/agent-src/commands/bug/investigate.md +1 -0
- package/dist/agent-src/commands/bug.md +2 -1
- package/dist/agent-src/commands/challenge-me/vision.md +1 -0
- package/dist/agent-src/commands/challenge-me/with-docs.md +1 -0
- package/dist/agent-src/commands/challenge-me.md +28 -6
- package/dist/agent-src/commands/chat-history.md +1 -0
- package/dist/agent-src/commands/check-current-md.md +1 -0
- package/dist/agent-src/commands/commit.md +1 -0
- package/dist/agent-src/commands/context/create.md +3 -2
- package/dist/agent-src/commands/context.md +1 -0
- package/dist/agent-src/commands/cost/profile.md +1 -0
- package/dist/agent-src/commands/cost.md +2 -1
- package/dist/agent-src/commands/council/analysis.md +1 -0
- package/dist/agent-src/commands/council/debate.md +1 -0
- package/dist/agent-src/commands/council/default.md +21 -20
- package/dist/agent-src/commands/council/design.md +1 -0
- package/dist/agent-src/commands/council/optimize.md +1 -0
- package/dist/agent-src/commands/council/pr.md +1 -0
- package/dist/agent-src/commands/council.md +1 -0
- package/dist/agent-src/commands/estimate-ticket.md +1 -0
- package/dist/agent-src/commands/feature/dev.md +1 -0
- package/dist/agent-src/commands/feature/explore.md +1 -0
- package/dist/agent-src/commands/feature/plan.md +1 -0
- package/dist/agent-src/commands/feature/refactor.md +1 -0
- package/dist/agent-src/commands/feature/roadmap.md +1 -0
- package/dist/agent-src/commands/feature.md +2 -1
- package/dist/agent-src/commands/fix/pr-comments.md +19 -0
- package/dist/agent-src/commands/fix.md +2 -1
- package/dist/agent-src/commands/ghostwriter/delete.md +1 -0
- package/dist/agent-src/commands/ghostwriter/fetch.md +1 -0
- package/dist/agent-src/commands/ghostwriter/show.md +1 -0
- package/dist/agent-src/commands/ghostwriter/write.md +1 -0
- package/dist/agent-src/commands/ghostwriter.md +1 -0
- package/dist/agent-src/commands/grill-me.md +17 -12
- package/dist/agent-src/commands/humanize.md +1 -0
- package/dist/agent-src/commands/image/analyse.md +2 -1
- package/dist/agent-src/commands/image/create.md +1 -0
- package/dist/agent-src/commands/image/verify.md +1 -0
- package/dist/agent-src/commands/image.md +16 -12
- package/dist/agent-src/commands/implement-ticket.md +1 -0
- package/dist/agent-src/commands/judge/on-diff.md +1 -0
- package/dist/agent-src/commands/judge/solo.md +1 -0
- package/dist/agent-src/commands/judge/steps.md +1 -0
- package/dist/agent-src/commands/judge.md +1 -0
- package/dist/agent-src/commands/knowledge/cross-repo.md +1 -0
- package/dist/agent-src/commands/knowledge/forget.md +1 -0
- package/dist/agent-src/commands/knowledge/ingest.md +1 -0
- package/dist/agent-src/commands/knowledge/list.md +10 -0
- package/dist/agent-src/commands/knowledge.md +1 -0
- package/dist/agent-src/commands/memory/learn-low-impact.md +1 -0
- package/dist/agent-src/commands/memory/mine-session.md +1 -0
- package/dist/agent-src/commands/memory/promote.md +3 -2
- package/dist/agent-src/commands/memory.md +1 -0
- package/dist/agent-src/commands/mission/upgrade.md +45 -24
- package/dist/agent-src/commands/mode.md +1 -0
- package/dist/agent-src/commands/module/create.md +1 -0
- package/dist/agent-src/commands/module/explore.md +1 -0
- package/dist/agent-src/commands/module.md +1 -0
- package/dist/agent-src/commands/optimize/agents-dir.md +1 -0
- package/dist/agent-src/commands/optimize/project.md +1 -0
- package/dist/agent-src/commands/optimize/prompt.md +1 -0
- package/dist/agent-src/commands/optimize.md +2 -1
- package/dist/agent-src/commands/orchestrate.md +1 -0
- package/dist/agent-src/commands/override.md +1 -0
- package/dist/agent-src/commands/package.md +2 -1
- package/dist/agent-src/commands/post-as/ghostwriter.md +1 -0
- package/dist/agent-src/commands/post-as/me.md +1 -0
- package/dist/agent-src/commands/post-as.md +1 -0
- package/dist/agent-src/commands/pr/create/description-only.md +1 -0
- package/dist/agent-src/commands/pr/create.md +28 -0
- package/dist/agent-src/commands/prediction-pool.md +7 -6
- package/dist/agent-src/commands/prepare-for-review.md +1 -0
- package/dist/agent-src/commands/profile/activate.md +1 -0
- package/dist/agent-src/commands/profile/deactivate.md +1 -0
- package/dist/agent-src/commands/profile.md +1 -0
- package/dist/agent-src/commands/project.md +2 -1
- package/dist/agent-src/commands/refine-ticket.md +7 -0
- package/dist/agent-src/commands/research/deep.md +1 -0
- package/dist/agent-src/commands/research.md +1 -0
- package/dist/agent-src/commands/review/routing.md +1 -0
- package/dist/agent-src/commands/review.md +2 -1
- package/dist/agent-src/commands/roadmap/ai-council.md +1 -0
- package/dist/agent-src/commands/roadmap/materialize.md +1 -0
- package/dist/agent-src/commands/roadmap/process-full.md +1 -0
- package/dist/agent-src/commands/roadmap/process-phase.md +1 -0
- package/dist/agent-src/commands/roadmap/process-step.md +1 -0
- package/dist/agent-src/commands/roadmap.md +1 -0
- package/dist/agent-src/commands/security-audit-config.md +2 -1
- package/dist/agent-src/commands/skill/preview.md +1 -0
- package/dist/agent-src/commands/skill.md +1 -0
- package/dist/agent-src/commands/skills/discover.md +1 -0
- package/dist/agent-src/commands/skills.md +1 -0
- package/dist/agent-src/commands/sync/agent-settings.md +1 -0
- package/dist/agent-src/commands/sync.md +2 -1
- package/dist/agent-src/commands/team/adversarial.md +97 -0
- package/dist/agent-src/commands/team/delegate.md +110 -0
- package/dist/agent-src/commands/team/review.md +85 -0
- package/dist/agent-src/commands/team/status.md +123 -0
- package/dist/agent-src/commands/team-knowledge.md +8 -6
- package/dist/agent-src/commands/team.md +152 -0
- package/dist/agent-src/commands/tests/e2e-heal.md +1 -0
- package/dist/agent-src/commands/tests/e2e-plan.md +1 -0
- package/dist/agent-src/commands/tests/execute.md +1 -0
- package/dist/agent-src/commands/tests.md +2 -1
- package/dist/agent-src/commands/update-form-request-messages.md +1 -0
- package/dist/agent-src/commands/upstream-contribute.md +1 -0
- package/dist/agent-src/commands/video/from-script.md +3 -2
- package/dist/agent-src/commands/video/from-song.md +22 -21
- package/dist/agent-src/commands/video/scene.md +1 -0
- package/dist/agent-src/commands/video/stitch.md +2 -1
- package/dist/agent-src/commands/video/storyboard.md +1 -0
- package/dist/agent-src/commands/video.md +1 -0
- package/dist/agent-src/commands/work.md +1 -0
- package/dist/agent-src/commands/worktree/cleanup.md +8 -7
- package/dist/agent-src/commands/worktree/create.md +1 -0
- package/dist/agent-src/commands/worktree/verify.md +1 -0
- package/dist/agent-src/commands/worktree.md +1 -0
- package/dist/agent-src/rules/active-remediation.md +12 -36
- package/dist/agent-src/rules/artifact-drafting-protocol.md +7 -64
- package/dist/agent-src/rules/context-hygiene.md +19 -113
- package/dist/agent-src/rules/design-fidelity.md +4 -60
- package/dist/agent-src/rules/domain-adoption-policy.md +10 -106
- package/dist/agent-src/rules/framework-neutrality-in-generic-skills.md +12 -60
- package/dist/agent-src/rules/improve-before-implement.md +6 -0
- package/dist/agent-src/rules/minimal-safe-diff.md +6 -86
- package/dist/agent-src/rules/size-enforcement.md +10 -0
- package/dist/agent-src/rules/tool-safety.md +17 -3
- package/dist/agent-src/skills/agent-security-review/SKILL.md +12 -1
- package/dist/agent-src/skills/ai-council/SKILL.md +11 -0
- package/dist/agent-src/skills/bug-analyzer/SKILL.md +24 -2
- package/dist/agent-src/skills/code-review/SKILL.md +105 -93
- package/dist/agent-src/skills/code-review/checklists/backend.md +50 -0
- package/dist/agent-src/skills/code-review/checklists/database.md +19 -0
- package/dist/agent-src/skills/code-review/checklists/dependency.md +18 -0
- package/dist/agent-src/skills/code-review/checklists/docs.md +14 -0
- package/dist/agent-src/skills/code-review/checklists/frontend.md +19 -0
- package/dist/agent-src/skills/code-review/checklists/infra.md +17 -0
- package/dist/agent-src/skills/code-review/checklists/producing-the-review.md +62 -0
- package/dist/agent-src/skills/code-review/checklists/test-only.md +13 -0
- package/dist/agent-src/skills/code-review/evals/evals.json +53 -15
- package/dist/agent-src/skills/condense-memory/SKILL.md +3 -2
- package/dist/agent-src/skills/conventional-commits-writing/evals/evals.json +15 -0
- package/dist/agent-src/skills/docker/SKILL.md +10 -0
- package/dist/agent-src/skills/docx-authoring/SKILL.md +102 -0
- package/dist/agent-src/skills/github-ci/evals/evals.json +25 -0
- package/dist/agent-src/skills/humanizer/SKILL.md +79 -3
- package/dist/agent-src/skills/humanizer/references/anti-aiisms.md +112 -0
- package/dist/agent-src/skills/humanizer/references/fixtures.md +70 -0
- package/dist/agent-src/skills/judge-bug-hunter/SKILL.md +7 -1
- package/dist/agent-src/skills/laravel/SKILL.md +10 -0
- package/dist/agent-src/skills/launch-readiness/SKILL.md +35 -0
- package/dist/agent-src/skills/merge-conflicts/SKILL.md +30 -0
- package/dist/agent-src/skills/pdf-tools/SKILL.md +101 -0
- package/dist/agent-src/skills/quality-tools/evals/evals.json +15 -0
- package/dist/agent-src/skills/security-audit/SKILL.md +29 -0
- package/dist/agent-src/skills/security-maturity-assessment/SKILL.md +90 -0
- package/dist/agent-src/skills/security-maturity-assessment/evals/triggers.json +52 -0
- package/dist/agent-src/skills/skill-writing/SKILL.md +79 -0
- package/dist/agent-src/skills/spreadsheet-authoring/SKILL.md +11 -3
- package/dist/agent-src/skills/subagent-orchestration/schemas/team-review-status.json +103 -0
- package/dist/agent-src/skills/terraform/SKILL.md +10 -0
- package/dist/agent-src/skills/test-driven-development/SKILL.md +31 -0
- package/dist/agent-src/skills/threat-modeling/SKILL.md +15 -0
- package/dist/agent-src/templates/agents/agent-project-settings.example.yml +1 -1
- package/dist/agent-src/templates/scripts/telemetry/aggregator.ts +0 -0
- package/dist/agent-src/templates/scripts/telemetry/engagement.ts +30 -0
- package/dist/agent-src/templates/scripts/telemetry/report_renderer.ts +22 -9
- package/dist/agent-src/templates/scripts/telemetry_record.ts +5 -0
- package/dist/discovery/deprecation-report.md +1 -1
- package/dist/discovery/discovery-manifest.json +378 -174
- package/dist/discovery/discovery-manifest.json.sha256 +1 -1
- package/dist/discovery/discovery-manifest.summary.md +4 -4
- package/dist/discovery/orphan-report.md +1 -1
- package/dist/discovery/packs.json +16 -8
- package/dist/discovery/trust-report.md +3 -3
- package/dist/discovery/workspaces.json +14 -6
- package/dist/install/install.mjs +46 -0
- package/dist/mcp/registry-manifest.json +3 -3
- package/dist/router.json +1 -1
- package/dist/scripts/condense.js +5 -0
- package/dist/scripts/condense.js.map +1 -1
- package/dist/server/schemas/settings.js +11 -0
- package/dist/server/schemas/settings.js.map +1 -1
- package/docs/CLAIMS.md +9 -2
- package/docs/SKILL_CENSUS.md +8 -0
- package/docs/architecture.md +3 -3
- package/docs/benchmark.md +67 -2
- package/docs/catalog.md +10 -4
- package/docs/command-flows.md +6 -1
- package/docs/contracts/ai-council-config.md +9 -2
- package/docs/contracts/ai-team-config.md +224 -0
- package/docs/contracts/command-clusters.md +1 -0
- package/docs/contracts/prelaunch-diagnostics.md +151 -0
- package/docs/contracts/release-pr-gating.md +1 -0
- package/docs/decisions/ADR-049-configuration-trust-boundary.md +9 -1
- package/docs/featured-skills.md +2 -2
- package/docs/getting-started-by-role.md +3 -1
- package/docs/getting-started.md +42 -1
- package/docs/governance-advantage.md +1 -1
- package/docs/guidelines/agent-infra/active-remediation-mechanics.md +45 -0
- package/docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md +28 -0
- package/docs/guidelines/agent-infra/artifact-drafting-protocol-mechanics.md +76 -0
- package/docs/guidelines/agent-infra/context-hygiene-mechanics.md +90 -0
- package/docs/guidelines/agent-infra/domain-adoption-gates.md +112 -0
- package/docs/guidelines/agent-infra/framework-neutrality-patterns.md +66 -0
- package/docs/guidelines/agent-infra/minimal-safe-diff-mechanics.md +99 -0
- package/docs/guidelines/agent-infra/skill-quality-checklist.md +13 -0
- package/docs/guidelines/design-fidelity-mechanics.md +76 -0
- package/docs/maintainers/branch-protection.md +18 -0
- package/docs/parity/command-frontmatter.md +60 -0
- package/docs/proof.md +7 -6
- package/package.json +1 -1
- package/src/agent-src/templates/scripts/telemetry/aggregator.ts +0 -0
- package/src/agent-src/templates/scripts/telemetry/engagement.ts +30 -0
- package/src/agent-src/templates/scripts/telemetry/report_renderer.ts +22 -9
- package/src/agent-src/templates/scripts/telemetry_record.ts +5 -0
- package/src/config/agent-settings.template.yml +71 -7
- package/src/config/prelaunch-areas.yml +36 -0
- package/src/scripts/_cli/cmd_doctor.ts +288 -1
- package/src/scripts/_lib/claude_plugin.ts +114 -4
- package/src/scripts/_lib/orchestration_record.ts +5 -0
- package/src/scripts/_lib/tool_adapter_registry.ts +120 -0
- package/src/scripts/ai_team/config.ts +234 -0
- package/src/scripts/ai_team/review_gate.ts +636 -0
- package/src/scripts/ai_team/team_dispatch.ts +612 -0
- package/src/scripts/bench_ab_task_runner.ts +11 -1
- package/src/scripts/bench_parity_count.ts +279 -0
- package/src/scripts/build_linear_digest.ts +3 -1
- package/src/scripts/check_bridge_derivation.ts +172 -0
- package/src/scripts/check_consumer_scope_flip.ts +179 -0
- package/src/scripts/check_council_config_location.ts +115 -15
- package/src/scripts/check_host_loadability.ts +81 -0
- package/src/scripts/condense.ts +5 -0
- package/src/scripts/hook_manifest.yaml +12 -1
- package/src/scripts/install.ts +39 -0
- package/src/scripts/lint_handoffs.ts +42 -0
- package/src/scripts/lint_skill_descriptions.ts +228 -0
- package/src/scripts/lint_skill_descriptions_allowlist.json +1 -0
- package/src/scripts/lint_skill_scripts_readonly.ts +145 -0
- package/src/scripts/lint_skill_scripts_readonly_allowlist.json +8 -0
- package/src/scripts/lint_supported_tools_matrix.ts +35 -0
- package/src/scripts/optimize_skill_description.ts +144 -0
- package/src/scripts/orchestration_record.ts +2 -1
- package/src/scripts/prelaunch_diagnostics.ts +248 -0
- package/src/scripts/rule_backlinks.ts +0 -0
- package/src/scripts/run_skill_evals.ts +70 -4
- package/src/scripts/schemas/command.schema.json +7 -0
- package/src/scripts/schemas/evals.schema.json +105 -14
- package/src/scripts/schemas/prelaunch-report.schema.json +107 -0
- package/src/scripts/schemas/skill.schema.json +18 -1
- package/src/scripts/schemas/subagent.schema.json +6 -0
- package/src/scripts/skill_linter.ts +43 -3
- package/src/scripts/smoke_host_loadability.sh +73 -0
- package/src/scripts/team_review_gate_hook.ts +115 -0
- package/src/scripts/trigger_eval_grandfather.json +1 -2
- package/src/scripts/utilization_report.ts +225 -0
- package/src/server/schemas/settings.ts +25 -0
package/docs/getting-started.md
CHANGED
|
@@ -174,7 +174,48 @@ Your agent now understands slash commands:
|
|
|
174
174
|
| `/fix quality` | Run and fix all quality checks |
|
|
175
175
|
| `/chat-history import` | Pull a prior session into the current chat (resume) |
|
|
176
176
|
|
|
177
|
-
→ [Browse all
|
|
177
|
+
→ [Browse all 183 active commands](../dist/agent-src/commands/)
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Team mode — cross-model review (default off)
|
|
182
|
+
|
|
183
|
+
Team mode is a governed access layer with a read-only multi-host
|
|
184
|
+
fallback: a second strong model reviews the **real diff** in your
|
|
185
|
+
working tree and returns its findings. It is the depth complement to the
|
|
186
|
+
[AI council](../dist/agent-src/skills/ai-council/SKILL.md): the council
|
|
187
|
+
collects many cheap, neutral opinions on an artefact's *text*; team mode
|
|
188
|
+
puts one strong, opinionated reviewer *inside the repo*. An iterated
|
|
189
|
+
build→review→fix loop is gated future work — it unlocks only with a
|
|
190
|
+
positive verdict from the pre-registered benchmark.
|
|
191
|
+
|
|
192
|
+
| Axis | Council | Team mode |
|
|
193
|
+
|---|---|---|
|
|
194
|
+
| Repo access | none — members see only the artefact text | full — the reviewer reads the real diff and git state |
|
|
195
|
+
| Shape | breadth — N neutral opinions, one round | depth — one strong reviewer on the real diff |
|
|
196
|
+
| Cost model | API-billed members (per-token) | subscription-authed `codex` CLI (runs under your existing plan) |
|
|
197
|
+
|
|
198
|
+
**Host support.** Only Claude Code with the Codex plugin gets the native
|
|
199
|
+
path; every other host runs a reduced, read-only fallback — no host
|
|
200
|
+
outside Claude Code has feature parity.
|
|
201
|
+
|
|
202
|
+
| Host | Path | Capability |
|
|
203
|
+
|---|---|---|
|
|
204
|
+
| Claude Code + Codex plugin | native — wrappers delegate to the plugin's `/codex:*` commands | full wrapper set: review, adversarial, status (incl. plugin job view), delegate (double-opt-in write path) |
|
|
205
|
+
| Any other host | read-only fallback via the `codex` CLI (repo-diff bundle) | review-shaped output only — no plugin job control, no background jobs, no delegate write path |
|
|
206
|
+
|
|
207
|
+
**Setup.** Run `agent-config doctor --check team` — it verifies the
|
|
208
|
+
`codex` binary + auth and, on Claude Code hosts, the Codex plugin, and
|
|
209
|
+
prints the exact remediation command for anything missing.
|
|
210
|
+
|
|
211
|
+
**Default off.** Team mode ships disabled (`ai_team.enabled: false` in
|
|
212
|
+
`.agent-settings.yml`); no team command runs and no cross-model call is
|
|
213
|
+
made until you opt in.
|
|
214
|
+
|
|
215
|
+
**No lift claim.** Whether cross-model team review catches more real
|
|
216
|
+
defects than single-model adversarial self-review is **unproven** — the
|
|
217
|
+
package makes no review-quality claim until the pre-registered benchmark
|
|
218
|
+
has run and its verdict is recorded.
|
|
178
219
|
|
|
179
220
|
---
|
|
180
221
|
|
|
@@ -33,7 +33,7 @@ the host lacks (a static host gives it no runtime attention guarantee, but a
|
|
|
33
33
|
runtime-only system gives it nothing at all here). A runtime-only system contributes *nothing* on these hosts.
|
|
34
34
|
|
|
35
35
|
### 2. Intent routing, not a 500-artefact dump
|
|
36
|
-
A prompt does not load all
|
|
36
|
+
A prompt does not load all 274 skills. `dist/router.json` (100 routed rules, intent →
|
|
37
37
|
skill, keyword/phrase/path triggers) carries the right skill on intent. The
|
|
38
38
|
governance value is *selection discipline* — the host gets the relevant rule
|
|
39
39
|
set, not the whole catalogue as context ballast.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Active Remediation — Mechanics
|
|
2
|
+
|
|
3
|
+
> Ladder detail, version-gated modernization, and anti-nagging guardrails for the `active-remediation` rule
|
|
4
|
+
|
|
5
|
+
_Origin: migrated from `src/rules/active-remediation.md` per the P4 pattern of `road-to-kernel-and-router.md`. The Iron Law, the ladder tier names, and the live-security carve-out stay in the rule; this file carries the per-tier criteria and the modernization gates._
|
|
6
|
+
|
|
7
|
+
## The ladder — classify, then act
|
|
8
|
+
|
|
9
|
+
### Fix now (autonomous, inline) — a bounded amendment to `minimal-safe-diff`
|
|
10
|
+
|
|
11
|
+
Allowed **only** when ALL hold — this is the testable "small + task-aligned" definition:
|
|
12
|
+
|
|
13
|
+
- **Same request path / module** as the current task (not an unrelated feature).
|
|
14
|
+
- **≤ ~10 changed lines** in one production file plus its test file — no wider cross-file ripple.
|
|
15
|
+
- **No public-API / response-shape change**, no new parameter.
|
|
16
|
+
- **No dependency bump, no migration, no data change.**
|
|
17
|
+
- **Its verification ships in the same commit** — e.g. the security fix's negative test, or the correctness fix's case.
|
|
18
|
+
|
|
19
|
+
Under those constraints the fix is auditable in the same diff and is *not* scope creep — it corrects a boundary the agent touched. Anything outside them → the fix is **note + ask**, never auto. (`minimal-safe-diff` still governs everything else: no reformatting, no opportunistic refactor, no drive-by rename.)
|
|
20
|
+
|
|
21
|
+
### Note + ask (batched)
|
|
22
|
+
|
|
23
|
+
Bigger, or diverges from the task → do **not** refactor inline, do **not** interrupt the flow. Note the site (file:line + the issue). Surface the batch as **one** numbered-options prompt (per `user-interaction`, one recommendation line) **after the task is delivered** — or mid-work only when the flow makes it natural. Each option must carry a real trade-off (`no-cheap-questions`). Refactor only on an explicit yes, as a separate scoped change (`scope-control`, `downstream-changes`).
|
|
24
|
+
|
|
25
|
+
### Propose a follow-up PR (many spots)
|
|
26
|
+
|
|
27
|
+
When the issues are too many to fold in without blowing the current diff's scope, propose **one or more separate follow-up PRs** (or a roadmap under `agents/roadmaps/`, using the shared-prefix convention) so the user reviews the changes before merge. Creating the PR/roadmap is **permission-gated** — propose, get a yes, then create (`scope-control`, `commit-policy`).
|
|
28
|
+
|
|
29
|
+
## Version-gated modernization
|
|
30
|
+
|
|
31
|
+
Update stale idioms to the version the project **actually runs** — but only when that version is **verified**:
|
|
32
|
+
|
|
33
|
+
- **Establish the version first** from the manifest constraint (`composer.json` `require`, `package.json` `engines`, `.tool-versions`, lockfile) — use the **lowest** bound; on an ambiguous/monorepo range, ask once. **Unknown version → do not touch** (must fit the project structure — this is the `source-discovery` gate).
|
|
34
|
+
- **Syntax-only, behavior-preserving idioms** (e.g. `array()` → `[]`, `isset($x)?$x:$d` → `$x ?? $d`, string concat → template) that are provably equivalent → treat as a small fix (auto per the ladder).
|
|
35
|
+
- **Behavioral changes** (`readonly`/typed properties, new language semantics) and **any dependency/version bump** → **ask only**, never auto (a version bump stays under `minimal-safe-diff`'s no-dependency-bump prohibition; a pure syntax idiom is categorically different).
|
|
36
|
+
|
|
37
|
+
## Guardrails — don't become a nagging machine
|
|
38
|
+
|
|
39
|
+
- Subordinate to `no-cheap-questions` (self-check items 3 & 14 — real trade-off, not a disguised continuation/commit ask), `autonomous-execution` (the end-of-session batch must not read as "shall I continue?"), `user-interaction`, `ask-when-uncertain` (one batched prompt = one question).
|
|
40
|
+
- Threshold to surface at all: a **real, nameable** improvement with a concrete benefit. Cosmetic nitpicks with no trade-off → drop silently. The live-security carve-out is the only case that interrupts or overrides autonomy.
|
|
41
|
+
|
|
42
|
+
## See also
|
|
43
|
+
|
|
44
|
+
- [`active-remediation`](../../../src/rules/active-remediation.md) — the rule this file details (Iron Law + ladder + live-security carve-out).
|
|
45
|
+
- [`minimal-safe-diff`](minimal-safe-diff-mechanics.md) — the diff-shape mechanics the fix-now tier amends.
|
|
@@ -101,6 +101,34 @@ _Origin: migrated from `src/rules/improve-before-implement.md` per the P4 patter
|
|
|
101
101
|
|
|
102
102
|
Before coding a new feature, refactor, module, or behavior-altering change, quickly verify:
|
|
103
103
|
|
|
104
|
+
### 8-pre. Demand gate — should this exist at all? (build / defer)
|
|
105
|
+
|
|
106
|
+
One altitude ABOVE engineering-fit. Fires on a "build me an app / add this
|
|
107
|
+
feature" ask, before checks 8a–8c. It is a three-question advisor, NOT a
|
|
108
|
+
product-management framework — surface it in one short block, then proceed on
|
|
109
|
+
the user's answer (never block; `improve-before-implement`'s golden rule holds).
|
|
110
|
+
|
|
111
|
+
Three questions:
|
|
112
|
+
|
|
113
|
+
1. **Who requested this?** (a real user / segment, or an internal hunch?)
|
|
114
|
+
2. **What happens if you DON'T build it?** (churn / blocked deal, or nothing measurable?)
|
|
115
|
+
3. **What's the demand evidence?** (requests, usage data, lost revenue — or a feeling?)
|
|
116
|
+
|
|
117
|
+
Map the answers to a compressed feature-demand hierarchy and recommend:
|
|
118
|
+
|
|
119
|
+
| Level | Signal | Recommendation |
|
|
120
|
+
|---|---|---|
|
|
121
|
+
| L0 | Founder/agent anxiety — "it feels missing" | **Defer** — validate demand first |
|
|
122
|
+
| L1 | One anecdotal request, no pattern | **Defer** — watch for repetition |
|
|
123
|
+
| L2 | Repeated requests, no measured impact | **Validate** — instrument before building |
|
|
124
|
+
| L3 | Blocks activation/retention for a real segment | **Build** |
|
|
125
|
+
| L4 | Users are churning / deals lost without it | **Build now** |
|
|
126
|
+
|
|
127
|
+
Build only at **L3–L4**; L0–L2 get a defer/validate recommendation with the
|
|
128
|
+
one missing evidence named. This is advisory — the user decides; a "just build
|
|
129
|
+
it" answer proceeds immediately to 8a. No network, no case-memory API (the
|
|
130
|
+
source's remote lookup is dropped — a lethal-trifecta egress concern).
|
|
131
|
+
|
|
104
132
|
### 8a. Is the request clear?
|
|
105
133
|
|
|
106
134
|
- Are acceptance criteria defined or derivable?
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Artifact Drafting Protocol — Mechanics
|
|
2
|
+
|
|
3
|
+
> Phase A/B/C detail and the roadmap batch-mode carve-out for the `artifact-drafting-protocol` rule
|
|
4
|
+
|
|
5
|
+
_Origin: migrated from `src/rules/artifact-drafting-protocol.md` per the P4 pattern of `road-to-kernel-and-router.md`. The Iron Law, the trigger surface, and the golden rules stay in the rule; this file carries the per-phase procedure._
|
|
6
|
+
|
|
7
|
+
## Phase A — Understand
|
|
8
|
+
|
|
9
|
+
Ask up to **5** clarifying questions (numbered options, each with a
|
|
10
|
+
*"skip / I don't know yet"* escape):
|
|
11
|
+
|
|
12
|
+
1. **Problem** — what does this solve that no existing artifact solves?
|
|
13
|
+
2. **Trigger surface** — which user phrasings should fire this?
|
|
14
|
+
3. **Should-trigger examples** — 2-3 in the user's words.
|
|
15
|
+
4. **Near-miss cases** — 2-3 phrasings that must **not** fire.
|
|
16
|
+
5. **Artifact type** — skill, rule, command, or guideline? Offer a
|
|
17
|
+
3-line primer if unsure.
|
|
18
|
+
|
|
19
|
+
If the user skips Q1 or Q5, stop and surface the ambiguity — don't guess.
|
|
20
|
+
|
|
21
|
+
## Phase B — Research
|
|
22
|
+
|
|
23
|
+
Run the **search protocol** from
|
|
24
|
+
[`learning-to-rule-or-skill` § 4](../../../src/skills/learning-to-rule-or-skill/SKILL.md)
|
|
25
|
+
— `ls` all four surfaces (`skills/`, `rules/`, `guidelines/`, `commands/`),
|
|
26
|
+
grep with **solution-words AND problem-words**, scan sub-directory
|
|
27
|
+
taxonomies, then **open and skim** the 3 nearest matches. A negative grep
|
|
28
|
+
alone is not proof of no overlap. Report the top 3-5 most-similar
|
|
29
|
+
artifacts and ask (numbered options):
|
|
30
|
+
|
|
31
|
+
- Extend an existing one?
|
|
32
|
+
- Create a new one — gap is real?
|
|
33
|
+
- Show overlap first?
|
|
34
|
+
- Promote via `learning-to-rule-or-skill` instead?
|
|
35
|
+
|
|
36
|
+
Carry the summary into the commit message (*"Reviewed before drafting:
|
|
37
|
+
X, Y"*).
|
|
38
|
+
|
|
39
|
+
## Phase C — Draft
|
|
40
|
+
|
|
41
|
+
Propose **2-3 description variants** — Conservative / Pushy
|
|
42
|
+
(per `skill-quality`) / Concrete (embedded trigger example). User picks
|
|
43
|
+
or merges. Only then draft the body. Surface every structural choice
|
|
44
|
+
(size class, section order) as numbered options if in doubt.
|
|
45
|
+
|
|
46
|
+
Enforce size live: *"Body is at 420/500 lines. Split?"* (budgets per
|
|
47
|
+
`size-enforcement`). New skills also get an `evals/triggers.json` stub
|
|
48
|
+
(5 should-trigger + 5 should-not-trigger). See `skill-writing` § 1c.
|
|
49
|
+
|
|
50
|
+
## Roadmap-run batch mode — the ONE structured bypass
|
|
51
|
+
|
|
52
|
+
When a `/roadmap:process-*` run starts under an **accepted execution
|
|
53
|
+
contract** (`roadmap-execution-contract`) whose pre-scan detected
|
|
54
|
+
artifact-authoring steps, the protocol runs in batch mode for exactly
|
|
55
|
+
those artifacts:
|
|
56
|
+
|
|
57
|
+
- **Phase B (Research) runs ONCE at contract time, against the CURRENT
|
|
58
|
+
artifact state** — one overlap scan covering every artifact the
|
|
59
|
+
roadmap plans; results (nearest matches, extend-vs-create verdicts)
|
|
60
|
+
are surfaced inside the contract summary the user accepts. This is
|
|
61
|
+
why authoring-time-only checking is not enough: a sibling roadmap may
|
|
62
|
+
have landed overlapping artifacts between authoring and execution.
|
|
63
|
+
- **Phases A (Understand) and C (Draft) run non-interactively during
|
|
64
|
+
the run** — the roadmap step text is the Understand input; the
|
|
65
|
+
contract acceptance is the approval that the per-phase prompts exist
|
|
66
|
+
to obtain.
|
|
67
|
+
- **Scope is the batch, nothing more.** An artifact NOT declared in the
|
|
68
|
+
roadmap (discovered mid-run) triggers the full interactive protocol —
|
|
69
|
+
or, under the contract, the scope-out-of-roadmap halt.
|
|
70
|
+
- Batch mode never skips the Research pass itself — it relocates and
|
|
71
|
+
batches it. `artifact_protocol: skip` does not exist.
|
|
72
|
+
|
|
73
|
+
## See also
|
|
74
|
+
|
|
75
|
+
- `artifact-drafting-protocol` (rule) — Iron Law, triggers, golden rules.
|
|
76
|
+
- `ask-when-uncertain` · `improve-before-implement` · `user-interaction` · `skill-quality` — the protocol extends these; cross-link, don't restate.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Context Hygiene — Mechanics
|
|
2
|
+
|
|
3
|
+
> Suggestion templates, state-dump format, read-loop self-checks, and host fallbacks for the `context-hygiene` rule
|
|
4
|
+
|
|
5
|
+
_Origin: migrated from `src/rules/context-hygiene.md` per the P4 pattern of `road-to-kernel-and-router.md`. The freshness thresholds, the 3-failure rule (with failure-identity and hard-blocker classes), the tool-loop cap, and the read-loop 15/25 Iron Law stay in the rule; this file carries the templates and per-host procedures._
|
|
6
|
+
|
|
7
|
+
## Conversation-freshness suggestion — how to phrase it
|
|
8
|
+
|
|
9
|
+
Estimate token cost: responses × ~1,500 tokens.
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
> ⚡ This conversation has ~{N} messages (~{N×1500} tokens history cost — charged on EVERY request).
|
|
13
|
+
> A fresh chat saves ~{N×1500} input tokens per request.
|
|
14
|
+
>
|
|
15
|
+
> 1. Start fresh — I'll initiate a session handoff
|
|
16
|
+
> 2. Continue here
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**If the user picks 1:** Initiate a session handoff or start fresh.
|
|
20
|
+
|
|
21
|
+
## Read-loop self-check (fires at the 15-min warning)
|
|
22
|
+
|
|
23
|
+
1. Source expectation known? If no → read **once**, then act.
|
|
24
|
+
2. Can a single failing test name the error? If yes → run it now.
|
|
25
|
+
3. Regression in working code? → `git log` + `git show <sha> -- <file>`.
|
|
26
|
+
4. Guessing at mock / payload shape? → read the producer **once**.
|
|
27
|
+
|
|
28
|
+
## Read-loop abort block (the 25-min stop)
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
> ⛔ Loop: N read-only turns, ~M min. Read: <files>. Hypothesis: <X>.
|
|
32
|
+
> 1. Different approach (suggestion: <Y>)
|
|
33
|
+
> 2. Point me at the right spot
|
|
34
|
+
> 3. Fresh chat with state dump
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Non-bypassable. An autonomous mandate (`/work`, `/roadmap:process-*`,
|
|
38
|
+
"entscheide selbst") does **not** lift the abort — it is the safety
|
|
39
|
+
net that protects autonomy from becoming a token sink.
|
|
40
|
+
|
|
41
|
+
Debug procedure for "I'm in a read loop fixing tests" →
|
|
42
|
+
`systematic-debugging` § Debug micro-loop (one test, one fix, one re-run).
|
|
43
|
+
|
|
44
|
+
## State dump format
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
## State Dump: [Task]
|
|
48
|
+
### Tried: 1. [Approach] → [Why failed] 2. ... 3. ...
|
|
49
|
+
### Known: [Key facts]
|
|
50
|
+
### Hypothesis: [Best guess for root cause]
|
|
51
|
+
### Recommendation: [Next approach for fresh session]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Use `/agent-handoff` to generate a context summary for a fresh conversation.
|
|
55
|
+
|
|
56
|
+
## Augment-specific: ignored-skills recovery
|
|
57
|
+
|
|
58
|
+
Skills excluded via `.augmentignore` don't appear in `<available_skills>`.
|
|
59
|
+
If you need an ignored skill: read its SKILL.md directly, apply guidance, then ask:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
> 💡 I loaded `{name}` manually — currently ignored in `.augmentignore`.
|
|
63
|
+
> 1. Remove from ignore — relevant for this project
|
|
64
|
+
> 2. Keep ignored — one-off
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Copilot fallback
|
|
68
|
+
|
|
69
|
+
GitHub Copilot has no `PostToolUse` hook surface, so
|
|
70
|
+
`scripts/context_hygiene_hook.ts` cannot run structurally and
|
|
71
|
+
`agents/runtime/state/context-hygiene.json` is not maintained automatically
|
|
72
|
+
(turn count, loop signal, freshness milestones at 20/40/60).
|
|
73
|
+
|
|
74
|
+
The cooperative path: track turns and tool-loop signals from memory
|
|
75
|
+
during the conversation and apply the suggest-a-new-chat / 3-failure
|
|
76
|
+
stop / loop-detection rules. To refresh the state file manually so the
|
|
77
|
+
dashboard or another tool can read the latest counters, run:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
./scripts-run src/scripts/context_hygiene_hook < /dev/null
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The script reads from stdin if a JSON envelope is provided and
|
|
84
|
+
otherwise writes a no-op snapshot under the shared dispatcher lock.
|
|
85
|
+
Exit code is always 0 — hooks must never block the agent loop.
|
|
86
|
+
|
|
87
|
+
## See also
|
|
88
|
+
|
|
89
|
+
- `context-hygiene` (rule) — thresholds, 3-failure rule, tool-loop cap, read-loop Iron Law.
|
|
90
|
+
- `systematic-debugging` § Debug micro-loop — the one-test-one-fix-one-rerun procedure.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Domain Adoption — Gates
|
|
2
|
+
|
|
3
|
+
> The three-gate evidence contract, sunset policy, and failure-mode catalog for the `domain-adoption-policy` rule
|
|
4
|
+
|
|
5
|
+
_Origin: migrated from `src/rules/domain-adoption-policy.md` per the P4 pattern of `road-to-kernel-and-router.md`. The Iron Law and the three gate names stay in the rule; this file carries the per-gate evidence bars and procedures._
|
|
6
|
+
|
|
7
|
+
## Gate 1 — Demand signal
|
|
8
|
+
|
|
9
|
+
At least one of the following must be **true and citeable** in the roadmap:
|
|
10
|
+
|
|
11
|
+
- **≥ 2 consumer projects** in the domain. Cite repository names or
|
|
12
|
+
`agents/settings/contexts/` notes — not "I think there might be".
|
|
13
|
+
- **Named user direction with target.** A specific user ask plus a target
|
|
14
|
+
project / use case — e.g. "harvest the mobile skills for project X, due
|
|
15
|
+
next quarter". Vague *"this might be useful"* does not count.
|
|
16
|
+
- **Public-incident pull.** A reproducible incident on a consumer project
|
|
17
|
+
the domain would have prevented, captured in `agents/settings/contexts/` with
|
|
18
|
+
the missing surface area named.
|
|
19
|
+
|
|
20
|
+
If none of the three is citeable, **defer**. Open a watch-only context note
|
|
21
|
+
under `agents/settings/contexts/domain-watch/<domain>.md` listing the missing signal
|
|
22
|
+
so the next harvest can re-evaluate without re-relitigating the case.
|
|
23
|
+
|
|
24
|
+
## Gate 2 — Named maintenance owner
|
|
25
|
+
|
|
26
|
+
Domain plates rot. Pick the owner before the import, not after.
|
|
27
|
+
|
|
28
|
+
- The roadmap names a **single maintainer** (not "the team", not "TBD")
|
|
29
|
+
responsible for the domain quarterly review.
|
|
30
|
+
- The owner commits to the **refresh cadence** — quarterly review at
|
|
31
|
+
minimum, faster if the domain is volatile (mobile RN/Expo SDK,
|
|
32
|
+
ML model APIs).
|
|
33
|
+
- Each adopted artefact carries an **inline upstream-source line** with
|
|
34
|
+
SHA + last-checked timestamp so refresh is mechanical, not archaeological.
|
|
35
|
+
|
|
36
|
+
If no owner is named or no cadence is set, **defer**. An unowned domain
|
|
37
|
+
plate becomes broken authoritative-links and stale skills inside two cycles.
|
|
38
|
+
|
|
39
|
+
## Gate 3 — CI-tooling decision
|
|
40
|
+
|
|
41
|
+
Either the domain's verification tooling is validated in CI, or the suite
|
|
42
|
+
explicitly accepts platform-bound reference-only status.
|
|
43
|
+
|
|
44
|
+
- **Validated.** The CI pipeline runs the relevant linters/tests/integration
|
|
45
|
+
checks for the domain (e.g. `mobile-e2e` runners, ML model validation,
|
|
46
|
+
contract conformance) on every PR. Cost noted in the roadmap risk
|
|
47
|
+
register.
|
|
48
|
+
- **Out-of-scope (reference-only).** The domain is a platform fact the
|
|
49
|
+
suite cannot validate (iOS Simulator on non-macOS runners, GPU-bound
|
|
50
|
+
ML, hardware-bound IoT). The roadmap states this explicitly; affected
|
|
51
|
+
artefacts carry a "reference-only on \<unsupported platforms\>" header
|
|
52
|
+
so consumers do not file false-positive bugs.
|
|
53
|
+
|
|
54
|
+
If neither line is drawn, **defer**. Half-validated CI silently rots the
|
|
55
|
+
domain — green builds while the underlying tooling drifts.
|
|
56
|
+
|
|
57
|
+
## Sunset Policy stacks on top
|
|
58
|
+
|
|
59
|
+
Every domain track inherits the authoritative-link Sunset path documented
|
|
60
|
+
in any plate that imports volatile upstream content:
|
|
61
|
+
|
|
62
|
+
- Volatile content (SDK-pinned, API-pinned, tool-version-pinned) lives as
|
|
63
|
+
guideline body + SHA-pinned upstream link, not as forked scripts.
|
|
64
|
+
- Refresh trigger: quarterly cadence or earlier if a SHA-pinned link
|
|
65
|
+
404s in CI.
|
|
66
|
+
- The `check-refs` and `check-portability` linters apply unchanged.
|
|
67
|
+
|
|
68
|
+
Adopting a domain does not exempt it from any other suite-wide rule —
|
|
69
|
+
`augment-edit-discipline`, `skill-quality`, `size-enforcement`,
|
|
70
|
+
`rule-type-governance`. Every domain artefact passes the same gates as a
|
|
71
|
+
core artefact.
|
|
72
|
+
|
|
73
|
+
## Failure modes
|
|
74
|
+
|
|
75
|
+
- *"It's just one skill, not a domain."* — Audit the skill's prerequisites.
|
|
76
|
+
If it pulls in a new toolchain, simulator, language runtime, or
|
|
77
|
+
platform-specific build system, it **is** a domain entry. Run the gates.
|
|
78
|
+
- *"The upstream is well-maintained, we can just track it."* — Tracking
|
|
79
|
+
upstream means owning the diff, the breaking changes, and the migrations.
|
|
80
|
+
Tracking is maintenance work; budget for it under Gate 2 or skip the
|
|
81
|
+
adoption.
|
|
82
|
+
- *"We'll add CI later."* — Later does not arrive. Either CI is wired in
|
|
83
|
+
the same plate, or the artefacts ship with explicit reference-only
|
|
84
|
+
headers so users do not assume validated coverage.
|
|
85
|
+
- *"Council convergence is enough."* — Council informs the gates; it does
|
|
86
|
+
not replace them. A council session may surface that all three gates
|
|
87
|
+
pass; the roadmap still cites the evidence.
|
|
88
|
+
- *"Demand-signal is the user asking once."* — Single-shot interest is a
|
|
89
|
+
watch trigger, not an open trigger. Either name the target use case
|
|
90
|
+
with project + timeline, or open a watch note and wait.
|
|
91
|
+
|
|
92
|
+
## What to do when the gates fail
|
|
93
|
+
|
|
94
|
+
1. Mark the domain plate `[-] gated — <gate name> not met` in the relevant
|
|
95
|
+
roadmap. Do **not** silently shrink scope to dodge the gate.
|
|
96
|
+
2. Open a watch-only context note under `agents/settings/contexts/domain-watch/`
|
|
97
|
+
capturing what's missing — citations, owner candidates, CI feasibility.
|
|
98
|
+
3. Re-evaluate at the next harvest cycle. The note is the evidence trail
|
|
99
|
+
so the same questions are not relitigated.
|
|
100
|
+
|
|
101
|
+
## Allowed without gates
|
|
102
|
+
|
|
103
|
+
- Adding **a single skill** to an **already-opened** domain follows the
|
|
104
|
+
regular harvest plate; the gates do not re-fire per skill.
|
|
105
|
+
- Authoring a **guideline** that documents a domain the suite already
|
|
106
|
+
ships in — the domain is open, the guideline is a within-domain artefact.
|
|
107
|
+
- A **rule** that constrains an already-opened domain — within-domain.
|
|
108
|
+
|
|
109
|
+
## See also
|
|
110
|
+
|
|
111
|
+
- `domain-adoption-policy` (rule) — the Iron Law + gate names.
|
|
112
|
+
- `size-enforcement` · `rule-type-governance` · `skill-quality` — the suite-wide floors every domain artefact still passes.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Framework Neutrality — Patterns
|
|
2
|
+
|
|
3
|
+
> Forbidden-pattern table, cross-stack documentation allowance, and carve-out pointer shape for the `framework-neutrality-in-generic-skills` rule
|
|
4
|
+
|
|
5
|
+
_Origin: migrated from `src/rules/framework-neutrality-in-generic-skills.md` per the P4 pattern of `road-to-kernel-and-router.md`. The Iron Law, scope, and exemption list stay in the rule; this file carries the pattern reference._
|
|
6
|
+
|
|
7
|
+
## Forbidden patterns in generic artifacts
|
|
8
|
+
|
|
9
|
+
| Pattern | Why it leaks | Fix |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| `FormRequest` as a mandate | Laravel-only validation class | Say "request-validation primitive (FormRequest in Laravel, zod in Next.js, pydantic in FastAPI)" or move to `laravel-validation` carve-out |
|
|
12
|
+
| `php artisan …` as a canonical command | Laravel CLI | Generalize to "the framework's CLI" or move to `artisan-commands` carve-out |
|
|
13
|
+
| `PHPStan` as the only example | PHP-only static analyser | List peers (`mypy` for Python, `tsc` for TypeScript) or move to `quality-tools` carve-out |
|
|
14
|
+
| `composer.json` mentioned alone | PHP package manifest | Add `package.json` / `pyproject.toml` peers, or move to a PHP-scoped carve-out |
|
|
15
|
+
| `Eloquent` / `Model::…` | Laravel ORM | Generalize to "the project's ORM/data layer" or move to `eloquent` carve-out |
|
|
16
|
+
| `Pest` as the only test runner | PHP/Laravel test framework | List peers (`pytest`, `vitest`, `jest`) or move to `pest-testing` carve-out |
|
|
17
|
+
| `Blade` / `Livewire` / `Flux` as default UI | Laravel view stack | Generalize to "the project's UI layer" or move to `blade-ui` / `livewire` / `flux` carve-outs |
|
|
18
|
+
| `vendor/bin/<tool>` as a canonical path | PHP/Composer-specific binary path | Say "the project's quality CLI" or carve-out it |
|
|
19
|
+
| `Rector` as the only refactor tool | PHP-only refactorer | List peers (`ts-morph`, `libcst`) or carve-out it |
|
|
20
|
+
| "every controller" / "all controllers" | Assumes MVC PHP framework | Generalize to "every request handler" / "every endpoint" |
|
|
21
|
+
|
|
22
|
+
## Allowed: cross-stack documentation
|
|
23
|
+
|
|
24
|
+
Multi-stack tables or detection maps with **at least two ecosystems
|
|
25
|
+
side-by-side** are documentation, not leakage. The linter's
|
|
26
|
+
auto-detect heuristic skips a hit when its ±2-line window contains
|
|
27
|
+
patterns from a different ecosystem family (`php_family` vs
|
|
28
|
+
`js_family` vs `python_family`).
|
|
29
|
+
|
|
30
|
+
Example (allowed):
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
- PHP/Composer project → `composer.json` present
|
|
34
|
+
- Node project → `package.json` present
|
|
35
|
+
- Python project → `pyproject.toml` present
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Allowed: carve-out pointers
|
|
39
|
+
|
|
40
|
+
A generic artifact may end a section with a one-line handoff to its
|
|
41
|
+
framework-specific peers. Canonical shape:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
→ Laravel-specific: see [laravel-validation](../skills/laravel-validation/SKILL.md)
|
|
45
|
+
→ Next.js-specific: see [nextjs-patterns](../skills/nextjs-patterns/SKILL.md)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The pointer is a link, not a procedure — the generic artifact never
|
|
49
|
+
inlines stack-specific code.
|
|
50
|
+
|
|
51
|
+
## Enforcement
|
|
52
|
+
|
|
53
|
+
`scripts/lint_framework_leakage.ts` runs in the package CI pipeline.
|
|
54
|
+
Exit codes:
|
|
55
|
+
|
|
56
|
+
- `0` — no hits, or every hit is auto-detected as cross-stack, or
|
|
57
|
+
every hit is allowlisted in
|
|
58
|
+
`scripts/lint_framework_leakage_allowlist.json` with a `reason`.
|
|
59
|
+
- `1` — at least one hit in a generic artifact (non-carve-out) that
|
|
60
|
+
is neither cross-stack nor allowlisted.
|
|
61
|
+
|
|
62
|
+
## See also
|
|
63
|
+
|
|
64
|
+
- `framework-neutrality-in-generic-skills` (rule) — Iron Law, scope, exemption list.
|
|
65
|
+
- `roadmap-ci-steps-policy` — sibling Tier-2a rule that drove this pattern.
|
|
66
|
+
- `skill-quality` — every skill must remain executable; carve-outs must still pass skill-quality.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Minimal Safe Diff — Mechanics
|
|
2
|
+
|
|
3
|
+
> Anti-over-engineering criteria, larger-change guidance, break-glass exception, and the bounded remediation carve-out for the `minimal-safe-diff` rule
|
|
4
|
+
|
|
5
|
+
_Origin: migrated from `src/rules/minimal-safe-diff.md` per the P4 pattern of `road-to-kernel-and-router.md`. The Iron Law, "The rule", "Before writing the diff", the red-flags list, and "Own-orphan cleanup" (anchor-referenced by `downstream-changes`) stay in the rule; this file carries the worked criteria._
|
|
6
|
+
|
|
7
|
+
## When the task seems to require a larger change
|
|
8
|
+
|
|
9
|
+
- A rename, restructure, or framework upgrade that crosses the minimal-diff
|
|
10
|
+
line is a **separate, explicit** task — ask the user before expanding.
|
|
11
|
+
- A bug fix that exposes a broader design problem stays a bug fix. Log the
|
|
12
|
+
design problem as a follow-up (ticket, note, TODO) and ship the fix alone.
|
|
13
|
+
- A new feature that tempts you to "clean up" the module first: resist.
|
|
14
|
+
Add the feature, commit it, then propose the cleanup as a separate change.
|
|
15
|
+
|
|
16
|
+
## Auto-formatter or linter rewrites unrelated code
|
|
17
|
+
|
|
18
|
+
Revert those hunks before staging. The diff you present is the diff you own.
|
|
19
|
+
If project policy forbids partial formatting, split into two commits:
|
|
20
|
+
*format only* · *behavior change*.
|
|
21
|
+
|
|
22
|
+
## Anti-over-engineering
|
|
23
|
+
|
|
24
|
+
The smallest change is also the least *abstract* and least *speculative* one:
|
|
25
|
+
|
|
26
|
+
- **Three similar lines beat a premature abstraction.** Do not extract a helper
|
|
27
|
+
/ generic / config layer to dedupe two or three call sites — inline
|
|
28
|
+
repetition is cheaper to read and change than the wrong abstraction. Per new
|
|
29
|
+
abstraction: **cite the second caller — or inline it.**
|
|
30
|
+
- **No speculative features.** Nothing beyond what was asked: no
|
|
31
|
+
configurability or "flexibility" nobody requested, no parameters with one
|
|
32
|
+
call site, no error handling for scenarios that cannot occur in this
|
|
33
|
+
codebase.
|
|
34
|
+
- **The rewrite trigger.** If the change could be half the size without losing
|
|
35
|
+
behavior, rewrite before presenting. Self-check: *"Would a senior engineer
|
|
36
|
+
call this overcomplicated?"* — if yes, simplify.
|
|
37
|
+
- **No tombstones.** Delete removed code completely — no `_oldName` renames,
|
|
38
|
+
no `// removed X` / `// no longer used` markers, no dead re-export shims kept
|
|
39
|
+
"for safety". Git history is the tombstone.
|
|
40
|
+
- **No docstrings/comments on untouched code.** Do not annotate code the diff
|
|
41
|
+
does not change.
|
|
42
|
+
|
|
43
|
+
Wrong/right pairs for each ban:
|
|
44
|
+
[`simplicity-and-goal-demos`](simplicity-and-goal-demos.md)
|
|
45
|
+
— the demos are the recognition surface; match your diff against the *right*
|
|
46
|
+
column before presenting.
|
|
47
|
+
|
|
48
|
+
**Not adopted (council):** the source's "validate only at system boundaries /
|
|
49
|
+
trust internal code" clause is **rejected** — internal code can be wrong, and
|
|
50
|
+
"trust" is not a testing strategy. Keep validating internal invariants; this
|
|
51
|
+
fold is about *diff shape*, not about dropping internal checks.
|
|
52
|
+
|
|
53
|
+
## Break-glass exception
|
|
54
|
+
|
|
55
|
+
The rule stays in force during production incidents. "Break-glass mode"
|
|
56
|
+
narrows verification (see `verify-before-complete`) — it does **not**
|
|
57
|
+
license drive-by edits.
|
|
58
|
+
|
|
59
|
+
Allowed during break-glass:
|
|
60
|
+
|
|
61
|
+
- The **smallest** change that stops the bleeding — one file, one
|
|
62
|
+
method, one guard — preferred over any refactor.
|
|
63
|
+
- A fast revert to a known-good commit, even if it undoes unrelated
|
|
64
|
+
improvements shipped in the same PR.
|
|
65
|
+
|
|
66
|
+
Not allowed, even in break-glass:
|
|
67
|
+
|
|
68
|
+
- "While I'm in there" cleanups, reformatting, or dependency bumps.
|
|
69
|
+
- Expanding the fix to neighboring modules without evidence they are
|
|
70
|
+
part of the incident.
|
|
71
|
+
- Merging the hotfix with pending refactors from another branch.
|
|
72
|
+
|
|
73
|
+
After the incident, open a **follow-up PR** for any scope that was
|
|
74
|
+
intentionally deferred and reference the break-glass commit in its
|
|
75
|
+
description.
|
|
76
|
+
|
|
77
|
+
## Bounded remediation carve-out
|
|
78
|
+
|
|
79
|
+
The default stands: no drive-by edits, no opportunistic refactors. The one
|
|
80
|
+
bounded exception — a **small, task-aligned security/correctness fix in code
|
|
81
|
+
the current task already touches** — is governed by `active-remediation`
|
|
82
|
+
(mechanics: [`active-remediation-mechanics`](active-remediation-mechanics.md)).
|
|
83
|
+
It is permitted inline **only** when ALL hold: same request path / module,
|
|
84
|
+
≤ ~10 changed lines in one production file (plus its test file), no
|
|
85
|
+
public-API / response-shape change, no dependency bump or migration, and its
|
|
86
|
+
verification (e.g. the negative test) ships in the same commit. Anything
|
|
87
|
+
outside those five conditions is **not** this carve-out — it is note + ask
|
|
88
|
+
per `active-remediation`. This never licenses reformatting, renames,
|
|
89
|
+
dependency bumps, or version upgrades (a syntax-idiom modernization is
|
|
90
|
+
allowed only under `active-remediation`'s version-gated,
|
|
91
|
+
behavior-preserving clause; a dependency/version bump stays ask-only). The
|
|
92
|
+
sole case that may interrupt is a **live cross-user/tenant data exposure**
|
|
93
|
+
(`broken-access-control`) — fix-now-if-small, else stop and surface; never
|
|
94
|
+
defer it silently.
|
|
95
|
+
|
|
96
|
+
## See also
|
|
97
|
+
|
|
98
|
+
- `minimal-safe-diff` (rule) — Iron Law, the rule, pre-diff checklist, red flags, own-orphan cleanup.
|
|
99
|
+
- [`active-remediation-mechanics`](active-remediation-mechanics.md) — the fix-now / note+ask / follow-up-PR ladder detail.
|
|
@@ -17,6 +17,19 @@ Every skill must answer four questions. If ANY answer is weak, the skill is not
|
|
|
17
17
|
| 3 | How do I verify it worked? | `Procedure` (validation step) | Concrete checks, not "verify it works" |
|
|
18
18
|
| 4 | What common failure must I avoid? | `Gotcha` + `Do NOT` | Real failure patterns, not platitudes |
|
|
19
19
|
|
|
20
|
+
## Register — explain the trade-off, except in the safety kernel
|
|
21
|
+
|
|
22
|
+
Two registers, chosen by artifact class (U4, ecosystem harvest 2026-07-13):
|
|
23
|
+
|
|
24
|
+
- **Capability skills** (workflows, analyses, generators) **explain the
|
|
25
|
+
trade-off** — say *why* the recommended path beats the alternative instead of
|
|
26
|
+
shouting ALL-CAPS MUSTs; an agent that understands the why generalizes to
|
|
27
|
+
cases the skill never enumerated.
|
|
28
|
+
- **The safety kernel keeps its imperative Iron-Law register** — kernel rules,
|
|
29
|
+
safety floors (`*-safety-floor`), and Hard-Floor surfaces stay ALL-CAPS
|
|
30
|
+
fenced-law imperative, non-negotiable (`preservation-guard` enforces the
|
|
31
|
+
byte-level protection). Never downgrade an Iron Law to friendly prose.
|
|
32
|
+
|
|
20
33
|
## Required Sections
|
|
21
34
|
|
|
22
35
|
Every skill MUST have: `When to use`, `Procedure`, `Gotcha`, `Output format`, `Do NOT`.
|