Skip to main content
ClaudeWave
Skill482 estrellas del repoactualizado 3d ago

root-cause-remediation

Mandatory for every Nomi corrective change: user-reported bugs, regressions, CI-only failures, flaky tests, performance or security defects, review/audit findings, and compatibility failures in any production path. Classify one_off versus recurring before implementation. Recurring and high-risk repairs require a schema-v3 contract, shared enforcement boundary, structural prevention, dependency lifecycle decision, and changed regression evidence.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/aqm857886159/Nomi /tmp/root-cause-remediation && cp -r /tmp/root-cause-remediation/.agents/skills/root-cause-remediation ~/.claude/skills/root-cause-remediation
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# Root Cause Remediation

## Mission

Act as an investigator and system owner, not a patch author. Restore the missing invariant at the earliest shared boundary so the reported failure and every equivalent entry fail safely or succeed consistently. A green example is not success if another vendor, version, caller, platform, or stored value can reproduce the same class.

This skill is the detailed operating source for P2/R21. `CLAUDE.md` and generated `AGENTS.md` only carry the trigger; `scripts/root-cause-contracts.mjs` is the merge-time enforcement authority.

## Success Bar

A remediation is complete only when evidence connects all of these:

- the exact user-visible symptom and deterministic reproduction;
- the direct mechanism that failed;
- the class-wide missing invariant;
- every equivalent entry point found by repository search;
- one or more shared boundaries that enforce the invariant without exceptions;
- changed tests for both the reported case and the class boundary;
- removal or explicit non-applicability of obsolete paths;
- an explicit dependency upgrade/retention decision with exit criteria when a third-party runtime is involved;
- verification on the platform or build boundary that originally exposed the defect.

## Required Workflow

1. Reproduce the symptom with the smallest deterministic fixture. Preserve the failing output before editing production code.
2. Trace the complete path from user input through parsing, state/persistence, shared services, and the final request/write/decode boundary.
3. Separate `symptom`, `direct_cause`, and `class_root`. The class root is the missing invariant that explains why equivalent inputs or callers can fail, not the line that happened to throw.
4. Classify recurrence before implementation: `one_off` requires repository-wide evidence that no other user, input, entry, machine, or future run can reach the mechanism and no reusable invariant can prevent it; observed once is not evidence. Otherwise classify `recurring`.
5. Search the repository by data shape, contract, producer, and consumer. Record at least two independently checked same-class entry points; do not search only for the reported provider, version, model, or fixture name.
6. Identify the earliest shared boundary that can own the invariant. If callers do not converge, first consolidate ownership or define multiple explicit shared boundaries.
7. For third-party behavior, inspect current official documentation, source, installed versions, and platform/package drift. Choose `upgrade-now`, `retain-with-exit`, or `not-applicable`; retention requires a target and testable exit criteria.
8. Read `references/contract-v3.template.json`, then create or update a schema-v3 `docs/fixes/*.root-cause.json` before a recurring or high-risk production fix. Preserve the template's exact field names, object shapes, and enums; every changed high-risk production file must be covered by `scope_paths`.
9. Add the failing reported-case test and at least one class-level test. Run only this red slice before implementation.
10. For recurring repairs, enforce the invariant at the shared boundary and list changed structural code in `prevention.artifacts`. Delete obsolete behavior in the same change; tests, documentation, and fallback paths are not structural prevention.
11. Run the changed class tests and `pnpm run check:root-cause-contracts`. After the logical batch is stable, run the risk-selected repository validation once.

## Decision Rules

- Prefer schema/type/parser/normalization/persistence boundaries over caller-side conditionals.
- A platform or dependency version may explain the symptom, but it is not automatically the class root. Bind the application-level contract explicitly, then decide whether the dependency also needs an upgrade.
- Upgrade now when a supported target-aware package can replace the old runtime without weakening packaging, security, or cross-architecture guarantees.
- Retain with exit only when an application invariant safely spans current versions and the upgrade has concrete prerequisites, owner paths, and verification criteria.
- If migration cannot distinguish legacy user-authored behavior from generated behavior, fail visibly or require explicit regeneration; do not guess and silently rewrite.
- If the same class truly has one technical caller, enumerate different input populations or downstream consumers. A one-example scan does not establish generality.

## Forbidden Patch Shapes

- A vendor/model/version/platform branch when a shared role, type, schema, byte, lifecycle, or persistence boundary can own the rule.
- Swallowing an error, broadening a regex, increasing a timeout/retry count, or weakening validation without proving the underlying invariant.
- Changing only the failing fixture or mocking away the production boundary.
- Adding a new path while leaving the old path callable as a fallback.
- Calling a dependency old but neither upgrading it nor recording a target-aware exit plan.
- Listing vague entry points, nonexistent paths, unchanged tests, or prose that cannot be tied back to code.

## Contract v3 Review

Before implementation, confirm the contract contains:

- `generality_proof` explaining why the solution spans the class;
- `shared_boundaries` with real path, symbol, and responsibility;
- `same_class_entry_points` with path, entry, disposition, and evidence;
- `recurrence` with `one_off`/`recurring`, reason, and concrete repository scan evidence;
- recurring `prevention` with a supported mechanism, shared enforcement path, invariant, fail behavior, no exception policy, strategy, and changed structural artifacts;
- `class_regression_tests` that are also changed `regression_tests`;
- `legacy_paths` as `removed` or justified `not-applicable`;
- `dependency_lifecycle` as `not-applicable`, `upgrade-now`, or `retain-with-exit`.

The exact machine contract is `references/contract-v3.template.json`. In particular, use `same_class_entry_points[].entry_point`
docxSkill
plansSkill
brand.promoSkill

品牌宣传片 playbook。把产品文案/卖点做成一条「3 秒钩子 → 卖点 → 使用场景 → 行动号召」的短宣传片,分阶段执行(剧本审阅 → 拆镜 → 落画布 → 生成 → 排时间轴),每阶段暂停让用户审阅。

creation-editSkill

编辑创作区文档:读取当前内容,追加或替换文本,维护分镜描述格式。

director.actionSkill

非对抗性动作场景(跑酷/追逐/攀爬/特技/坠落)的动作编排知识——专业动作词汇、环境交互、动作节奏、FPV 追拍、身体力学约束、怎么把动作精确物理化地描述进视频提示词;Nomi 写动作戏 shot 时参考。

director.art-designSkill

服化道——设计「人物设定图」与「场景环境图」的生图提示词,含顶部「风格前缀块」(摄影机/胶片/调色/画幅等烧进画面的统一风格)+ 生图 avoid(多指/文字水印/穿帮等)+ identity DNA(角色跨图一致的关键特征锁定)。Nomi 为角色/场景等视觉 anchor(`carrier: visual`)生成参考图、写它的生图 prompt 时参考。

director.cinematographySkill

镜头语言与摄影技法方法论——统一景别体系/构图规则/运镜的情绪语言/打光方案/景深控制/色温光源/镜头特性,以及这些怎么翻译成视频提示词该怎么写。Nomi 拆镜头或写视频 shot 的 prompt 时参考。

director.consistencySkill

治 AI 视频多镜头「同角色换脸 / 同道具换形 / 同场景换景」三大顽疾的方法论——五维一致性检查、参考图锚定、场内状态表、段间承接。Nomi 拆镜头与跨镜生成时参考:把每个跨镜元素落成画布 anchor 节点(角色/场景/道具/风格),镜头用 anchorIds 引用、系统连参考边,段间用首尾帧承接。