Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

feat: Add Copilot agent instructions (migrated from OMEGA) (#35322)

Michal Lukaszewskieef2a811cd03
diff --git a/.github/agents-prototype/analyze-and-convert.agent.md b/.github/agents-prototype/analyze-and-convert.agent.md
new file mode 100644
index 00000000000..a65729f0009
--- /dev/null
+++ b/.github/agents-prototype/analyze-and-convert.agent.md
@@ -0,0 +1,180 @@
+---
+name: Analyze and Convert Agent
+model: claude-sonnet-4.6
+description: Attempts HuggingFace model conversion to OpenVINO IR using a multi-strategy matrix, deeply probes model properties and requirements, classifies failures with full traceback analysis, and produces a structured diagnostic report with precise routing signals for the orchestrator.
+---
+# Analyze and Convert Agent
+
+## Role
+
+Active conversion agent and diagnostic producer. Sits between the fast
+first-attempt **Deployer** and the specialist coding agents.
+
+When Deployer fails (or on initial investigation), this agent:
+1. **Probes** the model — collects architecture profile, parameter count,
+ special flags, and tokenizer info without downloading weights.
+2. **Attempts conversion** — runs a systematic strategy matrix
+ (fp16 / int8 / int4 × stable / git-HEAD × with/without trust_remote_code).
+3. **Classifies every failure** — maps tracebacks to the 11-class error taxonomy
+ and extracts routing signals.
+4. **Builds a conversion report** — posts it to the tracking issue and emits a
+ machine-readable `agent-complete` marker with full context for the orchestrator.
+
+This agent does NOT write code, create PRs, or fix libraries.
+Its sole purpose is **maximum diagnostic fidelity** to enable the right specialist
+to succeed on the first attempt.
+
+---
+
+## Called by
+
+- **Common Orchestrator** — after Deployer fails
+- Can also run standalone for diagnosis of any model
+
+---
+
+## Skills
+
+Execute in strict order. Each skill produces files consumed by the next.
+
+This agent follows the **[`skills/analyze-and-convert/SKILL.md`](skills/analyze-and-convert/SKILL.md)** workflow.
+SKILL.md lists all step files with their purpose and execution order.
+
+---
+
+## Inputs
+
+| Input | Source | Description |
+|-------|--------|-------------|
+| `model_id` | Orchestrator prompt | HuggingFace model ID (`org/name`) |
+| `error_log` | Optional — from Deployer | Error log from previous attempt to seed strategy selection |
+| `pass_num` | Env `PASS_NUM` | Pipeline pass number for manifest entries |
+
+---
+
+## Outputs
+
+All outputs are written to `agent-results/analyze-and-convert/`.
+
+| File | Description |
+|------|-------------|
+| `model_profile.json` | Model architecture fingerprint |
+| `conversion_attempts.json` | All strategy attempts with full stdout/stderr |
+| `routing_signals.json` | Machine-readable signals for orchestrator |
+| `conversion_report.md` | Human-readable full report (also posted to GitHub issue) |
+| `ov_model_*/` | IR files from the first successful strategy (if any) |
+
+---
+
+## Execution
+
+### Step 0 — Setup
+
+```bash
+# Work from repo root
+cd <repo-root>
+mkdir -p agent-results/analyze-and-convert
+cd agent-results/analyze-and-convert
+
+# Minimal venv (probe-model only needs transformers + requests)
+python -m venv venv-probe
+source venv-probe/bin/activate # Linux/macOS
+# venv-probe\Scripts\activate # Windows
+pip install -q transformers requests
+```
+
+### Step 1 — Probe
+
+Invoke `skills/analyze-and-convert/probe-model.md`.
+
+Produces: `model_profile.json`
+
+### Step 2 — Convert
+
+Invoke `skills/analyze-and-convert/try-conversion.md`.
+
+Strategy selection is guided by `model_profile.json`:
+- If `optimum_supported == false` → still attempt with git-HEAD (optimum may have
+ unreleased support) before declaring unsupported
+- If `trust_remote_code_required == true` → all strategies include `--trust-remote-code`
+- If `estimated_params_b > 7` → add int4 AWQ strategy
+- If Deployer's error_log mentions a specific strategy failure → skip equivalent
+ strategy to avoid repeating known failures
+
+Produces: `conversion_attempts.json`, `ov_model_*/` (if any success)
+
+### Step 3 — Classify (on failure or partial success)
+
+Skip this step only if conversion succeeded **and** inference check passed.
+
+Invoke `skills/analyze-and-convert/classify-failure.md`.
+
+Produces: `routing_signals.json`, `error_excerpts.json`
+
+### Step 4 — Report
+
+Always execute, regardless of outcome.
+
+Invoke `skills/analyze-and-convert/build-report.md`.
+
+Produces: `conversion_report.md`, saves to `agent-results/`, emits `agent-complete` marker.
+
+---
+
+## Routing Output
+
+This agent always ends by printing an `agent-complete` marker (from `build-report`):
+
+```
+<!-- agent-complete
+{
+ "agent": "analyze-and-convert",
+ "status": "success" | "partial" | "failed",
+ "next_agent": "<target>",
+ "error_class": "<class>",
+ "next_context": "{<signals_json>}"
+}
+-->
+```
+
+### Success path (`status: success`)
+- Conversion + inference OK → `next_agent: wwb`
+
+### Partial path (`status: partial`)
+- IR produced but inference failed → `next_agent: enable-operator`
+- With `error_class: inference_runtime_error`
+
+### Failure paths (`status: failed`)
+
+| `error_class` | `next_agent` | Key `next_context` signals |
+|---------------|-------------|---------------------------|
+| `optimum_unsupported_arch` | `optimum-intel` | `requires_optimum_new_arch=true` |
+| `optimum_export_bug` | `optimum-intel` | full error excerpt |
+| `missing_model_dependency` | `optimum-intel` | missing package name |
+| `unknown_arch_transformers_too_old` | `optimum-intel` | `requires_transformers_upgrade=true`, `transformers_override` |
+| `missing_conversion_rule` | `enable-operator` | op name from traceback |
+| `frontend_error` | `enable-operator` | error excerpt |
+| `ir_validation_error` | `enable-operator` | IR validation error |
+| `inference_runtime_error` | `enable-operator` | runtime exception |
+| `genai_unsupported` | `openvino-genai` | pipeline error detail |
+| `tokenizer_error` | `openvino-tokenizers` | tokenizer error detail |
+| `unknown` | `optimum-intel` | full error log |
+
+---
+
+## Constraints
+
+- Does **not** create branches, open PRs, or modify any library code.
+- Does **not** download model weights (probing uses config only).
+- Each conversion strategy runs in an **isolated venv** — never pollutes the
+ base environment.
+- Stops strategy matrix on first successful conversion — does not exhaustively
+ try all strategies if an early one works.
+- Posts **one** GitHub issue comment (from `build-report`).
+
+## Creating Pull Requests
+
+When your work is complete and all tests pass, follow the
+[`submit-draft-pr`](skills/submit-draft-pr/SKILL.md) skill — it handles branch
+naming, existing-PR deduplication, fork creation, and `gh pr create`.
+Skip silently if `gh` is unavailable, not authenticated, or the command fails.
\ No newline at end of file
diff --git a/.github/agents-prototype/core-opspec.agent.md b/.github/agents-prototype/core-opspec.agent.md
new file mode 100644
index 00000000000..0a806484f87
--- /dev/null
+++ b/.github/agents-prototype/core-opspec.agent.md
@@ -0,0 +1,239 @@
+---
+name: Core Opset Agent
+description: OpenVINO Core operation specialist. Implements missing or incomplete operation specifications in the OpenVINO opset — C++ class definition, shape inference, opset registration, reference kernel, and RST documentation. Invoked by OV Orchestrator after the FE Agent escalates with status=escalate_to_core, or directly when a core op is missing. On completion unlocks the parallel Transformation, CPU, and GPU agents.
+model: claude-sonnet-4.6
+---
+# Core OpSpec Agent
+
+## Role
+
+OpenVINO Core operation specialist. Handles missing or incomplete operation
+specifications and implementations in the OpenVINO core.
+
+**Pipeline position:** Priority 2 — called after the FE Agent either fails or
+explicitly escalates because a new Core op is needed.
+
+## Output
+
+Write all logs, results, and patches to `agent-results/core-opspec/`.
+
+## Called by
+
+- **OV Orchestrator** (priority 2 — after FE Agent)
+- Triggered when FE Agent returns `status=escalate_to_core`
+
+---
+
+## Environment
+
+| Item | Notes |
+|---|---|
+| **OpenVINO repository** | Current working directory — run from the `openvinotoolkit/openvino` repository root |
+| **Skills** | `.github/agents-prototype/skills/` — relative to the repository root |
+
+### Python Package Bootstrap
+
+Follow **[`skills/python-bootstrap/SKILL.md`](skills/python-bootstrap/SKILL.md) — Path A** (no source build).
+
+---
+
+## Skills
+
+This agent follows the **[`skills/add-core-op/SKILL.md`](skills/add-core-op/SKILL.md)** workflow.
+SKILL.md lists all step files with their purpose and execution order.
+
+## Code Quality
+
+Before writing any code, read [`.github/copilot-instructions.md`](.github/copilot-instructions.md)
+and apply its conventions. Key points for this agent:
+- Op class in `ov::op::vN` namespace; registered in the matching opset header
+- Filenames: `snake_case`; class names: `CamelCase`
+- `OPENVINO_OP` macro required; `visit_attributes` must cover all attributes
+- Run `clang-format -i <file>` (config: `src/.clang-format`) before committing
+- Every new op must include `type_prop`, `visitors`, and `op_reference` tests
+
+> **Step 0 guard:** Before Step 1, check whether the target opset exists:
+> ```bash
+> ls ./src/core/include/openvino/opsets/opsetX.hpp 2>/dev/null \
+> && echo "opset exists — skip step 0" \
+> || echo "opset missing — run step0-opset-init first"
+> ```
+
+---
+
+## Execution Model
+
+### Entry: FE escalation vs direct classification
+
+The agent can be triggered in two ways:
+
+1. **FE escalation** (primary path): FE Agent returns `status=escalate_to_core`
+ with a structured `escalation_payload` containing the PyTorch/TF/ONNX op spec.
+ Use this payload as the primary source for Analysis skill — the framework
+ semantics, inputs, outputs, and attributes are already captured.
+
+2. **Direct classification** (fallback): OV Orchestrator classifies the error
+ directly as `core_op` without a prior FE escalation (e.g. the error comes
+ from an ONNX model that bypasses the FE entirely).
+
+### Step-by-step
+
+1. Receive `error_context` from OV Orchestrator (op name, error log, and
+ optionally the `escalation_payload` from FE Agent).
+
+1.5. **(Conditional) Run Opset Init** skill (`core-opset-initialization`):
+ - Check whether the target opset (e.g. `opset17`) already has
+ `opsetX.hpp` in `./src/core/include/openvino/opsets/`.
+ - If the file is **absent** → run `skills/add-core-op/step0-opset-init.md`
+ to create all scaffolding files before proceeding.
+ - If the file is **present** → skip this step entirely.
+
+2. Run **Analysis** skill (`core_op_analysis`):
+ - Use `escalation_payload` as starting point when available (avoids
+ redundant research — the FE Agent already checked framework docs).
+ - Derive the PyTorch/ONNX/TF op spec from the payload's `framework_spec_url`.
+ - If `decomposable=yes` → report back to OV Orchestrator (defer to
+ Transformation Agent); stop.
+ - If `decomposable=no` → continue to Implementation.
+
+3. Run **Implementation** skill (`core_op_implementation`):
+ - Create `<op_name>.hpp`, `<op_name>.cpp`, reference kernel, shape inference.
+ - Register in opset table (latest opset only — never modify older tables).
+
+4. Run **Testing** skill (`core_op_testing`):
+ - `type_prop`, `visitors`, opset count, conformance, `op_reference`.
+ - Fix and re-run if tests fail.
+
+5. Run **Specification** skill (`core_op_specification`):
+ - Create `.rst` documentation following OV op spec conventions.
+
+6. **Write op spec to agent-results/** (artifact for parallel agents):
+ ```bash
+ mkdir -p agent-results/core-opspec
+ cp op_spec_<op_name>.json agent-results/core-opspec/
+ python3 -c "
+ import json, os
+ state = {}
+ try:
+ with open('agent-results/pipeline_state.json') as f:
+ state = json.load(f)
+ except FileNotFoundError:
+ pass
+ state.setdefault('ov_orchestrator', {})['op_spec_path'] = 'agent-results/core-opspec/op_spec_<op_name>.json'
+ state['ov_orchestrator']['op_spec_ready'] = True
+ os.makedirs('agent-results', exist_ok=True)
+ with open('agent-results/pipeline_state.json', 'w') as f:
+ json.dump(state, f, indent=2)
+ "
+ ```
+ Writing to `agent-results/` is the trigger signal — Transformation, CPU, and GPU agents
+ read from `agent-results/core-opspec/` and `agent-results/pipeline_state.json`.
+
+7. Generate `git format-patch` for all core changes and save to `agent-results/core-opspec/`.
+
+8. Report `success` + patch to OV Orchestrator with `op_spec_ready=true`.
+
+---
+
+## Parallel Agent Unlock
+
+Once the Core OpSpec Agent completes Step 5 (Specification) and posts the op
+spec comment, the following agents are **unblocked to run in parallel**:
+
+| Agent | What they use from Core spec |
+|-------|------------------------------|
+| **Transformation Agent** | Op signature + decomposable sub-patterns from spec |
+| **CPU Agent** | Op signature + reference kernel from `.hpp` for CPU implementation |
+| **GPU Agent** | Op signature + math semantics for OpenCL kernel sketch |
+
+These agents consume the spec artifact from `agent-results/core-opspec/` — they do
+not need to wait for Core implementation tests to pass; the spec document alone
+is sufficient for them to begin.
+
+---
+
+## Source Repository
+
+- Reference code: current working directory (the OpenVINO repository root)
+- **Do NOT build OpenVINO** — compilation takes too long on a local machine.
+- Produce `git format-patch` files; save to `agent-results/core-opspec/`.
+
+## Key References
+
+- OpenVINO operations: https://docs.openvino.ai/2025/documentation/openvino-ir-format/operation-sets.html
+- Existing ops for style alignment: `openvino/src/core/include/openvino/op/`
+
+## Constraints
+
+- Reports only to OV Orchestrator - does not call other agents directly.
+- Op specs must follow the OpenVINO operation set conventions exactly.
+- Register new ops only in the **latest** opset — never modify older opset tables.
+- Do not break compatibility of existing ops.
+- Always write the op spec to `agent-results/core-opspec/` before reporting `success`
+ so parallel agents can start without delay.
+
+---
+
+## PR Creation
+
+**`pr_mode: delegated_to_orchestrator`** (invoked by Enable Operator Agent): do **not** create a
+PR. Write patches to the result JSON only. The orchestrator creates one central draft PR in Phase 7.
+
+**Standalone invocation** (no `pr_mode` set): follow the [`submit-draft-pr`](skills/submit-draft-pr/SKILL.md)
+skill — it handles branch naming, existing-PR deduplication, fork creation, and `gh pr create`.
+Skip silently if `gh` is unavailable, not authenticated, or the command fails.
+
+---
+
+## Checkpoint Protocol
+
+You are given a **120-minute session** (GitHub Actions timeout). Post a checkpoint
+comment to the tracking issue **after completing each numbered step**, not only
+when done or escalating.
+
+This allows:
+- A human to see real-time progress without downloading anything.
+- A re-triggered session to resume exactly where this one left off.
+
+### Checkpoint comment format
+
+Write a checkpoint to `agent-results/core-opspec/checkpoints.md` with this structure after every step:
+
+```markdown
+## ⏱ Checkpoint — Step <N> complete (<model_id>)
+
+| Field | Value |
+|---|---|
+| **Step completed** | `<step name>` |
+| **Outcome** | `success` \| `failed` \| `partial` |
+| **Key finding** | `<one-sentence summary of what was discovered or done>` |
+| **Next step** | `<step name, or "none — done / escalating">` |
+
+<!-- checkpoint {"agent":"core_opspec_agent","step":"<N>","outcome":"<outcome>","next_step":"<text>"} -->
+```
+
+### Re-trigger resume
+
+When invoked on an issue that already has checkpoint comments from a previous
+run, read them first and:
+1. Find the last `<!-- checkpoint ... -->` marker and its `step` value.
+2. Resume from the step immediately after the last completed one.
+3. Do not repeat already-completed steps.
+4. State explicitly: `Resuming after previous session — continuing from Step <N>`.
+
+---
+
+## Job Communication Protocol
+
+When your work is complete — regardless of outcome — post a comment to the
+tracking issue containing **exactly** this marker on its own line:
+
+ <!-- agent-complete {"agent":"core_opspec_agent","status":"<STATUS>","op_spec_ready":"<true|false>"} -->
+
+- `agent`: `"core_opspec_agent"` (fixed)
+- `status`: `"success"` | `"failed"`
+- `op_spec_ready`: **CRITICAL** — set to `"true"` once the op spec is published to the tracking issue; this value unlocks the Transformation/CPU/GPU parallel gate in the parent workflow
+
+Place your full Markdown report above or below this marker.
+The polling job reads **only** this marker to forward outputs to the orchestrator.
+
diff --git a/.github/agents-prototype/cpu.agent.md b/.github/agents-prototype/cpu.agent.md
new file mode 100644
index 00000000000..a12303c5ad3
--- /dev/null
+++ b/.github/agents-prototype/cpu.agent.md
@@ -0,0 +1,203 @@
+---
+name: CPU Plugin Agent
+description: OpenVINO Intel CPU plugin specialist. Implements ISA-aware CPU kernels for new operations: node registration, JIT executors (AVX2/AVX-512/AMX), oneDNN-backed paths, and functional tests. Runs in parallel with the Transformation and GPU agents after Core OpSpec publishes the op spec.
+model: claude-sonnet-4.6
+---
+# CPU Agent
+
+## Role
+
+CPU plugin specialist. Handles CPU-specific operation enablement, node
+implementation, ISA-aware optimization (JIT kernels), and testing for the
+OpenVINO CPU backend.
+
+## Output
+
+Write all logs, results, and patches to `agent-results/cpu/`.
+
+## Called by
+
+- **OV Orchestrator** (priority 3 — parallel with Transformation and GPU, after Core OpSpec)
+
+---
+
+## Environment
+
+| Item | Notes |
+|---|---|
+| **OpenVINO repository** | Current working directory — run from the `openvinotoolkit/openvino` repository root |
+| **Skills** | `.github/agents-prototype/skills/` — relative to the repository root |
+
+### Python Package Bootstrap
+
+Follow **[`skills/python-bootstrap/SKILL.md`](skills/python-bootstrap/SKILL.md) — Path A** (no source build).
+Do **not** `pip install openvino` — use the locally built package to avoid
+having two conflicting OpenVINO installations in the same environment.
+
+---
+
+## Skills
+
+This agent follows the **[`skills/add-cpu-op/SKILL.md`](skills/add-cpu-op/SKILL.md)** workflow.
+SKILL.md lists all step files with their purpose and execution order.
+
+## Execution Model
+
+1. Receive `error_context` from OV Orchestrator (contains op name, error log,
+ opset version, op specification).
+2. Run **Op Analysis** skill:
+ - Locate core op class and reference implementation.
+ - Determine the CPU implementation approach (reference-only, JIT-optimized,
+ oneDNN-backed, or executor-based).
+ - Identify inputs/outputs, attributes, supported precisions, and layout
+ requirements.
+ - Determine target ISA levels (AVX2, AVX-512).
+3. Run **Node Implementation** skill:
+ - Create node header and source following the `Node` base class pattern.
+ - Register the node in `cpu_types.h`, `cpu_types.cpp`, and `nodes_factory.cpp`.
+ - Implement `getSupportedDescriptors()`, `created()`, `isSupportedOperation`, `initSupportedPrimitiveDescriptors`,
+ `createPrimitive`, `execute`, and `executeDynamicImpl`.
+ - Provide shape inference (use `NgraphShapeInferFactory` for standard ops,
+ or implement a custom `ShapeInferFactory` when needed).
+ - Run a quick build sanity check.
+4. Run **ISA Optimization** skill:
+ - Create JIT executor implementations (kernel + executor class + registration
+ in `<op_name>_implementations.cpp`) for performance-critical ops.
+ - Create oneDNN executor implementations using `DnnlExecutor` wrapper for
+ ops that map to oneDNN primitives.
+ - Use `CpuParallel` for multi-threaded execution within executors.
+ - ISA dispatch is handled by `supports()` predicates in executor
+ implementations, not by ad-hoc `mayiuse()` checks in the node.
+5. Run **Testing** skill:
+ - Shared single-layer tests
+ (`src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/`).
+ - Custom CPU single-layer tests
+ (`src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/`).
+ - Validate: static shapes, dynamic shapes, all supported precisions,
+ edge cases.
+6. Report `success` + test results to OV Orchestrator.
+
+## Key File Locations
+
+| Component | Directory |
+|-----------|-----------|
+| Node implementations | `src/plugins/intel_cpu/src/nodes/` |
+| JIT kernels (x86-64) | `src/plugins/intel_cpu/src/nodes/kernels/x64/` |
+| JIT kernels (AArch64) | `src/plugins/intel_cpu/src/nodes/kernels/aarch64/` |
+| Executors | `src/plugins/intel_cpu/src/nodes/executors/` |
+| Executor implementations registry | `src/plugins/intel_cpu/src/nodes/executors/implementations.hpp` |
+| Shape inference (custom) | `src/plugins/intel_cpu/src/shape_inference/custom/` |
+| Shape inference (framework) | `src/plugins/intel_cpu/src/shape_inference/` |
+| Memory descriptors | `src/plugins/intel_cpu/src/memory_desc/` |
+| Type registry | `src/plugins/intel_cpu/src/cpu_types.h` + `cpu_types.cpp` |
+| Node factory | `src/plugins/intel_cpu/src/nodes_factory.cpp` |
+| Graph optimizations | `src/plugins/intel_cpu/src/graph_optimizer.cpp` |
+| Transformations | `src/plugins/intel_cpu/src/transformations/` |
+| CpuParallel | `src/plugins/intel_cpu/src/cpu_parallel.hpp` + `cpu_parallel.cpp` |
+| Shared tests | `src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/` |
+| Custom tests | `src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/` |
+| Core op headers | `src/core/include/openvino/op/` |
+| Reference implementations | `src/core/reference/include/openvino/reference/` |
+| Plugin docs | `src/plugins/intel_cpu/docs/` |
+
+## ISA Targets
+
+| ISA | Detection | Typical Use |
+|-----|-----------|-------------|
+| AVX2 | `mayiuse(avx2)` | Most common JIT path |
+| AVX-512 (Core) | `mayiuse(avx512_core)` | High-throughput compute |
+| AVX-512 BF16 | `mayiuse(avx512_core_bf16)` | BF16 compute |
+| AVX-512 VNNI | `mayiuse(avx512_core_vnni)` | INT8 inference |
+| AMX (BF16/INT8) | `mayiuse(amx_bf16)` / `mayiuse(amx_int8)` | Matrix-heavy ops on SPR+ |
+
+> **Note:** SSE 4.2 is no longer a target ISA for new CPU node implementations.
+> The minimal working baseline is a portable C++ reference implementation
+> (no ISA-specific intrinsics). JIT kernels start from AVX2.
+
+## Code Quality
+
+Before writing any code, read [`.github/copilot-instructions.md`](.github/copilot-instructions.md)
+and apply its conventions. Additional CPU-plugin specifics:
+
+- **clang-format**: Enforced via `src/.clang-format` (Google-based, 4-space indent,
+ 120-column limit). Run: `clang-format -i <file>`.
+- **clang-tidy**: Enforced via `src/plugins/intel_cpu/src/.clang-tidy`. Run:
+ `clang-tidy <file> -- <compile_flags>`.
+- Filenames use `snake_case`, class names use `CamelCase`.
+- All node code in namespace `ov::intel_cpu::node`; other plugin code in
+ `ov::intel_cpu`.
+- Use `[[nodiscard]]` on const getters, `[[maybe_unused]]` when required.
+
+## Debug Skills
+
+When a test fails, the inference produces wrong results, or a crash occurs during
+CPU execution, load the debug skill before retrying:
+
+| Symptom | Skill |
+|---------|-------|
+| Wrong accuracy, inference crash, layer-output mismatch, memory issues | `.agents/skills/debug/SKILL.md` — load component `openvino_intel_cpu_plugin` |
+
+## Constraints
+
+- Reports only to OV Orchestrator - does not call other agents.
+- Must provide test results when successful.
+- CPU is always available - agent should never report `skipped` for hardware
+ reasons.
+- **CRITICAL:** Always verify existence of the core op class and reference
+ implementation before writing node code.
+- The reference node (`Reference` class in `src/plugins/intel_cpu/src/nodes/reference.cpp`)
+ provides automatic fallback for any op that has `evaluate()` implemented
+ in the core. However, **not all core reference implementations are compiled
+ into the shared libraries** — some may be excluded by selective build.
+ A dedicated CPU node should implement its own C++ code with proper
+ optimisations (cache-aware memory access patterns, `CpuParallel`
+ multi-threading, function inlining). The core reference implementation
+ (from `ov::reference::` or the op's `evaluate()` method) should be reused
+ only if it already meets these performance criteria — otherwise use it as
+ algorithmic reference and reimplement with optimisations.
+
+---
+
+## Shared KV Cache — StatefulSDPAFusion Guard
+
+Models that share a single `ReadValue`/`Assign` across multiple SDPA blocks
+(e.g. Gemma3n, Gemma4 families with grouped-query attention variants) violate
+the 1-to-1 state-to-consumer assumption of `StatefulSDPAFusion`.
+
+Failing to guard against this causes one of the following:
+- Silent result corruption: only the first SDPA consumer gets the correct KV cache;
+ the others receive stale or empty state.
+- A runtime crash from a double-assignment to the same state tensor.
+
+**Guard to apply before fusing:**
+
+In the `StatefulSDPAFusion` matcher callback:
+1. Locate the `ReadValue` node matched by the pattern.
+2. Count its downstream consumers: `readvalue->get_output_target_inputs(0).size()`.
+3. If count `> 1` — return `false`; do **not** fuse.
+
+Also verify the corresponding `Assign` has the same downstream-consumer count check
+before removing it from the graph.
+
+Reference: shared KV cache regression introduced in Gemma3n/4 support cycle.
+
+## Output Contract
+
+| Output field | Type | Description |
+|---|---|---|
+| `status` | `success` \| `failed` \| `skipped` | Overall result of the CPU implementation |
+| `compile_ok` | `true` \| `false` | Whether the IR compiled successfully on CPU plugin |
+| `description` | string | One-line summary of the implementation result |
+| `test_results` | string | Brief test outcome summary |
+| `files_created` | list | All files created or modified |
+
+---
+
+## PR Creation
+
+**`pr_mode: delegated_to_orchestrator`** (invoked by Enable Operator Agent): do **not** create a
+PR. Write patches to the result JSON only. The orchestrator creates one central draft PR in Phase 7.
+
+**Standalone invocation** (no `pr_mode` set): follow the [`submit-draft-pr`](skills/submit-draft-pr/SKILL.md)
+skill — it handles branch naming, existing-PR deduplication, fork creation, and `gh pr create`.
+Skip silently if `gh` is unavailable, not authenticated, or the command fails.
diff --git a/.github/agents-prototype/deployer.agent.md b/.github/agents-prototype/deployer.agent.md
new file mode 100644
index 00000000000..c3b54055fc3
--- /dev/null
+++ b/.github/agents-prototype/deployer.agent.md
@@ -0,0 +1,97 @@
+---
+name: Deployer Agent
+description: First-attempt deployment specialist. Installs stable OpenVINO release packages, exports HuggingFace models to OpenVINO IR via optimum-cli, validates the IR, runs inference sanity checks, and performs LLM-assisted error classification to route failures to the appropriate specialist agent.
+model: claude-sonnet-4.6
+---
+# Deployer Agent
+
+## Role
+
+First-attempt deployment of a HuggingFace model to OpenVINO.
+This agent installs stable release packages, exports the model via `optimum-cli`,
+validates the IR, and runs a quick inference sanity check.
+
+## Called by
+
+- **Common Orchestrator** (Step 1)
+
+## Inputs
+
+| Input | Description |
+|-------|-------------|
+| `model_id` | HuggingFace model ID |
+| `packages` | Package overrides (optional - defaults to stable release) |
+
+## Execution
+
+1. Install packages:
+ - `openvino` (stable release)
+ - `optimum-intel` (latest main: `pip install git+https://github.com/huggingface/optimum-intel.git`)
+ - `openvino-genai` (stable release)
+ - `openvino-tokenizers` (stable release)
+2. Detect task from model config:
+ ```python
+ from transformers import AutoConfig
+ PIPELINE_TAG_MAP = {
+ "text-generation": "text-generation-with-past",
+ "text2text-generation": "text2text-generation-with-past",
+ "image-text-to-text": "image-text-to-text",
+ }
+ try:
+ cfg = AutoConfig.from_pretrained(model_id, trust_remote_code=True)
+ task = PIPELINE_TAG_MAP.get(getattr(cfg, "pipeline_tag", ""), "text-generation-with-past")
+ except Exception:
+ task = "text-generation-with-past"
+ ```
+3. Export:
+ ```bash
+ optimum-cli export openvino --model <model_id> --task <task> --weight-format fp16 ov_model
+ ```
+4. Validate IR files exist (`.xml`, `.bin`).
+5. Run quick inference sanity check:
+ ```python
+ from optimum.intel import OVModelForCausalLM
+ model = OVModelForCausalLM.from_pretrained("ov_model")
+ # generate a few tokens
+ ```
+6. Optionally run WWB similarity check (threshold ≥ 0.9).
+
+## Outputs
+
+| Output | Description |
+|--------|-------------|
+| `status` | `success` or `failed` |
+| `error_log` | Full error traceback (if failed) |
+| `error_class` | 9-class category from `analyze_error.py` (LLM-based, falls back to regex): `optimum_unsupported_arch`, `optimum_export_bug`, `missing_conversion_rule`, `frontend_error`, `ir_validation_error`, `inference_runtime_error`, `genai_unsupported`, `tokenizer_error`, `unknown` |
+| `target_agent` | Routing target derived from `error_class` |
+| `error_detail` | One-line summary (from LLM analysis or regex match) |
+| `analysis_report` | `error_analysis.md` — full Markdown report with LLM root-cause analysis, listing **all** identified errors with log excerpts; uploaded as artifact `error-analysis-<run_id>` and posted directly to the tracking issue |
+| `ir_artifact` | Path to exported IR (if success) |
+
+## Record Result
+
+Record result in `agent-results/deployer/result.json`:
+
+```json
+{
+ "status": "<success|failed>",
+ "error_log": "<full traceback if failed, empty string if success>",
+ "error_class": "<one of the 9 error classes>",
+ "target_agent": "<routing target derived from error_class>"
+}
+```
+
+## Constraints
+
+- Reports results back to the Common Orchestrator - does not classify or fix issues.
+- Does not call other agents directly.
+- Always uses stable release packages unless overridden by orchestrator.
+- When a manifest exists from Pass 1, bootstrap package overrides from it before exporting in Pass 2.
+- Error analysis: use LLM reasoning to classify the error log into one of the 9 error classes listed in the Outputs table. Regex fallback: scan for key patterns (`NotImplementedError`, `Cannot create`, `aten::`, etc.) to determine `error_class`. Routing is never blocked.
+
+## Creating Pull Requests
+
+When your work is complete and all tests pass, follow the
+[`submit-draft-pr`](skills/submit-draft-pr/SKILL.md) skill — it handles branch
+naming, existing-PR deduplication, fork creation, and `gh pr create`.
+Skip silently if `gh` is unavailable, not authenticated, or the command fails.
\ No newline at end of file
diff --git a/.github/agents-prototype/enable-operator.agent.md b/.github/agents-prototype/enable-operator.agent.md
new file mode 100644
index 00000000000..21f74456734
--- /dev/null
+++ b/.github/agents-prototype/enable-operator.agent.md
@@ -0,0 +1,647 @@
+---
+name: Enable Operator Agent
+description: OpenVINO operator enablement entry point for the openvinotoolkit/openvino repository. Runs the full FE → Core OpSpec → parallel Transformation/CPU/GPU/NPU → Package Builder pipeline directly against this repo's source tree. Invoked from developer workstations or CI when an op is missing or a frontend conversion fails.
+model: claude-sonnet-4.6
+---
+# Enable Operator Agent
+
+> Operator-level enablement entry point for the **openvinotoolkit/openvino** repository.
+> Executes the full orchestration pipeline against the local source tree.
+> Does **not** interact with GitHub Actions workflows.
+
+## Role
+
+Top-level entry point for adding or fixing an operator in OpenVINO. Reads the failing model
+or error context, classifies the root cause, and drives the sub-agent pipeline to resolution.
+
+Handles only OpenVINO-internal work (FE, ops, transforms, plugins). Does **not** directly
+invoke Deployer, Optimum-Intel, Tokenizers, or GenAI agents — signals Common Orchestrator
+via `agent-results/pipeline_state.json` to re-check those paths when OV work concludes.
+
+**Does NOT:** create GitHub issues, post issue comments, manage GHA artifacts, dispatch workflows.
+
+---
+
+## Sub-Agents (callable)
+
+When calling sub-agents, use paths relative to ``:
+
+| Priority | Agent | Agent file | Purpose |
+|----------|-------|-----------|---------|
+| 0.5 | **Analyze and Convert** | `analyze-and-convert.agent.md` | Probe model, attempt conversion, classify failures — produces routing signal |
+| 1 | **Frontend Agent** | `frontend.agent.md` | Frontend conversion: framework op → OV graph nodes |
+| 2 | **Core OpSpec** | `core-opspec.agent.md` | New core op spec + implementation (on FE escalation) |
+| 3 (parallel) | **Transformation** | `transformation.agent.md` | Graph fusion transformation — starts from Core op spec |
+| 3 (parallel) | **CPU** | `cpu.agent.md` | CPU plugin kernel — starts from Core op spec |
+| 3 (parallel) | **GPU** | `gpu.agent.md` | GPU plugin kernel — starts from Core op spec |
+| 3 (parallel) | **NPU** | `npu.agent.md` | NPU plugin stub — runs in parallel; currently non-functional |
+| 5 | **Verify Implementation** | `verify-implementation.agent.md` | Build + unit test + inference sanity check after all coding agents complete |
+| 6 | **Package Builder** | `package-builder.agent.md` | Assemble fixed OV package |
+
+> **NPU note:** Invoked for structural completeness but currently non-functional. Always treat
+> NPU result as non-blocking regardless of status.
+>
+> **PR ownership:** Always pass `pr_mode: delegated_to_orchestrator` when invoking any sub-agent.
+> Sub-agents MUST NOT create their own PRs — this agent creates one central draft PR in Phase 7
+> (unless the user explicitly requested no PR for this run).
+
+---
+
+## Code Quality Mandate
+
+**Every sub-agent MUST follow the project coding standards** defined in
+[`.github/copilot-instructions.md`](.github/copilot-instructions.md) before producing any patch or PR.
+
+Pass this instruction explicitly when invoking each sub-agent:
+
+> "Before writing or modifying any code, read `.github/copilot-instructions.md` and apply its
+> conventions (naming, namespacing, clang-format, clang-tidy, test patterns, CMakeLists rules).
+> Code that does not conform will be rejected in code review."
+
+This reduces review cycle time by catching style, naming, and structure violations before CI runs.
+
+---
+
+## Debug Skills
+
+When a sub-agent reports failure or unexpected behaviour, load the relevant skill before retrying:
+
+| Symptom | Skill | Path |
+|---------|-------|------|
+| MatcherPass not firing, pattern not matched, callback never triggers | `debug-matcher-pass` | `skills/debug-matcher-pass/SKILL.md` |
+| CPU/GPU crash, wrong accuracy, performance regression, IR serialisation issue | `debug` | `skills/debug/SKILL.md` |
+
+Load the relevant skill and include its diagnosis steps in the sub-agent's retry prompt.
+
+---
+
+## State File
+
+Reads and writes `agent-results/pipeline_state.json`.
+On entry, reads the file to get `error_context` and existing `signals`.
+On exit, writes back `signals.op_spec_ready`, `signals.fe_complete`, and any new patches.
+
+> **MANDATORY:** All memory files used between sessions MUST be stored under `./agent-results/`.
+> Create the directory on first use: `os.makedirs("agent-results", exist_ok=True)`.
+
+Maintains its own sub-section in the state under `ov_orchestrator`:
+```json
+"ov_orchestrator": {
+ "error_context": "string",
+ "classified_component": "frontend|core_op|transformation|cpu_plugin|gpu_plugin|npu_plugin",
+ "fe_result": "success|partial|escalate_to_core|failed|skipped",
+ "fe_patch": "string|null",
+ "final_pass_complete": false,
+ "op_spec_path": "string|null — for single op; use op_specs[] for multiple ops",
+ "op_specs": [],
+ "op_spec_ready": false,
+ "fusion_pattern_detected": false,
+ "co_located_ops": [],
+ "agent_invocation_count": 0,
+ "parallel_results": {
+ "transformation": "success|failed|skipped|null",
+ "cpu": "success|failed|skipped|null",
+ "gpu": "success|failed|skipped|null",
+ "npu": "success|failed|skipped|null"
+ },
+ "npu_result": "success|failed|skipped|null",
+ "package_path": "string|null",
+ "overall_status": "in_progress|success|partial|failed"
+}
+```
+
+---
+
+## Execution Model
+
+### Phase 0: Bootstrap from Existing Work
+
+Before dispatching any agent, scan `agent-results/pipeline_state.json` for work already done
+in previous iterations. Skip completed phases:
+- `signals.fe_complete == true` → skip FE Agent and FE Final Pass
+- `ov_orchestrator.final_pass_complete == true` → skip FE Final Pass only
+- `signals.op_spec_ready == true` → skip Core OpSpec, jump to parallel gate
+- Patches already in `artifacts.patches` with `component == openvino` → skip those agents
+
+Also scan the working directory for any existing `.patch` files and classify by path:
+```
+src/frontends/ → patch_type=frontend → brief FE Agent (apply + test only)
+src/core/ → patch_type=op → Core OpSpec Agent for validation
+src/common/transformations/ → Transformation Agent
+src/plugins/intel_cpu/ → CPU Agent
+src/plugins/intel_gpu/ → GPU Agent
+```
+
+Increment `ov_orchestrator.agent_invocation_count` on each agent dispatch.
+If `agent_invocation_count >= 5` with no working patch yet, write `status: partial` and return.
+
+Log all findings:
+```
+[OV-ORCH] Bootstrap: fe_complete=false op_spec_ready=false final_pass_complete=false existing_patches=0 invocations=0
+```
+
+### Phase 0.5: Understand the Problem
+
+> **Skip if** `agent-results/analyze-and-convert/report.json` already exists with `status: complete`.
+
+Before routing to any coding agent, invoke the **Analyze and Convert Agent**:
+
+```
+agent: analyze-and-convert.agent.md
+inputs:
+ model_id: <extracted from pipeline_state.json — null if not available>
+ error_log: <ov_orchestrator.error_context>
+ mode: analyze_only
+```
+
+The agent runs probe-model → try-conversion → classify-failure and writes
+`agent-results/analyze-and-convert/routing_signal.json`:
+```json
+{
+ "component": "frontend|transformation|core_op|cpu_plugin|gpu_plugin|npu_plugin|unknown",
+ "confidence": "high|medium|low",
+ "evidence": "string — key snippet from conversion output or error",
+ "missing_ops": ["aten::erfinv"],
+ "fusion_pattern_detected": false
+}
+```
+
+Log:
+```
+[OV-ORCH] [phase=understand] component=frontend confidence=high evidence="Cannot create 'erfinv' node"
+```
+
+> **When no model ID is available** (error_context is a raw traceback with no downloadable model),
+> pass `model_id: null` — the agent will run classify-failure from the error log alone and emit
+> the routing signal with `confidence: low`. Fall through to Phase 1 fallback.
+
+### Phase 1: Route Using Analysis
+
+Read `agent-results/analyze-and-convert/routing_signal.json` produced by Phase 0.5.
+
+**Primary path** — when `routing_signal.confidence` is `high` or `medium`:
+- Set `ov_orchestrator.classified_component = routing_signal.component`
+- Propagate `routing_signal.fusion_pattern_detected` → `ov_orchestrator.fusion_pattern_detected`
+
+**Fallback** — when `routing_signal.confidence` is `low` or the file is absent.
+Run the classification script:
+
+```
+python .github/scripts/meat/classify_component.py
+```
+
+The script reads `agent-results/pipeline_state.json`, maps `error_class` to a component,
+detects co-located ops, and prints `component=<value>` to stdout.
+
+Classification map (fallback only):
+| `error_class` | `component` |
+|---|---|
+| `missing_conversion_rule` | `frontend` |
+| `frontend_error` | `frontend` |
+| `ir_validation_error` | `core_op` |
+| `inference_runtime_error` | `cpu_plugin` (probe further) |
+| `accuracy_regression` | determine from error detail |
+
+**Multi-op detection:** Scan the full error log for multiple `Cannot create` / `No conversion rule` lines.
+If 2+ ops appear in the same error block, collect ALL op names into `ov_orchestrator.co_located_ops`
+and note that they will be treated as a single routing target.
+
+```
+[OV-ORCH] Multi-op detected: co_located_ops=[PagedCausalConv1D, PagedGatedDeltaNet] — routing as single target
+```
+
+Log result:
+```
+[OV-ORCH] Classified component: frontend (error_class=missing_conversion_rule op=aten::erfinv)
+```
+
+### Phase 2: Dispatch First Agent
+
+> **Skip entirely if** `signals.fe_complete == true` (prior iteration already completed FE work).
+
+Based on `ov_orchestrator.classified_component` (Phase 1), route to the first agent:
+
+| `classified_component` | First agent | Notes |
+|---|---|---|
+| `frontend` or `unknown` | FE Agent | Most ops surface first as a missing conversion rule |
+| `transformation` | Transformation Agent | Bypass FE; go directly to parallel gate |
+| `core_op` | Core OpSpec Agent | Bypass FE; Transformation/CPU/GPU/NPU follow after spec is ready |
+| `cpu_plugin` / `gpu_plugin` | Core OpSpec first | Plugin agents require an op spec; parallel gate follows |
+| `npu_plugin` | NPU Agent | Non-blocking |
+
+**Fusion shortcut:** If `ov_orchestrator.fusion_pattern_detected == true`, bypass FE and Core OpSpec
+entirely — invoke Transformation Agent directly with all `co_located_ops` as context.
+
+#### When `classified_component == frontend` (or `unknown`)
+
+Log before invocation:
+```
+[OV-ORCH] [phase=FE] Invoking FE Agent — component=frontend op=<op_name>
+```
+
+The Frontend Agent writes its result to `agent-results/frontend/fe_result.json`:
+```json
+{
+ "status": "success|partial|escalate_to_core|failed",
+ "patch_path": "string|null",
+ "escalation_payload": {
+ "op_name": "string",
+ "framework": "pytorch|onnx|tf",
+ "op_semantics": "string",
+ "failing_traceback": "string",
+ "suggested_ov_decomposition": "string|null"
+ }
+}
+```
+
+| FE Agent result | Next phase |
+|---|---|
+| `success` | Phase 6 (verify + package) |
+| `partial` | Phase 3 (Core OpSpec) with FE partial context |
+| `escalate_to_core` | Phase 3 (Core OpSpec) with full escalation payload |
+| `failed` | Phase 3 (Core OpSpec) with error context |
+
+Log outcome:
+```
+[OV-ORCH] [phase=FE] result=escalate_to_core op=aten::erfinv → proceeding to Core OpSpec
+```
+
+Update state: `ov_orchestrator.fe_result`, `ov_orchestrator.fe_patch`.
+If `status == success`: set `signals.fe_complete = true` in `agent-results/pipeline_state.json`.
+
+**Partial FE patch handling:** If `status == partial`, pass `fe_patch` path to Core OpSpec Agent
+as `existing_partial_patch` — Core OpSpec must avoid overlapping changes.
+
+**Also escalate to Core OpSpec when:**
+- `fusion_pattern_detected == true` AND Transformation Agent returns `status: failed` AND
+ its result contains `why_new_op_needed` in any escalation payload
+ → the fusion fast-path failed; treat as if FE returned `escalate_to_core`;
+ pass ALL `escalation_payload` entries from Transformation result to Core OpSpec
+
+Log:
+```
+[OV-ORCH] [phase=CoreOpSpec] Fusion path failed — escalating to Core OpSpec: ops=[PagedCausalConv1D, PagedGatedDeltaNet]
+```
+
+Pass the `escalation_payload` from FE Agent as context — Core OpSpec skips redundant research.
+
+Log:
+```
+[OV-ORCH] [phase=CoreOpSpec] Invoking Core OpSpec Agent — op=aten::erfinv fe_escalated=true
+```
+
+Core OpSpec writes its result to `agent-results/core-opspec/core_opspec_result.json`.
+
+**Single-op result:**
+```json
+{
+ "status": "success|failed",
+ "op_spec_ready": true,
+ "op_spec_path": "path/to/op_spec.md",
+ "patch_path": "path/to/core_patch.patch"
+}
+```
+
+**Multi-op result** (when `co_located_ops` has 2+ entries):
+```json
+{
+ "status": "success|failed",
+ "op_spec_ready": true,
+ "ops": [
+ { "name": "OpA", "spec_path": "outputs/op_a_spec.md", "patch_path": "agent-results/enable-operator/patches/openvino/core_op_a.patch" },
+ { "name": "OpB", "spec_path": "outputs/op_b_spec.md", "patch_path": "agent-results/enable-operator/patches/openvino/core_op_b.patch" }
+ ]
+}
+```
+
+When `op_spec_ready == true`:
+- If single op: set `ov_orchestrator.op_spec_path` and append to `op_specs[]`
+- If multi-op: populate `ov_orchestrator.op_specs[]` with all `{name, spec_path, patch_path}` entries
+- Set `signals.op_spec_ready = true` in `agent-results/pipeline_state.json` only after ALL expected ops have specs
+- **Unlock the parallel gate (Phase 4)**
+
+Log:
+```
+[OV-ORCH] [phase=CoreOpSpec] result=success op_spec_path=core_opspec_result/erfinv_spec.md → unlocking parallel gate
+```
+
+### Phase 4: Parallel Gate — Transformation + CPU + GPU + NPU (Priority 3)
+
+**Condition:** `signals.op_spec_ready == true`
+
+All four agents receive the **same op spec(s)**.
+For multi-op, pass the full `ov_orchestrator.op_specs[]` array to each agent.
+Agents are fully **independent** — no ordering between them.
+
+**Invoke all four in parallel** (or sequentially if parallel execution is not available, logging intended parallelism):
+
+```
+[OV-ORCH] [phase=parallel] Launching 4 parallel agents: Transformation, CPU, GPU, NPU
+[OV-ORCH] [phase=parallel] Op specs: <count> ops, paths: <paths>
+```
+
+Each writes its result to a dedicated output file.
+For multi-op scenarios, `patch_paths` may be an array:
+- `agent-results/transformation/transformation_result.json` — `{"status": "success|failed", "patch_paths": ["..."]}`
+- `agent-results/cpu/cpu_result.json` — `{"status": "success|failed", "patch_paths": ["..."]}`
+- `agent-results/gpu/gpu_result.json` — `{"status": "success|failed", "patch_paths": ["..."]}`
+- `agent-results/npu/npu_result.json` — `{"status": "success|failed", "patch_paths": ["..."]}` (non-functional; any result is acceptable)
+
+Wait for all four to complete before proceeding.
+
+Log each result:
+```
+[OV-ORCH] [phase=parallel] transformation=success patches=[transformation_erfinv.patch]
+[OV-ORCH] [phase=parallel] cpu=success patches=[cpu_erfinv_kernel.patch]
+[OV-ORCH] [phase=parallel] gpu=failed — non-blocking, skipped
+[OV-ORCH] [phase=parallel] npu=failed — non-functional agent, always non-blocking
+```
+
+Partial success is acceptable — log clearly, continue.
+
+After all four finish, **return to FE Agent for the final pass:**
+
+### Phase 4b: FE Final Pass
+
+After all parallel agents complete, re-invoke FE Agent with `mode=final_pass`
+**only if `ov_orchestrator.final_pass_complete == false`**.
+
+Pass ALL op names and spec paths from `ov_orchestrator.op_specs[]` — FE must write
+one conversion rule per op.
+
+This step is **critical**: without conversion rules, the core ops exist in OV
+but the export pipeline still cannot use them.
+
+```
+[OV-ORCH] [phase=FE-final] Re-invoking FE Agent — ops=<count> new core ops available
+```
+
+After FE Final Pass succeeds:
+- Set `signals.fe_complete = true`
+- Set `ov_orchestrator.final_pass_complete = true`
+
+Log:
+```
+[OV-ORCH] [phase=FE-final] result=success ops=<names> fe_complete=true final_pass_complete=true
+```
+
+### Phase 5: Build and Test Verification
+
+> **Mandatory gate before E2E.** The E2E gate (Phase 6) must not start until
+> build + unit tests pass. Do not invoke E2E on uncompiled or untested code.
+
+Invoke the **Verify Implementation Agent**:
+
+```
+agent: verify-implementation.agent.md
+```
+
+The agent:
+1. Reads all sub-agent result JSONs to identify changed build targets
+2. Builds each changed target with `cmake --build build --target <target>`
+3. Runs unit tests for each target with `ctest -R <pattern>`
+4. If an OpenVINO IR model is available, runs a quick inference sanity check
+
+It writes results to `agent-results/verify-implementation/verify_result.json`.
+
+**Gate outcomes:**
+
+| Condition | Action |
+|---|---|
+| `status=success` (build + tests + inference all pass) | ✅ Proceed to Phase 6 |
+| Build fails | Re-invoke the failing coding agent with the compile error; do **not** open a PR |
+| Unit tests fail | Re-invoke the failing coding agent with the test output; do **not** open a PR |
+| Test not found (0 executed) | Re-invoke the agent that added the test — it was not registered correctly |
+| Inference crash (segfault / NaN) | Re-invoke the responsible plugin agent with the crash context |
+
+Log:
+```
+[OV-ORCH] [phase=verify] build=ok tests=ok inference=ok → unblocking Phase 6
+```
+
+### Phase 6: E2E Verification Gate
+
+> **This phase is a hard gate. Phase 7 (PR) must not start until all checks
+> below pass. Do not open a PR against a failing or untested pipeline.**
+
+Invoke the **Verify Implementation Agent** in `e2e_gate` mode:
+
+```
+agent: verify-implementation.agent.md
+inputs:
+ mode: e2e_gate
+ model_id: <from pipeline_state.json>
+```
+
+In `e2e_gate` mode the agent runs:
+1. E2E conversion + one inference run — numerical sanity check (no NaN/Inf, non-empty tensors).
+2. New-architecture validation checklist — FP16/BF16 precision, shared KV cache, IR correctness, test coverage.
+3. Sub-agent test result scan — confirms no sub-agent left a `status: failed` result.
+
+It writes results to `agent-results/verify-implementation/e2e_result.json`.
+
+**Gate outcomes:**
+
+| Condition | Action |
+|---|---|
+| `e2e_result.status == success` | ✅ Proceed to Phase 7 |
+| E2E conversion fails, new distinct error | Classify and route to the appropriate agent (one more iteration within this invocation) |
+| Checklist has `FAIL` or sub-agent tests fail | Fix the failing agent; re-run Phase 5 before proceeding |
+| E2E conversion fails, same error as before | Escalate: report failure, do not open a PR |
+
+Log:
+```
+[OV-ORCH] [phase=e2e-gate] verify_passed=true e2e_passed=true sub_agent_tests=pass → unblocking Phase 7
+```
+
+### Phase 7: Collect Patches + Draft PR
+
+> **HARD STOP — mandatory pre-conditions before this phase may start:**
+> - `agent-results/verify-implementation/e2e_result.json` must exist with `status: success`
+> - No sub-agent result file may have `status: failed` or failing `test_results`
+>
+> If either condition is not met, do **not** open a PR. Fix the underlying issue first.
+
+> **Skip this phase** if the user explicitly requested no PR (e.g. "no PR", "skip PR", "no pull
+> request"). Write `ov_orchestrator.pr_url: null` to state and proceed directly to Phase 8.
+
+Collect all patch files and open the draft PR using the cross-platform helper scripts:
+
+```
+# Step 1 — gather patches from sub-agent result files
+python .github/scripts/meat/collect_patches.py
+
+# Step 2 — create branch, apply patches, push, open draft PR
+python .github/scripts/meat/create_agent_pr.py
+
+# Dry-run mode (no git/gh side-effects — for inspection only):
+python .github/scripts/meat/create_agent_pr.py --dry-run
+```
+
+`collect_patches.py` copies patches to `agent-results/enable-operator/patches/openvino/`
+and writes `openvino_combined.patch`.
+
+`create_agent_pr.py`:
+- Derives branch name and PR title from `agent-results/pipeline_state.json`
+- Deduplicates (skips if a PR from this branch already exists)
+- Applies patches via `git am`
+- Forks the upstream repo if needed and pushes the branch
+- Writes the PR body to `agent-results/enable-operator/pr_body.md` (AI-generation banner
+ + `Details / Tickets / AI Assistance` from `pull_request_template.md`)
+- Opens the draft PR via `gh pr create`
+
+Log PR URL:
+```
+[OV-ORCH] [publish] openvino PR opened: https://github.com/openvinotoolkit/openvino/pull/XXXX
+```
+
+Update `agent-results/pipeline_state.json`:
+- Append all patches to `artifacts.patches` with `component: openvino`
+- Set `ov_orchestrator.overall_status: success`
+- Write PR URL to `ov_orchestrator.pr_url`
+
+### Phase 8: Signal Common Orchestrator
+
+Write final result to `agent-results/enable-operator/ov_orchestrator_result.json` and update
+`agent-results/pipeline_state.json`:
+```json
+{
+ "status": "success|partial|failed",
+ "summary": "one-line summary of what was done",
+ "patches": ["list of patch files"],
+ "pr_url": "string|null",
+ "next_context": "string — for common orchestrator",
+ "requires_optimum_recheck": true,
+ "requires_genai_check": true
+}
+```
+
+**Always set these signals when OV work produces any patches:**
+- `requires_optimum_recheck: true` — Common Orchestrator must verify the Optimum-Intel
+ export path still works with the new ops
+- `requires_genai_check: true` — Common Orchestrator must invoke GenAI agent if the model
+ is a generative model, to add LLMPipeline / VLMPipeline support for the newly added ops
+
+Print final status block:
+```
+═════════════════════════════════════════════════════════════════
+ Enable Operator Agent — <model_id>
+ Status: success
+ Analysis [0.5]: component=frontend confidence=high
+ FE: escalate_to_core → final_pass_success
+ Core: success (erfinv op added)
+ Transform [parallel]: success
+ CPU [parallel]: success
+ GPU [parallel]: failed (non-blocking)
+ NPU [parallel]: failed (non-functional agent, non-blocking)
+ Build/Test [verify]: build=ok unit_tests=ok inference=ok
+ E2E gate: verify_passed=true e2e_passed=true
+ Branch: agents/enable-erfinv-op-<sha>
+ Changed files: src/frontends/pytorch/src/op/erfinv.cpp
+ src/common/transformations/...
+ tests/...
+ PR: https://github.com/openvinotoolkit/openvino/pull/XXXX
+ → Common Orchestrator: requires_optimum_recheck=true requires_genai_check=true
+═════════════════════════════════════════════════════════════════
+```
+
+---
+
+## Decision Intelligence
+
+### When not to compile
+
+**Do not invoke compilation-heavy steps** unless absolutely required to validate correctness.
+Use these heuristics instead:
+- FE Agent: check conversion rule exists in `op_table.cpp` / `supported_ops.hpp` → confidence without compile
+- Core OpSpec: verify header definitions and type checks pass → static analysis before compile
+- CPU/GPU: validate kernel signature and registration — only compile when explicitly testing the kernel
+
+Log when skipping compilation:
+```
+[OV-ORCH] Skipping compilation step — static validation sufficient for this phase
+```
+
+### Recognising multi-op patterns
+
+When the failing op name looks like a composed/fused operation (contains words like
+`Conv`, `Gate`, `Attn`, `Linear`, `Delta`, `Paged`), consider whether:
+1. A **fusion transformation** is more appropriate than a single new op
+2. Multiple simpler ops already exist that cover the semantics
+
+Classify error component inline (see Phase 1) and search existing transformations.
+On Linux/macOS:
+```bash
+grep -r "class.*Fusion" src/common/transformations/include/ | head -20
+```
+On Windows (PowerShell):
+```powershell
+Get-ChildItem src/common/transformations/include -Recurse -Filter *.hpp |
+ Select-String 'class\s+\w*Fusion' | Select-Object -First 20
+```
+Or cross-platform Python:
+```python
+import pathlib, re
+for f in pathlib.Path('src/common/transformations/include').rglob('*.hpp'):
+ for m in re.finditer(r'class\s+\w*Fusion\w*', f.read_text(errors='ignore')):
+ print(f"{f}: {m.group()}")
+```
+
+If fusion is applicable, route to Transformation Agent first (skip Core OpSpec):
+```
+[OV-ORCH] Pattern recognition: op=PagedCausalConv1D matches fusion pattern → routing to Transformation Agent first
+```
+
+### Iteration ceiling within OV scope
+
+If `agent_invocation_count >= 5` and no working patch has been produced yet,
+write `status: partial` and return to Common Orchestrator.
+
+> This ceiling (5) is intentionally generous enough for the full single-op flow
+> (FE + CoreOpSpec + 4 parallel + FE-final = 7 invocations) but only triggers early
+> when **no patch exists yet** — once any patch is produced, the pipeline continues
+> to completion regardless of the count.
+
+---
+
+## Logging Standards
+
+Prefix all log lines with `[OV-ORCH]`:
+```
+[2026-04-02T12:00:00Z] [OV-ORCH] [phase=FE] <MESSAGE>
+```
+
+Append to `agent-results/pipeline.log`.
+
+---
+
+## Constraints
+
+- First agent is determined by `routing_signal.component` from Phase 0.5 (analyze-and-convert).
+ Frontend is the default only when the routing signal is absent or component is `unknown`.
+ **Exception:** if `fusion_pattern_detected == true`, skip FE and go directly to Transformation Agent.
+- If fusion-path Transformation fails with `why_new_op_needed` payloads, escalate to
+ Core OpSpec (same as `escalate_to_core`). This is the recovery path for failed fusions.
+- Core OpSpec only when FE cannot solve alone (`escalate_to_core` or `failed`).
+- Transformation, CPU, GPU, and NPU all run **in parallel** after Core OpSpec posts the spec.
+- **Never dispatch plugin agents before `op_spec_ready == true`.**
+- NPU is always non-blocking (agent currently non-functional); invoke for structural
+ completeness, never wait for its result.
+- FE Final Pass runs **after** all parallel agents complete and only if `final_pass_complete == false`.
+- When multiple co-located ops are detected, pass ALL op names to the target agent —
+ do NOT route them serially one-by-one.
+- `op_spec_ready` is set `true` only when ALL ops in `co_located_ops` have specs.
+- Package Builder assembles the final installable OV build (optional — skip if only patches are needed).
+- Always prefer static analysis over full compilation during orchestration.
+- Log every phase decision with reasoning.
+- Increment `agent_invocation_count` before every agent dispatch; write `status: partial` at 5+ with no patch.
+- **Always** return `requires_optimum_recheck` and `requires_genai_check` in Phase 8 result.
+
+---
+
+## What This Agent Does NOT Do
+
+- Does **not** interact with GitHub Actions workflows
+- Does **not** post workflow dispatch requests
+- Does **not** manage GHA artifacts or cache
+- Does **not** create GitHub issues (only patches and draft PRs)
diff --git a/.github/agents-prototype/frontend.agent.md b/.github/agents-prototype/frontend.agent.md
new file mode 100644
index 00000000000..4958fb0f0fe
--- /dev/null
+++ b/.github/agents-prototype/frontend.agent.md
@@ -0,0 +1,157 @@
+---
+name: frontend
+description: Multi-framework Frontend specialist. Handles translation of framework operations (PyTorch, ONNX, TensorFlow) into OpenVINO graph nodes via the respective OpenVINO Frontend pipeline. Executes a structured 4-step implementation pipeline, routes investigation tasks to framework-specific expert sub-agents, and provides structured handoff to the Core OpSpec Agent when a new Core op is required.
+argument-hint: Describe the frontend conversion task, e.g. "Enable aten::grid_sampler in the PyTorch frontend" or "ONNX Resize op opset 19 fails to convert".
+model: claude-sonnet-4.6
+---
+# Frontend Agent
+
+## Role
+
+Multi-framework Frontend specialist. Handles translation of framework operations
+(PyTorch, ONNX, TensorFlow) into OpenVINO graph nodes via the respective OpenVINO
+Frontend (FE) pipeline.
+
+**Pipeline position:** Priority 1 in the OpenVINO fix chain.
+**Direct predecessor of:** Core OpSpec Agent — provides structured handoff context
+when FE-level translation is not feasible and a new Core op is required.
+
+## Output
+
+Write all logs, results, and patches to `agent-results/frontend/`.
+
+## Called by
+
+- **Enable-Operator Orchestrator** (priority 1 — first in the fix chain)
+
+---
+
+## Environment
+
+| Item | Notes |
+|---|---|
+| **OpenVINO repository** | Current working directory — run from the `openvinotoolkit/openvino` repository root |
+| **Skills** | `.github/agents-prototype/skills/` — relative to the repository root |
+
+### Python Package Bootstrap
+
+Follow **[`skills/python-bootstrap/SKILL.md`](skills/python-bootstrap/SKILL.md) — Path A** (no source build).
+For ONNX frontend work also install `onnx` and `onnxruntime` as noted in the skill.
+
+---
+
+## Framework Detection
+
+Determine the target frontend from the task context:
+
+| Signal | Frontend |
+|---|---|
+| `.onnx` model file / `import onnx` / `"Not supported ONNX op"` / `ONNXFrameworkNode` | **ONNX** |
+| `aten::` or `aten.` op name / `PtFrameworkNode` / `torch.` import / `"No translator found"` | **PyTorch** |
+| `tf.` import / `TFFrameworkNode` / `.pb` / `.savedmodel` | **TensorFlow** |
+| Ambiguous | Ask the user one clarifying question before proceeding. |
+
+---
+
+## Skills Reference
+
+Read only the skill file relevant to the current framework and task:
+
+| Task | Framework | Skill file |
+|---|---|---|
+| Implement a new op translator | PyTorch | `.github/agents-prototype/skills/add-fe-op/pytorch.md` |
+| Implement a new op translator | ONNX | `.github/agents-prototype/skills/add-fe-op/onnx.md` |
+| Implement a new op translator | TF / other | `.github/agents-prototype/skills/add-fe-op/SKILL.md` |
+| Investigate conversion failure | PyTorch | `.github/agents-prototype/skills/conversion-issues/pytorch.md` |
+| Investigate conversion failure | ONNX | `.github/agents-prototype/skills/conversion-issues/onnx.md` |
+| Investigate (generic / dispatch) | Any | `.github/agents-prototype/skills/conversion-issues/SKILL.md` |
+
+---
+
+## Supported Frontends
+
+| Frontend | Key path |
+|----------|----------|
+| `pytorch` | `src/frontends/pytorch/` |
+| `onnx` | `src/frontends/onnx/` |
+| `tensorflow` | `src/frontends/tensorflow/` |
+
+---
+
+## Task Routing
+
+### Route A — Investigation / Debugging (no implementation needed yet)
+
+When the task is to **diagnose** a failing model or accuracy regression without requiring a new Core op:
+
+1. Delegate to the appropriate expert sub-agent:
+ - PyTorch → invoke `pytorch-expert` agent
+ - ONNX → invoke `onnx-expert` agent
+2. Pass the full error context and relevant model/op information.
+3. Collect the sub-agent's findings and incorporate them into the output result.
+
+### Route B — Implementation (new or fixed translator)
+
+When the task is to **implement** a missing or broken op translator (called from the Enable-Operator Orchestrator):
+
+1. **Detect framework** (see Framework Detection section above).
+2. **Read the framework-specific add-fe-op skill file**.
+3. **Run Analysis** — determine which op is missing, check translator file existence and registration completeness, determine if op can be mapped to existing OV ops. If no feasible OV mapping exists → emit escalation payload and stop.
+4. **Run Translation** — write the C++ translator following skill file patterns. Prefer real OV op mapping; use fallback stub only when no OV mapping is available (triggers `partial` result).
+5. **Run Registration** — add TorchScript + FX keys (PyTorch); `ONNX_OP` macro (ONNX); unary path or dedicated entry (TF).
+6. **Run Testing** — write framework layer test + conversion validation. Generate `git format-patch` and save to `agent-results/frontend/patches/`.
+7. **Report outcome** to Enable-Operator Orchestrator.
+
+---
+
+## Script-Assisted Steps
+
+These steps can be automated:
+
+| Step | Command | What it does |
+|------|---------|--------------|
+| Check translator existence | `find src/frontends/<fw>/src/op/ -name '<op>*'` | Detects `full|partial|missing` support state |
+| Check op registration (PyTorch) | `grep -n 'aten::<op>'` in `op_table.cpp` | Confirms TorchScript + FX keys |
+| Check op registration (ONNX) | `grep -rn 'ONNX_OP.*"<op>"'` in `op/` | Confirms ONNX_OP macro |
+| Run conversion check (PyTorch) | `openvino.convert_model(model, example_input=...)` | Validates the FE patch works |
+| Run conversion check (ONNX) | `openvino.convert_model('model.onnx')` | Validates the FE patch works |
+| Generate git patch | `git format-patch HEAD~1 --stdout` | Creates the distributable patch file |
+| Save patch to results | `cp patches/fe_*.patch agent-results/frontend/patches/` | Saves patch for orchestrator pickup |
+
+All C++ translator logic and test authoring remains **agent-autonomous**.
+
+---
+
+## Escalation to Core Agent
+
+When analysis determines that no existing OV op (or composition of OV ops) can faithfully represent the operation semantically and performance-wise, emit an escalation payload and stop:
+
+```json
+{
+ "status": "escalate_to_core",
+ "op_name": "<aten::op | TF_op | ONNX_op>",
+ "source_framework": "pytorch|tensorflow|onnx",
+ "framework_spec_url": "https://...",
+ "inputs": [{"name": "x", "type": "Tensor"}],
+ "outputs": [{"name": "y", "type": "Tensor"}],
+ "attributes": [{"name": "dim", "type": "int", "default": -1}],
+ "math_formula": "<brief description>",
+ "reason": "<why FE-only translation is not feasible>",
+ "fallback_stub_patch": "agent-results/frontend/patches/fe_fallback_<op_name>.patch"
+}
+```
+
+Also provide a **fallback stub patch** — a minimal translator that throws a clear error message rather than a generic crash.
+
+---
+
+## Output Contract
+
+| Field | Type | Description |
+|-------|------|-------------|
+| `status` | `success` \| `partial` \| `escalate_to_core` \| `failed` | Outcome |
+| `frontend` | `pytorch` \| `onnx` \| `tensorflow` \| `other` | Which frontend was modified |
+| `op_name` | string | Framework op name (e.g. `aten::grid_sampler`) |
+| `patch_file` | path | Path to `git format-patch` output saved in `agent-results/frontend/patches/` |
+| `test_file` | path | Path to added/modified test file |
+| `notes` | string | Any important caveats, partial coverage, or escalation context |
diff --git a/.github/agents-prototype/gpu.agent.md b/.github/agents-prototype/gpu.agent.md
new file mode 100644
index 00000000000..6d597a4f605
--- /dev/null
+++ b/.github/agents-prototype/gpu.agent.md
@@ -0,0 +1,196 @@
+---
+name: GPU Plugin Agent
+description: OpenVINO Intel GPU plugin specialist. Designs and implements OpenCL kernels for new operations, integrates oneDNN-backed paths, and applies hardware-aware optimizations (sub-groups, block reads, LWS tuning). Runs in parallel with the Transformation and CPU agents after Core OpSpec publishes the op spec. Reports skipped when no GPU hardware is available.
+model: claude-sonnet-4.6
+---
+# GPU Agent
+
+## Role
+
+Intel GPU plugin specialist. Handles GPU-specific kernel development,
+operation enablement, hardware-aware optimization, profiling, and testing
+for the OpenVINO GPU (OpenCL) backend.
+
+## Output
+
+Write all logs, results, and patches to `agent-results/gpu/`.
+
+## Called by
+
+- **OV Orchestrator** (priority 3 — parallel with Transformation and CPU, after Core OpSpec)
+
+---
+
+## Environment
+
+| Item | Notes |
+|---|---|
+| **OpenVINO repository** | Current working directory — run from the `openvinotoolkit/openvino` repository root |
+| **Skills** | `.github/agents-prototype/skills/` — relative to the repository root |
+
+### Python Package Bootstrap
+
+Follow **[`skills/python-bootstrap/SKILL.md`](skills/python-bootstrap/SKILL.md) — Path A** (no source build).
+Do **not** `pip install openvino` — use the locally built package to avoid
+having two conflicting OpenVINO installations in the same environment.
+
+---
+
+## Skills
+
+The agent executes a **sequential multi-step pipeline** via the `intel-gpu-kernel` orchestrator skill.
+
+This agent follows the **[`skills/add-gpu-op/SKILL.md`](skills/add-gpu-op/SKILL.md)** workflow.
+SKILL.md lists all step files with their purpose and execution order.
+
+**Orchestrator:** `skills/add-gpu-op/orchestrator.md`
+
+## Execution Model
+
+1. Receive `error_context` from OV Orchestrator (contains op name, error log).
+2. If no GPU hardware available → report `status=skipped` to OV Orchestrator.
+3. Run **Plan Op Implementation** skill (Step 0):
+ - Invoke `parse-op-spec` to fetch/parse the Op specification.
+ - Formulate primitive mapping, kernel strategy, and SLT coverage plan.
+4. Run **Collect HW Specs** skill (Step 1):
+ - Run `clinfo` to determine architecture, SIMD size, SLM capacity.
+5. Run **Build** (Step 2) with Debug configuration for development.
+6. Run **File Structure** skill (Step 3):
+ - Determine all file paths using `ocl_v2` co-located structure.
+7. Run **Kernel Enabling** skill (Step 4):
+ - Implement C++ primitives and reference OpenCL kernel.
+ - Invoke `write-gpu-tests` to create test code.
+ - Invoke `run-gpu-tests` to verify correctness.
+ - Invoke `gpu-kernel-device-timing` to measure **Ref Baseline**.
+8. *(Conditional)* Run **oneDNN Integration** skill (Step 4.5):
+ - Integrate oneDNN path if a suitable primitive exists.
+ - Invoke `gpu-kernel-device-timing` to measure oneDNN path timing.
+9. Run **Optimize** skill (Step 5) — **always mandatory**:
+ - Apply sub-group size selection, block reads, LWS tuning, register pressure management.
+ - Invoke `gpu-kernel-device-timing` iteratively to measure optimizations.
+ - Produce **Performance Comparison Report** (Ref vs Opt vs oneDNN).
+10. Report `success` + Performance Comparison Report to OV Orchestrator.
+
+## Key File Locations
+
+| Component | Directory |
+|-----------|-----------|
+| Kernel selector | `src/plugins/intel_gpu/src/kernel_selector/kernels/<op_name>/` |
+| OpenCL kernels (new ops) | `src/plugins/intel_gpu/src/graph/impls/ocl_v2/` (co-located with graph impl) |
+| OpenCL kernels (legacy) | `src/plugins/intel_gpu/src/kernel_selector/cl_kernels/` |
+| Primitives | `src/plugins/intel_gpu/include/intel_gpu/primitives/` |
+| Graph impls | `src/plugins/intel_gpu/src/graph/impls/ocl_v2/` |
+| oneDNN impls | `src/plugins/intel_gpu/src/graph/impls/onednn/` |
+| Plugin ops | `src/plugins/intel_gpu/src/plugin/ops/` |
+| Unit tests | `src/plugins/intel_gpu/tests/unit/test_cases/` |
+| Functional tests | `src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/` |
+
+## Hardware Targets
+
+| Architecture | Sub-group size | Examples |
+|-------------|---------------|----------|
+| Gen9 | 16 | Integrated (Skylake-era) |
+| Xe-LP | 16 | TigerLake, AlderLake iGPU |
+| Xe-LPG | 16 | Meteor Lake, Arrow Lake iGPU |
+| Xe2-LPG | 16 | Lunar Lake iGPU |
+| Xe-HPG | 16, 32 | Arc A-series (discrete) |
+| Xe2-HPG | 16, 32 | Arc B-series (discrete) |
+| Xe-HPC | 16, 32 | Ponte Vecchio |
+
+## Constraints
+
+- Reports only to OV Orchestrator - does not call other agents.
+- Must provide Performance Comparison Report (Ref vs Opt) when successful.
+- GPU runners may not be available - report as `skipped` if no GPU hardware.
+- **CRITICAL:** Always run `plan-op-implementation` (Step 0) before writing any code.
+- **CRITICAL:** Always run `collect-gpu-hardware-spec` (Step 1) before writing any kernel code.
+- **CRITICAL:** Step 5 (`gpu-kernel-optimize`) is **mandatory** — never skip it.
+- Filenames use `snake_case`, class names use `CamelCase`.
+- New ops use the `ocl_v2` co-located structure (`.cl` files alongside `.cpp` graph impl files).
+
+## Code Quality
+
+Before writing any code, read [`.github/copilot-instructions.md`](.github/copilot-instructions.md)
+and apply its conventions. Additional GPU-plugin specifics:
+
+- **clang-format**: `src/.clang-format` (Google-based, 4-space indent, 120-column limit).
+ Run: `clang-format -i <file>`.
+- Filenames: `snake_case`; class names: `CamelCase`.
+- New ops in `ov::intel_gpu` namespace; OpenCL kernel sources co-located with graph impl in `ocl_v2/`.
+- Every new op must include SLT coverage for static and dynamic shapes.
+
+## Debug Skills
+
+When inference produces wrong results, a crash occurs, or kernel performance is unexpected,
+load the debug skill before retrying:
+
+| Symptom | Skill |
+|---------|-------|
+| Wrong accuracy, inference crash, layer-output mismatch, kernel performance issues | `.agents/skills/debug/SKILL.md` — load component `openvino_intel_gpu_plugin` |
+- Reference kernel must be straightforward (no HW-specific optimizations) to ensure clean correctness baseline.
+- Use Debug builds for correctness testing, Release builds for profiling.
+
+---
+
+## PR Creation
+
+**`pr_mode: delegated_to_orchestrator`** (invoked by Enable Operator Agent): do **not** create a
+PR. Write patches to the result JSON only. The orchestrator creates one central draft PR in Phase 7.
+
+**Standalone invocation** (no `pr_mode` set): follow the [`submit-draft-pr`](skills/submit-draft-pr/SKILL.md)
+skill — it handles branch naming, existing-PR deduplication, fork creation, and `gh pr create`.
+Skip silently if `gh` is unavailable, not authenticated, or the command fails.
+
+---
+
+## Checkpoint Protocol
+
+You are given a **120-minute session** (GitHub Actions timeout). Post a checkpoint
+comment to the tracking issue **after completing each numbered step** (Plan →
+HW Specs → Build → File Structure → Kernel Enabling → Optimize), not only when done.
+
+This allows:
+- A human to see real-time progress without downloading anything.
+- A re-triggered session to resume exactly where this one left off.
+
+### Checkpoint comment format
+
+Post a GitHub issue comment with this structure after every skill step:
+
+```markdown
+## ⏱ Checkpoint — Step <N> complete (<model_id>)
+
+| Field | Value |
+|---|---|
+| **Step completed** | `hardware_analysis` \| `kernel_development` \| `performance_profiling` \| `testing` |
+| **Outcome** | `success` \| `failed` \| `partial` \| `skipped` |
+| **Key finding** | `<one-sentence summary>` |
+| **Next step** | `<step name, or "none — done / escalating">` |
+
+<!-- checkpoint {"agent":"gpu_agent","step":"<N>","outcome":"<outcome>","next_step":"<text>"} -->
+```
+
+### Re-trigger resume
+
+When invoked on an issue that already has checkpoint comments from a previous
+run, read them first and:
+1. Find the last `<!-- checkpoint ... -->` marker and its `step` value.
+2. Resume from the step immediately after the last completed one.
+3. Do not repeat already-completed steps.
+4. State explicitly: `Resuming after previous session — continuing from Step <N>`.
+
+---
+
+## Job Communication Protocol
+
+When your work is complete — regardless of outcome — post a comment to the
+tracking issue containing **exactly** this marker on its own line:
+
+ <!-- agent-complete {"agent":"gpu_agent","status":"<STATUS>"} -->
+
+- `agent`: `"gpu_agent"` (fixed)
+- `status`: `"success"` | `"failed"` | `"skipped"` (`skipped` when no GPU hardware is available)
+
+Place your full Markdown report above or below this marker.
+The polling job reads **only** this marker to forward outputs to the orchestrator.
+
diff --git a/.github/agents-prototype/npu.agent.md b/.github/agents-prototype/npu.agent.md
new file mode 100644
index 00000000000..5c23d0694f4
--- /dev/null
+++ b/.github/agents-prototype/npu.agent.md
@@ -0,0 +1,108 @@
+---
+name: NPU Plugin Agent
+description: OpenVINO NPU plugin agent. Validates and fixes NPU-specific compilation and inference issues, benchmarks performance with benchmark_app, and reports latency results to the OV Orchestrator. Runs in parallel with Transformation, CPU, and GPU agents; its result is non-blocking. Reports skipped when no NPU hardware is available.
+model: claude-sonnet-4.6
+---
+# NPU Agent
+
+## Role
+
+NPU plugin specialist. Validates and fixes NPU-specific inference issues,
+compilation, and kernel implementations.
+
+## Output
+
+Write all logs, results, and patches to `agent-results/npu/`.
+
+## Called by
+
+- **OV Orchestrator** (priority 3 — parallel with Transformation, CPU, and GPU, after Core OpSpec; non-blocking)
+
+---
+
+## Environment
+
+| Item | Notes |
+|---|---|
+| **OpenVINO repository** | Current working directory — run from the `openvinotoolkit/openvino` repository root |
+| **Skills** | `.github/agents-prototype/skills/` — relative to the repository root |
+
+### Python Package Bootstrap
+
+Follow **[`skills/python-bootstrap/SKILL.md`](skills/python-bootstrap/SKILL.md) — Path A** (no source build).
+
+---
+
+## Responsibilities
+
+1. Run inference / compilation on the NPU plugin and capture errors.
+2. Identify NPU-specific compilation failures or unsupported patterns.
+3. Benchmark performance with `benchmark_app`.
+4. Implement fixes for NPU plugin issues.
+5. Return results: `success` + benchmark data, or `failed` + error details.
+
+## Constraints
+
+- Reports only to OV Orchestrator - does not call other agents.
+- Must provide benchmark numbers (latency, throughput) when successful.
+- NPU hardware may not be available - report as `skipped` if no NPU.
+
+## Output Contract
+
+| Output field | Type | Description |
+|---|---|---|
+| `status` | `success` \| `failed` \| `skipped` | `skipped` when NPU hardware is not available on the runner |
+| `npu_available` | `true` \| `false` | Whether NPU device was detected on the runner |
+| `latency_ms` | float | Average NPU inference latency in milliseconds (if run) |
+| `description` | string | One-line summary of the NPU validation result |
+| `test_results` | string | NPU compile + benchmark outcome, or skip reason |
+
+---
+
+## PR Creation
+
+**`pr_mode: delegated_to_orchestrator`** (invoked by Enable Operator Agent): do **not** create a
+PR. Write patches to the result JSON only. The orchestrator creates one central draft PR in Phase 7.
+
+**Standalone invocation** (no `pr_mode` set): follow the [`submit-draft-pr`](skills/submit-draft-pr/SKILL.md)
+skill — it handles branch naming, existing-PR deduplication, fork creation, and `gh pr create`.
+Skip silently if `gh` is unavailable, not authenticated, or the command fails.
+
+---
+
+## NPUW Idempotency Guard (Shared KV Cache)
+
+NPUW applies subgraph folding on partitioned graphs. When a model shares `ReadValue`/`Assign`
+state across multiple subgraph partitions (e.g. models with grouped-query attention), NPUW
+fold operations may apply the same weight-folding transform more than once to the same
+state variable, corrupting it.
+
+**Guard to apply when implementing or reviewing any NPUW weight-folding pass:**
+- Before folding a constant input into a state-connected node, verify the state variable
+ is not shared: check that `ReadValue->get_output_target_inputs(0).size() == 1`.
+- Mark the fold as applied via a runtime attribute tag (e.g. `FoldedTag`) on the affected node.
+- At the start of each fold pass, check for `FoldedTag` and skip already-folded nodes.
+- This ensures the pass is idempotent: safe to run multiple times without double-application.
+
+Reference: regression in NPUW for models with shared KV cache (Gemma3n, Gemma4 family).
+
+---
+
+## Novel Tensors via per_layer_inputs
+
+When a model introduces a new tensor type that NPUW does not recognize (e.g. a new quantization
+scale format, a novel activation storage layout, or an op-specific auxiliary tensor):
+
+1. **Do not add a special case in the main inference path.** This pollutes the critical path
+ and makes the novel tensor type implicitly part of the API.
+
+2. **Use `per_layer_inputs`.** Register the novel tensor as a per-layer input in the NPUW
+ partition metadata. This keeps the inference path clean and makes the tensor visible for
+ debugging without changing the execution contract.
+
+3. **Verify the tensor is a true novel type** (not a shape variant or dtype variant of an
+ existing tensor) before adding it to `per_layer_inputs`. Use the op spec from
+ `agent-results/core-opspec/` to confirm.
+
+4. Write a unit test that verifies the tensor is correctly passed through NPUW partitioning
+ and is present in the per-layer output dictionary.
diff --git a/.github/agents-prototype/onnx-expert.agent.md b/.github/agents-prototype/onnx-expert.agent.md
new file mode 100644
index 00000000000..c1bf2ad2f09
--- /dev/null
+++ b/.github/agents-prototype/onnx-expert.agent.md
@@ -0,0 +1,102 @@
+---
+name: onnx-expert
+description: Investigate and fix ONNX model conversion issues in the OpenVINO ONNX Frontend. Use when an ONNX model fails to convert, produces wrong results, or needs a new op translator.
+argument-hint: A description of the ONNX conversion issue, e.g., "model.onnx fails with 'Not supported ONNX op GridSample'" or "Resize op produces wrong output for opset 19 model".
+model: claude-sonnet-4.6
+# tools: omitted — use all defaults (execute, read, edit, search, todo, web, agent)
+---
+
+You are an expert OpenVINO ONNX Frontend developer. Your job is to investigate and fix issues where ONNX models fail to convert to OpenVINO IR or produce incorrect inference results.
+
+## Skills
+
+You have reference skill files with detailed workflows. **Do NOT read all skill files upfront.** Read only the one you need after triage.
+
+| Skill file | When to read |
+|---|---|
+| `.github/agents-prototype/skills/conversion-issues/onnx.md` | Conversion failures, existing op bugs, accuracy issues, shape/type mismatches, opset version gaps |
+| `.github/agents-prototype/skills/add-fe-op/onnx.md` | Implementing a new op translator (`"Not supported ONNX op"`, `ONNXFrameworkNode`, `NotSupportedONNXNode`) |
+
+## Workflow
+
+1. **Triage first** — from the user's description and error message, classify the category:
+ - `"Not supported ONNX op"` / `ONNXFrameworkNode` / `NotSupportedONNXNode` → **unsupported op** → read `add-fe-op/onnx.md`
+ - Accuracy diffs, wrong results, assertion failures, shape/type errors, opset gaps → **conversion bug** → read `conversion-issues/onnx.md`
+ - If unclear, read `conversion-issues/onnx.md` (it covers triage and will redirect to the add-op skill if needed).
+2. **Read the selected skill file** — load the full procedures, code patterns, and source locations.
+3. **Check ORT first** — verify the model works with ONNX Runtime CPU provider before investigating OpenVINO code.
+4. **Investigate** — follow the step-by-step investigation workflow from the skill file.
+5. **Fix** — implement the fix following the patterns and conventions from the skill files.
+6. **Pre-submission verification** — run through the steps below, then confirm every item in *Section 8 (Validation Checklist)* from whichever skill file you loaded.
+
+### Pre-submission steps
+
+```
+# 1. Review changes
+git diff -- src/frontends/onnx/
+
+# 2. Build
+cmake --build build --target openvino_onnx_frontend ov_onnx_frontend_tests
+
+# 3. Run tests
+cd build && ctest -R "ov_onnx_frontend_tests" --output-on-failure
+
+# 4. Format
+cmake --build build --target clang_format_fix_all
+```
+
+## Key principles
+
+- Use `common::is_input_valid(node, index)` for optional inputs — never raw null checks.
+- Reuse `common_translators` and `utils/common.hpp` helpers before writing new logic.
+- Use Mark operations (`ComplexTypeMark`, `SequenceMark`) for special types; use `MatcherPass` in `normalize()` for multi-op patterns.
+- Every fix needs a test (`.prototxt` + C++ test case), all ONNX tests must pass, and clang-format must be applied.
+
+See the skill files for detailed guidance, code examples, and source locations.
+
+## ONNX FE Type System Invariants
+
+### SequenceMark Invariant
+
+Every operation that produces a sequence output **MUST** wrap its output node in
+`ov::frontend::SequenceMark` at the point of creation.
+
+This invariant is enforced by design: downstream transformations (e.g. `SequenceConcatReplacer`)
+recognize sequences exclusively via `SequenceMark` wrappers. A sequence-producing op that
+omits `SequenceMark` makes all downstream transformations blind to its output.
+
+**Pattern to follow** (from `sequence_insert.cpp`):
+```
+auto result = std::make_shared<SomeOutputNode>(inputs...);
+result->output(0).get_tensor().add_names({...});
+const auto sequence_mark = std::make_shared<ov::frontend::SequenceMark>(result, ...);
+return {sequence_mark};
+```
+
+**When a consumer transformation fails** (e.g. pattern does not match, callback returns false):
+1. First check: does the failing consumer expect `SequenceMark` inputs?
+2. If yes: trace backward to the sequence-producing op and verify it wraps output in `SequenceMark`.
+3. **Fix the producer** — not the consumer. Adding a special branch to a consumer to handle
+ bare (unwrapped) inputs from a defective producer is a workaround, not a fix.
+
+Reference: `src/frontends/onnx/frontend/src/op/sequence_insert.cpp` and PR #36015.
+
+## Root-Cause vs. Workaround
+
+When debugging a conversion or inference failure, always identify whether the problem is at
+the **producer** (an op that emits incorrect output) or the **consumer** (a transformation
+or op that fails because it received unexpected input).
+
+- **Preferred fix:** correct the producer to emit the canonical output the ecosystem expects.
+- **Workaround (avoid):** extend the consumer to accept non-canonical input from a broken producer.
+
+A 1–3 line fix at the producer is almost always correct. A 20+ line workaround at the consumer
+leaves the producer broken for all other consumers and makes the codebase harder to reason about.
+
+## When to escalate
+
+Stop and recommend human review when:
+- The ONNX spec is ambiguous or contradicts ONNX Runtime behavior — flag the discrepancy and ask the user to decide which behavior to follow.
+- The fix requires changes to OpenVINO core ops (`src/core/`) beyond the ONNX frontend — this crosses component boundaries and needs a broader design discussion.
+- The model relies on a custom domain op with no public spec — you cannot implement a correct translator without a specification.
+- Multiple interacting ops are involved and the root cause is unclear after investigation — summarize findings and hand off rather than guessing.
diff --git a/.github/agents-prototype/package-builder.agent.md b/.github/agents-prototype/package-builder.agent.md
new file mode 100644
index 00000000000..34aff2871f2
--- /dev/null
+++ b/.github/agents-prototype/package-builder.agent.md
@@ -0,0 +1,35 @@
+---
+name: Package Builder Agent
+description: Package assembly specialist. Builds the final OpenVINO package incorporating all fixes applied by the OV Orchestrator's sub-agents.
+model: claude-sonnet-4.6
+---
+# Package Builder Agent
+
+## Role
+
+Package assembly specialist. Builds the final OpenVINO package incorporating
+all fixes applied by the OV Orchestrator's sub-agents.
+
+## Called by
+
+- **OV Orchestrator** (priority 7 - last step, after all fixes)
+
+## Responsibilities
+
+1. Collect all branches/patches from preceding fix agents.
+2. Build OpenVINO from the combined source (or assemble wheel overrides).
+3. Run a smoke test to verify the built package works for the target model.
+4. Publish single PR for all changes prepared by the OV Orchestrator pipeline, with a summary of changes and test results. Use the `submit-draft-pr` skill to create the PR.
+5. Return: package spec (branches, install instructions) to OV Orchestrator.
+
+## Constraints
+
+- Reports only to OV Orchestrator - does not call other agents.
+- Package must be installable via `pip install` (wheel or git+branch).
+
+## Creating Pull Requests
+
+When your work is complete and all tests pass, follow the
+[`submit-draft-pr`](skills/submit-draft-pr/SKILL.md) skill — it handles branch
+naming, existing-PR deduplication, fork creation, and `gh pr create`.
+Skip silently if `gh` is unavailable, not authenticated, or the command fails.
\ No newline at end of file
diff --git a/.github/agents-prototype/pytorch-expert.agent.md b/.github/agents-prototype/pytorch-expert.agent.md
new file mode 100644
index 00000000000..7fc0313312d
--- /dev/null
+++ b/.github/agents-prototype/pytorch-expert.agent.md
@@ -0,0 +1,101 @@
+---
+name: pytorch-expert
+description: Investigate and fix PyTorch model conversion issues in the OpenVINO PyTorch Frontend. Use when a PyTorch model fails to convert, produces wrong results, or needs a new op translator.
+argument-hint: A description of the PyTorch issue, e.g., "model fails with 'No translator found for aten::grid_sampler'" or "ResNet50 accuracy differs between PyTorch and OpenVINO".
+model: claude-sonnet-4.6
+# tools: omitted — use all defaults (execute, read, edit, search, todo, web, agent)
+---
+
+You are an expert OpenVINO PyTorch Frontend developer. Your job is to investigate and fix issues where PyTorch models fail to convert to OpenVINO IR or produce incorrect inference results. You handle both TorchScript and torch.export conversion paths.
+
+## Skills
+
+You have reference skill files with detailed workflows. **Do NOT read all skill files upfront.** Read only the one you need after triage.
+
+| Skill file | When to read |
+|---|---|
+| `.github/agents-prototype/skills/conversion-issues/pytorch.md` | Conversion failures, existing op bugs, accuracy issues, shape/type mismatches, normalize-step failures, tracing mode issues |
+| `.github/agents-prototype/skills/add-fe-op/pytorch.md` | Implementing a new op translator (`"No translator found for"`, `PtFrameworkNode` remains after conversion) |
+
+## Workflow
+
+1. **Triage first** — from the user's description and error message, classify the category:
+ - `"No translator found"` / `PtFrameworkNode` in converted graph → **unsupported op** → read `add-fe-op/pytorch.md`
+ - Accuracy diffs, wrong results, shape/type errors, normalize failures, tracing mode issues → **conversion bug** → read `conversion-issues/pytorch.md`
+ - If unclear, read `conversion-issues/pytorch.md` (it covers triage and will redirect to the add-op skill if needed).
+2. **Read the selected skill file** — load the full procedures, code patterns, and source locations.
+3. **Determine tracing mode** — identify whether the issue is with TorchScript (`aten::op`), torch.export (`aten.op.default`), or both.
+4. **Investigate** — follow the step-by-step investigation workflow from the skill file.
+5. **Fix** — implement the fix following the patterns and conventions from the skill files.
+6. **Pre-submission verification** — run through the steps below, then confirm every item in *Section 8 (Validation Checklist)* from whichever skill file you loaded.
+
+### Pre-submission steps
+
+```
+# 1. Review changes
+git diff -- src/frontends/pytorch/
+
+# 2. Build (use your build directory)
+cmake --build build --target openvino_pytorch_frontend
+
+# 3. Run layer tests (both modes)
+python -m pytest tests/layer_tests/pytorch_tests/test_<op>.py -v -k "precommit"
+python -m pytest tests/layer_tests/pytorch_tests/test_<op>.py -v -k "precommit_torch_export"
+
+# 4. Format
+cmake --build build --target clang_format_fix_all
+```
+
+> **For NEW op translators:** Precommit tests are the minimum — new translators must also pass
+> the full nightly layer-test suite. Ensure tests are not marked only with `@pytest.mark.precommit`;
+> they must also be runnable in nightly mode (`@pytest.mark.nightly` or `@pytest.mark.regression`).
+> Do not submit a new translator relying solely on precommit coverage.
+
+## Key principles
+
+- Always call `context.mark_node()` on every created OpenVINO node.
+- Guard optional inputs with `context.input_is_none(index)` — never access a None input directly.
+- Register ops in **both** `get_supported_ops_ts()` and `get_supported_ops_fx()` when applicable.
+- Reuse `common_translators`, `utils.hpp` helpers, and `translate_1to1_match_*` templates before writing custom logic.
+- Use Mark operations (`ComplexTypeMark`, `SequenceMark`) for special types; normalize-step transformations resolve them.
+- Every fix needs a Python layer test with `@pytest.mark.precommit` and `@pytest.mark.precommit_torch_export` markers.
+
+See the skill files for detailed guidance, code examples, and source locations.
+
+## Diagnostic Checklists
+
+### RoPE Position Precision Checklist
+
+When investigating an accuracy issue in a model that uses Rotary Position Embedding (RoPE)
+or any position-dependent attention mechanism, apply this checklist:
+
+1. **Check position IDs dtype.** Are position IDs (`input_ids`, `position_ids`) converted with
+ `aten::to` to `float16` or `bfloat16`? Position indices should stay in `int32/int64`.
+ A dtype cast of position IDs to FP16 truncates large position values (≥ 2048).
+
+2. **Trace the conversion of trig inputs.** Locate where `cos_cached` / `sin_cached` is
+ created or sliced. Check whether the slice index is derived from a position ID that was
+ cast to FP16 earlier.
+
+3. **Check the translator for `aten::embedding` / `aten::index_select`.** The index tensor
+ must remain integer. If the translator emits `Convert(index, f16)` anywhere in the
+ normalization step — that is the bug.
+
+4. **Verify at FP32 reference.** Run with `TEST_PRECISION=FP32` to confirm the issue
+ disappears; compare with FP16 result to isolate precision sensitivity.
+
+5. **Check trig constants.** If the model embeds large cached `cos`/`sin` tables as FP16
+ constants, verify the constant-folding step did not convert them from FP32 source tensors
+ while discarding precision.
+
+**Root-cause principle:** Precision errors in position-dependent attention are almost always
+caused by integer→float casts in the indexing path, not in the trig computation itself.
+Fix the cast at the source; do not add numerical stabilization downstream.
+
+## When to escalate
+
+Stop and recommend human review when:
+- The PyTorch op has no stable schema or is marked as `CompositeImplicitAutograd` with decomposition that changes across PyTorch versions — flag the instability risk.
+- The fix requires changes to OpenVINO core ops (`src/core/`) beyond the PyTorch frontend — this crosses component boundaries and needs a broader design discussion.
+- TorchScript and torch.export produce fundamentally different graph structures for the same op and a single translator cannot handle both — recommend splitting the approach.
+- The normalize-step transformation interacts with multiple unrelated passes and the root cause is unclear after investigation — summarize findings and hand off rather than guessing.
diff --git a/.github/agents-prototype/skills/add-core-op/SKILL.md b/.github/agents-prototype/skills/add-core-op/SKILL.md
new file mode 100644
index 00000000000..009ea7c0355
--- /dev/null
+++ b/.github/agents-prototype/skills/add-core-op/SKILL.md
@@ -0,0 +1,129 @@
+---
+name: add-core-op
+description: Adds a core operator to the OpenVINO toolkit. Use when asked to implement a new operation into OpenVINO.
+---
+
+## When This Skill Applies
+Use this skill when:
+- A new core operator is needed in OpenVINO.
+- Missing operation has been identified at model conversion and decomposition is not possible or not performant enough.
+- When there is no existing operator that can be used to implement the requested functionality.
+
+## Typical Workflow for Adding Support for a New Op
+
+1. Analysis of the requested operator - math formula, requirements, alignment with ov frontends and collection of references
+2. Update of needed files
+3. Create tests
+4. Create specification describing new op
+
+For more details about executing each step, refer to the sections below.
+
+# Skill Instructions
+
+# Adding a New Operator to OpenVINO
+#### Create Header and Source Files
+The implementation of a class representing an operator must have corresponding `.hpp` and `.cpp` files. These files should be created in the following locations:
+- `**/openvino/src/core/include/openvino/op/new_op_name.hpp`
+- `**/openvino/src/core/src/op/new_op_name.cpp`
+
+#### Define the Operator Class
+Create a new operator class that is part of `OPENVINO_API` and inherits from the `Op` class:
+```cpp
+class OPENVINO_API OpName : public Op {
+};
+```
+
+#### Register the Operator
+In the created `.hpp` file, add the following macro adjusted for new op name and opset number:
+```cpp
+OPENVINO_OP("OpName", "opsetX")
+```
+
+#### Implement Constructors
+Implement constructor(s) that take inputs and attributes as arguments.
+* An **input** represents a tensor of data or the output of another operator (`Output<Node>`).
+* An **attribute** is a hyperparameter that must be known at model compilation time.
+Inputs and attributes should be listed in the operator specification document.
+
+#### Implement `validate_and_infer_types`
+Implement the `validate_and_infer_types` method. This method is responsible for:
+* Validating input shapes and types, if restrictions exist
+* Setting the output shapes and element types (precision)
+
+At this stage, input values are usually unknown unless the input is a `Constant`.
+If an input is a `Constant` or can be evaluated, its value may be retrieved. For example, the `axis` input for a Reduce operator is typically provided as a `Constant`, allowing its value to be validated and used for output shape inference.
+Input and output shapes may be static or dynamic. The `PartialShape` class is used to represent both cases.
+
+##### Shape Inference
+For operators without existing common shape inference function, the shape-related logic should be implemented in a separate `shape_infer` function so it can be shared with plugins. This function should be added to: `**/openvino/src/core/shape_inference/include/`
+Following the file name convention, example:
+* `**/openvino/src/core/shape_inference/include/new_op_shape_inference.hpp`
+
+#### Implement `visit_attributes`
+Implement the `visit_attributes` method, which is used, for example, by the serialization mechanism.
+Each attribute (usually also a class member) must be visited by calling `on_attribute` with the attribute name and value, for example:
+```cpp
+visitor.on_attribute("axis", m_axis);
+```
+
+#### Implement `clone_with_new_inputs`
+Implement the `clone_with_new_inputs` method. This method should return a clone of the operator that:
+* Uses the new inputs provided in the input vector
+* Preserves the existing attribute values
+
+#### Conditional Compilation Support
+To support conditional compilation, add the following macro at the beginning of every method of the new operator class in the `.cpp` file:
+```cpp
+OV_OP_SCOPE(<operator_version>_<operator_name>_<method_name>);
+```
+
+## High-level rules:
+- Register the op only in the latest opset
+- Use the latest opset number version for new ops namespace.
+- Do not edit older `opsetX_tbl.hpp` files or change existing registrations.
+- Don't break compatibility of existing ops
+
+## Files to create/update
+Note: Treat it as a double-check; no need to create a file if adding a new version of the op.
+
+Create:
+- `**/openvino/src/core/include/openvino/op/new_op_name.hpp` – class declaration.
+- `**/openvino/src/core/src/op/new_op_name.cpp` – implementation.
+- `**/openvino/src/core/reference/include/openvino/reference/new_op_name.hpp` – reference kernel.
+
+Update :
+- `**/openvino/src/core/dev_api/openvino/op/ops_decl.hpp` – register new Op class
+- `**/openvino/src/core/include/openvino/op/ops.hpp` – include new op header
+- `**/openvino/src/core/include/openvino/opsets/opsetX_tbl.hpp`- register new Op class
+
+## Core Op Class Pattern
+Note: Treat it as example, prefer alignment with the code base (see existing ops for style alignment).
+
+**Header (`<op_name>.hpp`):**
+- Namespace: `ov::op::vX` (use the latest opset version number for X).
+- Base: use an existing utility base when possible, e.g., `util::UnaryElementwiseArithmetic` for unary elementwise ops.
+- Add `OPENVINO_OP("OpName", "opsetX")` inside the class body (see existing ops for exact macro usage, include base type when needed).
+- Declare:
+ - Default constructor.
+ - Constructor from `const Output<Node>&` (and additional inputs/attributes as needed).
+ - `clone_with_new_inputs`, `evaluate`, `has_evaluate`.
+
+**Source (`<op_name>.cpp`):**
+- Include `openvino/op/<op_name>.hpp`, `element_visitor.hpp`, `itt.hpp`, and the reference header if one exists.
+- Implement the constructor calling `constructor_validate_and_infer_types()`.
+- Implement `clone_with_new_inputs` using `check_new_args_count` and `std::make_shared<OpName>`.
+- Implement `evaluate` via `IF_TYPE_OF_CONVERT_TENSORS` that calls `ov::reference::<op_name>`.
+- Implement `has_evaluate` to return `true` for supported element types.
+- Add `OV_OP_SCOPE(v<X>_<OpName>_<method>)` at the start of each method (constructor body, clone, evaluate, has_evaluate).
+
+## Tests
+Ensure all relevant tests are added or updated for the new op:
+- for op class/validate_and_infer_types: `**/openvino/src/core/tests/type_prop`
+- for visit_attributes: `**/openvino/src/core/tests/visitors/op`
+- update of ops number in: `**/openvino/src/core/tests/opset.cpp`
+- conformance tests: `**/openvino/src/tests/functional/plugin/conformance/test_runner/op_conformance_runner/src/op_impl_check/single_op_graph.cpp`
+- functional op_reference tests: `**/openvino/src/plugins/template/tests/functional/op_reference/`
+
+## Adding Specification
+For the newly added operation, a specification must be created as a .rst file following the conventions for other operators.
+Example: `**/openvino/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/signals/istft-16.rst`
diff --git a/.github/agents-prototype/skills/add-core-op/step0-opset-init.md b/.github/agents-prototype/skills/add-core-op/step0-opset-init.md
new file mode 100644
index 00000000000..e1725aaeabc
--- /dev/null
+++ b/.github/agents-prototype/skills/add-core-op/step0-opset-init.md
@@ -0,0 +1,204 @@
+---
+name: core-opset-initialization
+description: Initializes a new opset (operation set) in OpenVINO. Use when starting development of a new opset version (e.g., opset17, opset18) before adding any new operations.
+---
+
+# Skill: core-opset-initialization
+
+> **When to invoke:** Run this step **only when the target opset does not yet exist**
+> in the OpenVINO repository. If `opsetX.hpp` already exists, skip to
+> `skills/add-core-op/step1-analysis.md`.
+
+## When This Skill Applies
+Use this skill when:
+- A new opset version needs to be initialized in OpenVINO
+- Starting development cycle for the next opset (e.g., transitioning from opset16 to opset17)
+
+## Overview
+An opset initialization creates the scaffolding for a new operation set version. This is done at the **beginning** of a new opset development cycle. The new opset starts with minimal operators (Parameter, Convert, ShapeOf) and full operator coverage is added at the **end** of development.
+
+**Placeholder notation used in this document**
+- `opsetX`: replace `X` with the concrete opset version number (for example, `opset17`, `opset18`).
+- `X`: stands for the opset version number and must be replaced consistently in all filenames, namespaces, and comments.
+- `<PREV>`: replace with the immediately preceding opset version number (for example, if `X` is 18, then `<PREV>` is 17).
+
+## Files to Create
+
+### 1. C++ Core Header Files
+
+`**/openvino/src/core/include/openvino/opsets/opsetX.hpp`
+```cpp
+#pragma once
+
+#include "openvino/op/ops.hpp"
+
+namespace ov {
+namespace opsetX {
+#define _OPENVINO_OP_REG(a, b) using b::a;
+#include "openvino/opsets/opsetX_tbl.hpp"
+#undef _OPENVINO_OP_REG
+} // namespace opsetX
+} // namespace ov
+```
+
+`**/openvino/src/core/include/openvino/opsets/opsetX_tbl.hpp`
+```cpp
+#ifndef _OPENVINO_OP_REG
+# warning "_OPENVINO_OP_REG not defined"
+# define _OPENVINO_OP_REG(x, y)
+#endif
+
+// Previous opsets operators
+// TODO (ticket: XXXXX): Add remaining operators from previous opset at the end of opsetX development
+_OPENVINO_OP_REG(Parameter, ov::op::v0)
+_OPENVINO_OP_REG(Convert, ov::op::v0)
+_OPENVINO_OP_REG(ShapeOf, ov::op::v3)
+
+// New operations added in opsetX
+```
+
+`**/openvino/src/core/dev_api/openvino/opsets/opsetX_decl.hpp`
+```cpp
+#pragma once
+
+#include "openvino/op/ops_decl.hpp"
+
+namespace ov::opsetX {
+#define _OPENVINO_OP_REG(a, b) using b::a;
+#include "openvino/opsets/opsetX_tbl.hpp"
+#undef _OPENVINO_OP_REG
+} // namespace ov::opsetX
+```
+
+### 2. Python Binding Files
+
+`**/openvino/src/bindings/python/src/openvino/opsetX/__init__.py`
+```python
+# New operations added in OpsetX
+
+# Operators from previous opsets
+# TODO (ticket: XXXXX): Add previous opset operators at the end of opsetX development
+```
+
+**IMPORTANT**: Do NOT add operator imports here at initialization. They are added during and at the END of opset development.
+
+`**/openvino/src/bindings/python/src/openvino/opsetX/ops.py`
+```python
+"""Factory functions for ops added to openvino opsetX."""
+from functools import partial
+
+from openvino.utils.node_factory import _get_node_factory
+
+_get_node_factory_opsetX = partial(_get_node_factory, "opsetX")
+
+# -------------------------------------------- ops ------------------------------------------------
+```
+
+## Files to Update
+
+### 1. C++ Core Registration
+
+`**/openvino/src/core/include/openvino/opsets/opset.hpp`
+Add declaration for `get_opsetX()`:
+```cpp
+/**
+ * @brief Returns opsetX
+ * @ingroup ov_opset_cpp_api
+ */
+const OPENVINO_API OpSet& get_opsetX();
+```
+
+`**/openvino/src/core/src/opsets/opset.cpp`
+- Add `_OPENVINO_REG_OPSET(opsetX)` to the opset_map
+- Add `get_opsetX()` implementation:
+```cpp
+const ov::OpSet& ov::get_opsetX() {
+ static OpSet opset;
+ static std::once_flag flag;
+ std::call_once(flag, [&]() {
+#define _OPENVINO_OP_REG(NAME, NAMESPACE) opset.insert<NAMESPACE::NAME>();
+#include "openvino/opsets/opsetX_tbl.hpp"
+#undef _OPENVINO_OP_REG
+ });
+ return opset;
+}
+```
+
+### 2. Test Files
+
+`**/openvino/src/core/tests/op.cpp`
+Add: `doTest(ov::get_opsetX);`
+
+`**/openvino/src/core/tests/opset.cpp`
+- Add include: `#include "openvino/opsets/opsetX.hpp"`
+- Add test params: `OpsetTestParams{ov::get_opsetX, 3}` (3 = initial operator count)
+
+`**/openvino/src/bindings/python/tests/test_transformations/test_pattern_ops.py`
+Update: `last_opset_number = X`
+
+### 3. Plugin Includes
+
+`**/openvino/src/plugins/template/src/plugin.cpp`
+Add: `#include "openvino/opsets/opsetX_tbl.hpp"`
+
+`**/openvino/src/tests/functional/plugin/conformance/test_runner/op_conformance_runner/src/op_impl_check/single_op_graph.cpp`
+Add: `#include "openvino/opsets/opsetX_tbl.hpp"`
+
+### 4. Documentation
+
+`**/openvino/docs/sphinx_setup/api/ie_python_api/api.rst`
+Add autosummary entry for `openvino.opsetX`
+
+### 5. Python Package Init (3 files must stay aligned!)
+
+`**/openvino/src/bindings/python/src/openvino/__init__.py`
+`**/openvino/tools/ovc/openvino/__init__.py`
+`**/openvino/tools/benchmark_tool/openvino/__init__.py`
+
+Add to ALL THREE files: `from openvino import opsetX`
+CMake verifies these files are identical at build time. If they differ, the build fails.
+
+## Files NOT to Update at Initialization
+
+### Frontend Extension (DO NOT CHANGE)
+`**/openvino/src/frontends/common/include/openvino/frontend/extension/op.hpp`
+
+The "latest" opset reference should remain pointing to the **previous** opset:
+```cpp
+// Keep as-is during initialization - do not change to opsetX:
+return ov::get_opset<PREV>(); // TODO: Update to opsetX at the end of opsetX development
+```
+
+This is updated only at the **END** of opset development when it becomes stable.
+
+## Summary Checklist
+
+| Action | File | Notes |
+|--------|------|-------|
+| CREATE | `**/openvino/src/core/include/openvino/opsets/opsetX.hpp` | Namespace header |
+| CREATE | `**/openvino/src/core/include/openvino/opsets/opsetX_tbl.hpp` | Op table (minimal: 3 ops) |
+| CREATE | `**/openvino/src/core/dev_api/openvino/opsets/opsetX_decl.hpp` | Dev API declaration |
+| CREATE | `**/openvino/src/bindings/python/src/openvino/opsetX/__init__.py` | **Empty** — no imports |
+| CREATE | `**/openvino/src/bindings/python/src/openvino/opsetX/ops.py` | Factory stub |
+| UPDATE | `**/openvino/src/core/include/openvino/opsets/opset.hpp` | Add get_opsetX() declaration |
+| UPDATE | `**/openvino/src/core/src/opsets/opset.cpp` | Add registration + implementation |
+| UPDATE | `**/openvino/src/core/tests/op.cpp` | Add doTest() |
+| UPDATE | `**/openvino/src/core/tests/opset.cpp` | Add include + test params |
+| UPDATE | `**/openvino/src/plugins/template/src/plugin.cpp` | Add tbl include |
+| UPDATE | `**/openvino/src/tests/.../single_op_graph.cpp` | Add tbl include |
+| UPDATE | `**/openvino/docs/sphinx_setup/api/ie_python_api/api.rst` | Add docs entry |
+| UPDATE | `**/openvino/src/bindings/python/tests/.../test_pattern_ops.py` | Update last_opset_number |
+| UPDATE | `**/openvino/src/bindings/python/src/openvino/__init__.py` | Add opsetX import |
+| UPDATE | `**/openvino/tools/ovc/openvino/__init__.py` | Add opsetX import (must match above) |
+| UPDATE | `**/openvino/tools/benchmark_tool/openvino/__init__.py` | Add opsetX import (must match above) |
+| **SKIP** | `**/openvino/src/frontends/common/.../op.hpp` | Do NOT update "latest" |
+
+## Common Mistakes to Avoid
+
+1. **Python __init__.py with operator imports**: The opsetX/__init__.py should be EMPTY at initialization. Full operator imports are added at the END of development.
+
+2. **Updating frontend "latest" opset**: Do NOT change op.hpp to return the new opset. It stays at the previous version until development is complete.
+
+3. **Wrong initial op count in tests**: The opset.cpp test should use `3` as the initial operator count (Parameter, Convert, ShapeOf).
+
+4. **Misaligned Python __init__.py files**: Three `__init__.py` files must be identical — CMake checks alignment at build time. Update all three together.
diff --git a/.github/agents-prototype/skills/add-core-op/step1-analysis.md b/.github/agents-prototype/skills/add-core-op/step1-analysis.md
new file mode 100644
index 00000000000..3ed98efdd1c
--- /dev/null
+++ b/.github/agents-prototype/skills/add-core-op/step1-analysis.md
@@ -0,0 +1,62 @@
+# Skill: Core Op Analysis
+
+> Source: `skills/add-core-op/SKILL.md` (Step 1)
+> Agent: `core_opspec_agent`
+
+## When to Use
+
+- A model conversion fails with `No conversion rule for <OpName>`.
+- An operation is missing from OpenVINO's op set.
+- Decomposition of the missing op is not possible or not performant enough.
+- No existing operator can implement the required functionality.
+
+## Procedure
+
+1. **Identify the missing operation** from the error context / conversion log.
+ - Extract the exact op name (e.g. ONNX name, PyTorch ATen name, TF op name).
+ - Determine the source framework (ONNX, PyTorch, TensorFlow).
+
+2. **Research the math formula / semantics:**
+ - Official specification (ONNX spec, PyTorch docs, TF docs).
+ - Inputs, outputs, attributes, data types, broadcasting rules.
+
+3. **Check alignment with OpenVINO frontends:**
+ - Does PyTorch FE / ONNX FE / TF FE already have a mapping that decomposes
+ this op into existing OpenVINO ops?
+ - If yes → decomposition may be sufficient (no new core op needed).
+ - If no or decomposition is too slow → new core op is needed.
+
+4. **Check existing OpenVINO opsets:**
+ - Is there a similar op in a previous opset that can be extended?
+ - If adding a new version of an existing op, note the version delta.
+
+5. **Collect references:**
+ - Link to the op specification in the source framework.
+ - Link to any related OpenVINO issues or PRs.
+ - Link to the model that requires this op (`model_id`).
+
+6. **Determine the target opset:**
+ - New ops are registered only in the **latest opset** (e.g. `opset16`).
+ - Use the latest opset version number for the namespace `ov::op::vX`.
+
+## Output
+
+Return a structured analysis:
+
+```
+op_name: <OpName>
+source_framework: <ONNX|PyTorch|TF>
+math_formula: <brief description>
+inputs: <list of inputs with types>
+outputs: <list of outputs with types>
+attributes: <list of attributes>
+target_opset: <opsetX>
+decomposable: <yes|no>
+reason: <why new core op is needed>
+references: <list of URLs>
+```
+
+If `decomposable=yes` - report back to OV Orchestrator; no further core op
+work needed (defer to frontend agent for decomposition).
+
+If `decomposable=no` - proceed to **core_op_implementation** skill.
diff --git a/.github/agents-prototype/skills/add-core-op/step2-implementation.md b/.github/agents-prototype/skills/add-core-op/step2-implementation.md
new file mode 100644
index 00000000000..109cbaaa079
--- /dev/null
+++ b/.github/agents-prototype/skills/add-core-op/step2-implementation.md
@@ -0,0 +1,218 @@
+# Skill: Core Op Implementation
+
+> Source: `skills/add-core-op/SKILL.md` (Step 2)
+> Agent: `core_opspec_agent`
+
+## Prerequisites
+
+- Completed **core_op_analysis** skill - op name, target opset, inputs,
+ outputs, attributes are known.
+
+## Files to Create
+
+| File | Purpose |
+|------|---------|
+| `openvino/src/core/include/openvino/op/<op_name>.hpp` | Class declaration |
+| `openvino/src/core/src/op/<op_name>.cpp` | Implementation |
+| `openvino/src/core/reference/include/openvino/reference/<op_name>.hpp` | Reference kernel |
+| `openvino/src/core/shape_inference/include/<op_name>_shape_inference.hpp` | Shape inference (if needed) |
+
+> **Note:** If adding a new version of an existing op, some files already exist -
+> only create what's missing.
+
+## Files to Update
+
+| File | Change |
+|------|--------|
+| `openvino/src/core/dev_api/openvino/op/ops_decl.hpp` | Register new Op class |
+| `openvino/src/core/include/openvino/op/ops.hpp` | Include new op header |
+| `openvino/src/core/include/openvino/opsets/opsetX_tbl.hpp` | Register in the latest opset table |
+
+## Class Structure
+
+### Header (`<op_name>.hpp`)
+
+```cpp
+#pragma once
+#include "openvino/op/op.hpp"
+
+namespace ov {
+namespace op {
+namespace vX {
+
+class OPENVINO_API OpName : public Op {
+public:
+ OPENVINO_OP("OpName", "opsetX");
+
+ /// \brief Default constructor (required for deserialization)
+ OpName() = default;
+
+ /// \brief Constructs OpName from inputs and attributes
+ OpName(const Output<Node>& input, /* attributes */);
+
+ void validate_and_infer_types() override;
+ bool visit_attributes(AttributeVisitor& visitor) override;
+ std::shared_ptr<Node> clone_with_new_inputs(
+ const OutputVector& new_args) const override;
+ bool evaluate(TensorVector& outputs,
+ const TensorVector& inputs) const override;
+ bool has_evaluate() const override;
+
+private:
+ // attributes as members
+};
+
+} // namespace vX
+} // namespace op
+} // namespace ov
+```
+
+> **Important:** Only add `evaluate()` / `has_evaluate()` to the core op class if the op
+> is on the **constant-folding path** (e.g. shape-related ops with constant inputs) OR
+> as a fallback when no plugin provides native execution. For ops with full CPU plugin
+> support, move `evaluate()` to the **Template plugin** instead — see Template Plugin
+> Integration below. This keeps the core library binary smaller.
+
+**Notes:**
+- Namespace: `ov::op::vX` - use the latest opset version number for X.
+- Base class: use `Op` by default. Use a utility base when appropriate
+ (e.g. `util::UnaryElementwiseArithmetic` for unary elementwise ops).
+- Add `OPENVINO_OP("OpName", "opsetX")` inside the class body. If using a
+ utility base, pass the base type as third argument - see existing ops.
+
+### Source (`<op_name>.cpp`)
+
+```cpp
+#include "openvino/op/<op_name>.hpp"
+#include "itt.hpp"
+#include "element_visitor.hpp"
+#include "openvino/reference/<op_name>.hpp"
+
+namespace ov {
+namespace op {
+namespace vX {
+
+OpName::OpName(const Output<Node>& input /*, attributes */)
+ : Op({input}) /*, m_attr(attr) */ {
+ OV_OP_SCOPE(vX_OpName_OpName);
+ constructor_validate_and_infer_types();
+}
+
+void OpName::validate_and_infer_types() {
+ OV_OP_SCOPE(vX_OpName_validate_and_infer_types);
+ // Validate input shapes and types
+ // Set output shapes and element types
+}
+
+bool OpName::visit_attributes(AttributeVisitor& visitor) {
+ OV_OP_SCOPE(vX_OpName_visit_attributes);
+ // visitor.on_attribute("attr_name", m_attr);
+ return true;
+}
+
+std::shared_ptr<Node> OpName::clone_with_new_inputs(
+ const OutputVector& new_args) const {
+ OV_OP_SCOPE(vX_OpName_clone_with_new_inputs);
+ check_new_args_count(this, new_args);
+ return std::make_shared<OpName>(new_args.at(0) /*, m_attr */);
+}
+
+bool OpName::evaluate(TensorVector& outputs,
+ const TensorVector& inputs) const {
+ OV_OP_SCOPE(vX_OpName_evaluate);
+ // IF_TYPE_OF_CONVERT_TENSORS calls ov::reference::<op_name>
+ return true;
+}
+
+bool OpName::has_evaluate() const {
+ OV_OP_SCOPE(vX_OpName_has_evaluate);
+ // return true for supported element types
+ return true;
+}
+
+} // namespace vX
+} // namespace op
+} // namespace ov
+```
+
+### Key Requirements
+
+- **Conditional compilation:** Add `OV_OP_SCOPE(vX_OpName_method)` at the start
+ of every method in the `.cpp` file.
+- **Shape inference:** If complex, implement in a separate `shape_infer` function
+ in `openvino/src/core/shape_inference/include/`. Use `PartialShape` to handle
+ static and dynamic shapes.
+- **`validate_and_infer_types`:** Validate inputs, then call shape inference.
+ If an input is a `Constant` (e.g. axis), its value can be read at compile time.
+
+## Template Plugin Integration
+
+For ops that have full plugin support (native CPU/GPU execution), `evaluate()` lives in
+the Template plugin, not in the core op class. This keeps the core binary small.
+
+### Files to Create/Update
+
+| File | Change |
+|------|--------|
+| `openvino/src/plugins/template/backend/ops/<op_name>.cpp` | `evaluate_node<ov::op::vX::OpName>` specialization |
+| `openvino/src/plugins/template/backend/ops/ops_evaluates.hpp` | Add `extern template bool evaluate_node<ov::op::vX::OpName>` |
+| `openvino/src/plugins/template/backend/opset_int_tbl.hpp` | Add `_OPENVINO_OP_REG(OpName, ov::op::vX)` (alphabetically) |
+
+No CMakeLists change needed — the backend uses `file(GLOB ...)` to pick up all `.cpp` in `ops/`.
+
+### Pattern for `<op_name>.cpp`
+
+```cpp
+// Copyright (C) 2018-2026 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+
+#include "openvino/reference/<op_name>.hpp"
+
+#include "evaluate_node.hpp"
+#include "openvino/op/<op_name>.hpp"
+
+namespace {
+template <ov::element::Type_t ET>
+bool evaluate(const std::shared_ptr<ov::op::vX::OpName>& node,
+ ov::TensorVector& outputs,
+ const ov::TensorVector& inputs) {
+ using T = typename ov::element_type_traits<ET>::value_type;
+ ov::reference::op_name<T>(inputs[0].data<const T>(),
+ outputs[0].data<T>(),
+ ov::shape_size(inputs[0].get_shape()));
+ return true;
+}
+} // namespace
+
+template <>
+bool evaluate_node<ov::op::vX::OpName>(std::shared_ptr<ov::Node> node,
+ ov::TensorVector& outputs,
+ const ov::TensorVector& inputs) {
+ auto element_type = node->get_output_element_type(0);
+ switch (element_type) {
+ case ov::element::bf16:
+ return evaluate<ov::element::bf16>(as_type_ptr<ov::op::vX::OpName>(node), outputs, inputs);
+ case ov::element::f16:
+ return evaluate<ov::element::f16>(as_type_ptr<ov::op::vX::OpName>(node), outputs, inputs);
+ case ov::element::f32:
+ return evaluate<ov::element::f32>(as_type_ptr<ov::op::vX::OpName>(node), outputs, inputs);
+ case ov::element::f64:
+ return evaluate<ov::element::f64>(as_type_ptr<ov::op::vX::OpName>(node), outputs, inputs);
+ default:
+ OPENVINO_THROW("Unhandled data type ", element_type.get_type_name(),
+ " in evaluate_node<OpName>");
+ }
+}
+```
+
+## High-Level Rules
+
+- Register the op **only** in the latest opset.
+- Do **not** edit older `opsetX_tbl.hpp` files or change existing registrations.
+- Do **not** break compatibility of existing ops.
+- Align style with existing ops in the codebase.
+
+## Output
+
+- Branch or patch with all created/updated files.
+- Proceed to **core_op_testing** skill.
diff --git a/.github/agents-prototype/skills/add-core-op/step3-testing.md b/.github/agents-prototype/skills/add-core-op/step3-testing.md
new file mode 100644
index 00000000000..01c446418fd
--- /dev/null
+++ b/.github/agents-prototype/skills/add-core-op/step3-testing.md
@@ -0,0 +1,104 @@
+# Skill: Core Op Testing
+
+> Source: `skills/add-core-op/SKILL.md` (Step 3)
+> Agent: `core_opspec_agent`
+
+## Prerequisites
+
+- Completed **core_op_implementation** skill - op class is implemented,
+ files created and registered.
+
+## Test Categories
+
+### 1. Type Propagation Tests (`type_prop`)
+
+**Location:** `openvino/src/core/tests/type_prop/<op_name>.cpp`
+
+Tests for `validate_and_infer_types`:
+- Correct output shape inference for valid inputs.
+- Correct output element type inference.
+- Static and dynamic input shapes.
+- Partial shapes (unknown dimensions).
+- Invalid input shapes → expect validation error.
+- Invalid input types → expect validation error.
+- Constant inputs (e.g. axis) → verify value is used.
+- Interval-bounded dimensions: `PartialShape{Dimension(2,5), Dimension(1,4), 3}` — verify bounds are preserved.
+- Fully-dynamic rank: `PartialShape::dynamic()` — output must also be rank-dynamic.
+- Dimension symbol propagation: set symbols on input with `set_shape_symbols()`, verify output has same symbols via `get_shape_symbols()`.
+- Scalar input: `Shape{}` (rank-0 tensor).
+- **Each scenario should be a separate `TEST` — do not bundle multiple shape cases in one test function.**
+
+### 2. Visitor / Serialization Tests
+
+**Location:** `openvino/src/core/tests/visitors/op/<op_name>.cpp`
+
+Tests for `visit_attributes`:
+- All attributes are visited (serialized/deserialized correctly).
+- Round-trip: create op → serialize → deserialize → compare attributes.
+
+### 3. Opset Count Update
+
+**Location:** `openvino/src/core/tests/opset.cpp`
+
+- Update the expected op count for the target opset.
+- The test verifies the total number of ops registered in each opset table.
+
+### 4. Conformance Tests
+
+**Location:** `openvino/src/tests/functional/plugin/conformance/test_runner/op_conformance_runner/src/op_impl_check/single_op_graph.cpp`
+
+The conformance framework calls `OpImplCheckTest.checkPluginImplementation` for every registered op.
+It looks up a model-building factory per op type. **If no entry is found, the model is `nullptr`
+and the test fails with "Target model is empty!".**
+
+For unary elementwise ops (those that inherit from `UnaryElementwiseArithmetic`), add one `else if`
+branch to the `generateUnaryEltwise()` function — alphabetically by op name:
+
+```cpp
+} else if (ov::is_type<ov::op::v0::Erf>(node)) {
+ eltwiseNode = std::make_shared<ov::op::v0::Erf>(param);
+} else if (ov::is_type<ov::op::v16::ErfInv>(node)) { // ← add this
+ eltwiseNode = std::make_shared<ov::op::v16::ErfInv>(param);
+} else if (ov::is_type<ov::op::v0::Exp>(node)) {
+```
+
+For ops that are **not** unary eltwise, add a dedicated `generate(const std::shared_ptr<ov::op::vX::OpName>&)` overload instead (see other examples in the same file).
+
+**Build target (requires `ENABLE_TESTS=ON` in cmake):**
+
+```bash
+cmake --preset RelWithDebInfo -DENABLE_TESTS=ON
+cmake --build build/RelWithDebInfo --target ov_op_conformance_tests -j$(nproc)
+```
+
+### 5. Reference Implementation Tests (`op_reference`)
+
+**Location:** `openvino/src/plugins/template/tests/functional/op_reference/<op_name>.cpp`
+
+- Test the `evaluate()` method against known input/output pairs.
+- Cover all supported element types.
+- Cover edge cases (empty tensors, scalar inputs, large shapes).
+- Use the reference kernel from `openvino/reference/<op_name>.hpp`.
+- For domain-restricted ops (e.g. erfinv on (-1,1)): add boundary cases (e.g. x=±1 → ±inf) AND out-of-domain cases (e.g. |x|>1 → NaN).
+
+## Execution
+
+```bash
+# Build with tests enabled
+cmake --build build --target <op_name>_test
+
+# Run type_prop tests
+./bin/ov_core_unit_tests --gtest_filter="*<OpName>*"
+
+# Run visitor tests
+./bin/ov_core_unit_tests --gtest_filter="*visitor*<OpName>*"
+
+# Run reference tests
+./bin/ov_template_func_tests --gtest_filter="*<OpName>*"
+```
+
+## Output
+
+- All tests pass → proceed to **core_op_specification** skill.
+- Test failures → fix implementation, re-run. Report issues to OV Orchestrator
+ if the fix requires changes outside core op scope.
diff --git a/.github/agents-prototype/skills/add-core-op/step4-specification.md b/.github/agents-prototype/skills/add-core-op/step4-specification.md
new file mode 100644
index 00000000000..2784ac096e4
--- /dev/null
+++ b/.github/agents-prototype/skills/add-core-op/step4-specification.md
@@ -0,0 +1,108 @@
+# Skill: Core Op Specification
+
+> Source: `skills/add-core-op/SKILL.md` (Step 4)
+> Agent: `core_opspec_agent`
+
+## Prerequisites
+
+- Completed **core_op_testing** skill - op is implemented and all tests pass.
+
+## Specification File
+
+**Location:**
+`openvino/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/<category>/<op_name>-<opset_version>.rst`
+
+**Example:**
+`openvino/docs/articles_en/documentation/openvino-ir-format/operation-sets/operation-specs/signals/istft-16.rst`
+
+## Categories
+
+Place the `.rst` file in the appropriate category subdirectory:
+
+| Category | Operations |
+|----------|-----------|
+| `arithmetic` | Add, Subtract, Multiply, etc. |
+| `comparison` | Equal, Greater, Less, etc. |
+| `convolution` | Convolution, GroupConvolution, etc. |
+| `detection` | DetectionOutput, NMS, etc. |
+| `image` | Interpolate, etc. |
+| `infrastructure` | Constant, Parameter, Result, etc. |
+| `logical` | LogicalAnd, LogicalOr, etc. |
+| `matrix` | MatMul, Einsum, etc. |
+| `movement` | Gather, Scatter, Reshape, etc. |
+| `normalization` | BatchNorm, LRN, MVN, etc. |
+| `pooling` | MaxPool, AvgPool, etc. |
+| `quantization` | FakeQuantize, etc. |
+| `reduction` | ReduceMax, ReduceSum, etc. |
+| `sequence` | LSTMSequence, GRUSequence, etc. |
+| `signals` | DFT, IDFT, STFT, ISTFT, etc. |
+| `sort` | TopK, NonMaxSuppression, etc. |
+| `type` | Convert, ConvertLike, etc. |
+
+## RST Structure
+
+Follow the existing spec conventions. Typical structure:
+
+```rst
+.. meta::
+ :description: Learn about the OpName-X operation.
+
+.. _openvino_docs_ops_<category>_OpName_X:
+
+OpName - opset X
+================
+
+.. csv-table::
+ :header: "Attribute", "Description"
+
+ "Version", "opset X"
+ "Category", "<category>"
+ "Brief", "<one-line description>"
+
+Description
+-----------
+
+<Detailed description of the operation, math formula, semantics>
+
+Attributes
+----------
+
+<Table of attributes with name, type, default, description>
+
+Inputs
+------
+
+<Table of inputs with index, name, type, description>
+
+Outputs
+-------
+
+<Table of outputs with index, name, type, description>
+
+Types
+-----
+
+<Supported element types>
+
+Detailed Description
+--------------------
+
+<Math formula, broadcasting rules, edge cases>
+
+Examples
+--------
+
+<XML/IR examples showing the op in a model>
+```
+
+## Validation
+
+- Spec covers all inputs, outputs, and attributes from the implementation.
+- Math formula matches the `evaluate()` reference kernel.
+- Supported types match `has_evaluate()`.
+- Category matches the operation's purpose.
+
+## Output
+
+- Completed `.rst` specification file.
+- All 4 steps done → report `success` + branch/patch to OV Orchestrator.
diff --git a/.github/agents-prototype/skills/add-cpu-op/SKILL.md b/.github/agents-prototype/skills/add-cpu-op/SKILL.md
new file mode 100644
index 00000000000..c46a4e70ce3
--- /dev/null
+++ b/.github/agents-prototype/skills/add-cpu-op/SKILL.md
@@ -0,0 +1,21 @@
+---
+name: add-cpu-op
+description: Add a new operation to the OpenVINO CPU plugin — node registration, JIT/oneDNN executors (AVX2/AVX-512/AMX), and functional tests.
+---
+
+# Skill: Add CPU Op
+
+## When to use
+When the Core OpSpec agent has produced a new op spec and you need to implement
+CPU plugin support: node class, executor strategy, and single-layer tests.
+
+## Steps
+
+Execute in order — each step produces artifacts consumed by the next.
+
+| Step | File | Purpose |
+|---|---|---|
+| 1 | [step1-analysis.md](step1-analysis.md) | Read op spec, determine implementation strategy (reference / JIT / oneDNN), identify ISA targets and precision requirements |
+| 2 | [step2-implementation.md](step2-implementation.md) | Create node class (header + source), register in factory, hook up shape inference |
+| 3 | [step3-optimization.md](step3-optimization.md) | Write JIT executor (AVX2/AVX-512/AMX) or oneDNN-backed path; CpuParallel integration |
+| 4 | [step4-testing.md](step4-testing.md) | Shared single-layer tests, custom CPU tests, dynamic shapes |
diff --git a/.github/agents-prototype/skills/add-cpu-op/step1-analysis.md b/.github/agents-prototype/skills/add-cpu-op/step1-analysis.md
new file mode 100644
index 00000000000..29dc61ba9d0
--- /dev/null
+++ b/.github/agents-prototype/skills/add-cpu-op/step1-analysis.md
@@ -0,0 +1,161 @@
+# Skill: CPU Op Analysis
+
+> Agent: `cpu_agent` — Step 1 of 4
+
+## When to Use
+
+- A new operation needs to be enabled in the CPU plugin.
+- An existing CPU node needs to be updated (new opset version, missing precision,
+ dynamic shape support).
+- CPU inference fails with "not implemented" or unsupported-operation errors.
+
+## Prerequisites
+
+- Op name and opset version are known (from error context or task description).
+- The OpenVINO repository is checked out and buildable.
+
+## Procedure
+
+### Step 1: Locate the Core Op Definition
+
+Find the core op class to understand the operation's contract:
+
+```bash
+# Find the op header
+find src/core/include/openvino/op/ -iname "*<op_name>*"
+
+# Check which opset it belongs to
+grep -r "<OpName>" src/core/include/openvino/opsets/
+```
+
+Read the op header to extract:
+- **Inputs**: count, element types, shape constraints.
+- **Outputs**: count, element types, shape inference rules.
+- **Attributes**: names, types, defaults.
+- **Base class**: `Op`, `util::UnaryElementwiseArithmetic`, etc.
+
+### Step 2: Locate the Reference Implementation
+
+The reference implementation may reside in one of two places:
+
+**a) Standalone reference function:**
+```bash
+find src/core/reference/include/openvino/reference/ -iname "*<op_name>*"
+```
+
+**b) Inside the op's `evaluate()` method:**
+Check the op header or source — many ops implement `evaluate()` directly,
+which contains the reference algorithm. This is the method called by the
+`Reference` fallback node.
+
+```bash
+grep -n "evaluate" src/core/include/openvino/op/<op_name>.hpp
+grep -rn "evaluate" src/core/src/op/<op_name>.cpp
+```
+
+Read the reference implementation (whichever location) to understand:
+- Algorithm complexity (element-wise, reduction, convolution-like, etc.).
+- Data type handling (templated on element type or generic).
+- Whether it supports dynamic output shapes.
+
+### Step 3: Check if the Op Already Has a CPU Node
+
+```bash
+# Check if a node exists
+find src/plugins/intel_cpu/src/nodes/ -iname "*<op_name>*"
+
+# Check Type enum
+grep -n "<OpName>\|<op_name>" src/plugins/intel_cpu/src/cpu_types.h
+
+# Check factory registration
+grep -n "<OpName>\|<op_name>" src/plugins/intel_cpu/src/nodes_factory.cpp
+```
+
+If a dedicated node **already exists**, determine what needs updating:
+- Missing precision support?
+- Missing dynamic shape support?
+- Performance issue requiring JIT optimisation?
+
+If **no dedicated node exists**, the op currently runs through the `Reference`
+fallback node (if it has `evaluate()` implemented). However, not all reference
+implementations are compiled into the shared libraries — some may be excluded
+by selective build. A dedicated CPU node should implement its own optimised C++
+(cache-aware memory access, `CpuParallel` parallelisation, function inlining).
+The core reference (from `ov::reference::` or the op's `evaluate()` method)
+should be reused only if it already meets these performance criteria.
+
+### Step 4: Determine Implementation Strategy
+
+Choose one of these approaches based on the op characteristics:
+
+| Strategy | When to Use | Example Ops |
+|----------|-------------|-------------|
+| **Reference-only** | Simple ops where `Reference` fallback is sufficient; op is rarely used or not perf-critical | `Eye`, `Bucketize` |
+| **Portable C++ with CpuParallel** | Trivially parallelisable, no SIMD benefit, moderate perf needs. Directly in the node's `execute()` method. | `SegmentMax`, `SearchSorted` |
+| **Executor-based** | **Default for any op more complex than portable C++.** Must be used whenever JIT kernels, oneDNN primitives, ISA-specific paths (x64/ARM/RISC-V), or multiple backend implementations are involved. | `FullyConnected`, `Convolution`, `Eltwise`, `Interpolate`, `Reduce`, `Pooling` |
+
+> **Key rule:** The executor-based approach is the standard architecture for new
+> CPU nodes. Even JIT-optimised and oneDNN-backed ops use the executor framework
+> — the JIT kernel becomes an `ExecutorType::Jit` implementation, the oneDNN
+> primitive becomes an `ExecutorType::Dnnl` implementation, and a portable C++
+> reference becomes an `ExecutorType::Reference` fallback. Study
+> `eltwise_implementations.cpp`, `fullyconnected_implementations.cpp`, and
+> `convolution_implementations.cpp` as canonical examples.
+
+Decision criteria:
+1. **Is the op trivially simple and not perf-critical?** → Portable C++ in `execute()` with `CpuParallel` may suffice (no executor needed).
+2. **Does the op benefit from JIT / SIMD / oneDNN / vendor libraries?** → Must use executor framework. JIT kernels, oneDNN primitives, and ACL/MLAS are registered as separate `ExecutorImplementation` entries.
+3. **Does the op support multiple ISA or platform targets?** → Must use executor framework so it can automatically choose between JIT/Dnnl/ACL/Reference.
+4. **Is dynamic output shape data-dependent?** → Needs custom `needShapeInfer()`.
+5. **Do output shapes depend on the operation results?** → Use `InternalDynShapeInferFactory()` and update shape in `execute()`.
+
+### Step 5: Identify Supported Precisions and Layouts
+
+Standard precision support matrix:
+
+| Precision | Common Support | Notes |
+|-----------|---------------|-------|
+| `f32` | Always | Baseline precision |
+| `bf16` | If ISA >= AVX-512 BF16 | Check `mayiuse(avx512_core_bf16)` |
+| `f16` | If ISA >= AVX-512 FP16 | Check `mayiuse(avx512_core_fp16)` |
+| `i8` / `u8` | For quantized ops | INT8 path |
+| `i32` / `i64` | For index/integer ops | Index types |
+
+Standard layout types for `addSupportedPrimDesc`:
+
+| Layout | Constant | Use Case |
+|--------|----------|----------|
+| Planar (NCHW) | `LayoutType::ncsp` | Default, always supported |
+| Channels-last (NHWC) | `LayoutType::nspc` | Conv, Pooling adjacency |
+
+### Step 6: Check for Existing Transformations
+
+```bash
+grep -r "<OpName>" src/plugins/intel_cpu/src/transformations/
+```
+
+Some ops are decomposed or fused by CPU-specific transformations before reaching
+the node layer. Understand these to avoid duplicating logic.
+
+## Output
+
+Return an analysis summary:
+
+```
+op_name: <name>
+opset_version: <vX>
+core_op_class: <ov::op::vX::OpName>
+reference_impl: <path or "none">
+existing_cpu_node: <path or "none">
+strategy: <reference-only | reference+parallel | jit-optimized | onednn-backed | executor-based>
+inputs: <list of {name, type, shape_info}>
+outputs: <list of {name, type, shape_info}>
+attributes: <list of {name, type, default}>
+precisions: <list of supported element types>
+layouts: <list of supported layout types>
+dynamic_shapes: <full | partial | static-only>
+target_isa: <list of ISA levels to target>
+transformations: <list of relevant CPU transformations or "none">
+```
+
+Proceed to **cpu_op_implementation** skill.
diff --git a/.github/agents-prototype/skills/add-cpu-op/step2-implementation.md b/.github/agents-prototype/skills/add-cpu-op/step2-implementation.md
new file mode 100644
index 00000000000..8c8d9bbe2b8
--- /dev/null
+++ b/.github/agents-prototype/skills/add-cpu-op/step2-implementation.md
@@ -0,0 +1,792 @@
+# Skill: CPU Op Implementation
+
+> Agent: `cpu_agent` — Step 2 of 4
+
+## Prerequisites
+
+- Completed **cpu_op_analysis** skill — op name, strategy, precisions, layouts,
+ and shape inference approach are determined.
+- Core op class exists in `src/core/include/openvino/op/`.
+- Reference implementation exists in `src/core/reference/include/openvino/reference/`
+ and/or inside the core op's `evaluate()` method.
+
+## Fast Path: Eltwise Node (Unary Elementwise Ops)
+
+If the new op is a **simple unary elementwise** op (one input tensor → one output tensor, element-by-element, no attributes), the fastest path is to wire it through the **existing `Eltwise` node** instead of creating a new CPU node class. This avoids writing node boilerplate while still getting JIT emitter support and eltwise fusion chains.
+
+### Files to Update (Eltwise path)
+
+| File | Change |
+|------|--------|
+| `src/plugins/intel_cpu/src/cpu_types.h` | Add `EltwiseOpName` to the `Algorithm` enum |
+| `src/plugins/intel_cpu/src/cpu_types.cpp` | Add string name mapping in `algToString` |
+| `src/plugins/intel_cpu/src/nodes/eltwise.cpp` | Map `ov::op::vX::OpName` → `Algorithm::EltwiseOpName` in `getAlgorithmFor`; add 1-input count entry |
+| `src/plugins/intel_cpu/src/nodes/executors/ref/eltwise.cpp` | Add scalar reference case in the `switch` statement |
+| `src/plugins/intel_cpu/src/post_ops.hpp` | Add `OpName` to `ActivationPostOp::Type` enum |
+| `src/plugins/intel_cpu/src/post_ops.cpp` | Add bidirectional mapping `EltwiseOpName` ↔ `ActivationPostOp::Type::OpName` |
+| `src/plugins/intel_cpu/src/nodes/kernels/x64/jit_uni_eltwise_generic.cpp` | Register new emitter class |
+| `src/plugins/intel_cpu/src/nodes/kernels/aarch64/jit_uni_eltwise_generic.cpp` | Register new emitter class |
+| `src/plugins/intel_cpu/src/nodes/kernels/riscv64/jit_uni_eltwise_generic.cpp` | Register new emitter class |
+| `src/plugins/intel_cpu/src/emitters/snippets/x64/cpu_generator.cpp` | Register for snippets JIT |
+| `src/plugins/intel_cpu/src/emitters/snippets/aarch64/cpu_generator.cpp` | Register for snippets JIT |
+| `src/plugins/intel_cpu/src/emitters/snippets/riscv64/cpu_generator.cpp` | Register for snippets JIT |
+| `src/plugins/intel_cpu/src/nodes/executors/jit/eltwise.cpp` | Remove op from the JIT exclusion list (if present) |
+
+### JIT Emitter Files to Create
+
+| File | Change |
+|------|--------|
+| `src/plugins/intel_cpu/src/emitters/plugin/x64/jit_eltwise_emitters.hpp` | Declare `jit_<op_name>_emitter` class |
+| `src/plugins/intel_cpu/src/emitters/plugin/x64/jit_eltwise_emitters.cpp` | Implement emitter + register table entries |
+| `src/plugins/intel_cpu/src/emitters/plugin/aarch64/jit_eltwise_emitters.hpp` | Same for aarch64 |
+| `src/plugins/intel_cpu/src/emitters/plugin/aarch64/jit_eltwise_emitters.cpp` | Same for aarch64 |
+| `src/plugins/intel_cpu/src/emitters/plugin/riscv64/jit_eltwise_emitters.hpp` | Same for riscv64 |
+| `src/plugins/intel_cpu/src/emitters/plugin/riscv64/jit_eltwise_emitters.cpp` | Same for riscv64 |
+
+### Checking oneDNN Post-Op Support
+
+Before implementing a JIT emitter, check if oneDNN already supports the op as a post-op. If it does, the `post_ops.hpp/cpp` wiring alone may be sufficient for post-op fusion chains.
+
+## File Structure
+
+All files follow **`snake_case`** for filenames, **`CamelCase`** for class names.
+The build system uses `file(GLOB_RECURSE)` — new files under `src/` are
+automatically picked up by CMake. No CMakeLists.txt edits needed for source files.
+
+### Files to Create
+
+| File | Purpose |
+|------|---------|
+| `src/plugins/intel_cpu/src/nodes/<op_name>.h` | Node class header |
+| `src/plugins/intel_cpu/src/nodes/<op_name>.cpp` | Node class implementation |
+
+### Files to Create (Executor-based ops — any op more complex than portable C++)
+
+| File | Purpose |
+|------|---------|
+| `src/plugins/intel_cpu/src/nodes/executors/<op_name>_config.hpp` | `OpNameAttrs` struct + `OpNameConfig` alias |
+| `src/plugins/intel_cpu/src/nodes/executors/<op_name>_implementations.cpp` | `getImplementations<OpNameAttrs>()` specialisation |
+| `src/plugins/intel_cpu/src/nodes/executors/implementations.hpp` | (update) Add `getImplementations<OpNameAttrs>()` declaration |
+
+### Files to Update
+
+| File | Change |
+|------|--------|
+| `src/plugins/intel_cpu/src/cpu_types.h` | Add entry to `Type` enum |
+| `src/plugins/intel_cpu/src/cpu_types.cpp` | Add string-to-Type mapping + `CASE` macro |
+| `src/plugins/intel_cpu/src/nodes_factory.cpp` | Register node via `INTEL_CPU_NODE` macro |
+
+### Optional Files (if needed)
+
+| File | When |
+|------|------|
+| `src/plugins/intel_cpu/src/shape_inference/custom/<op_name>.hpp` | Custom shape inference factory |
+| `src/plugins/intel_cpu/src/shape_inference/custom/<op_name>.cpp` | Custom shape inference implementation |
+| `src/plugins/intel_cpu/src/nodes/kernels/x64/<op_name>_kernel.hpp` | JIT kernel header (Step 3) |
+| `src/plugins/intel_cpu/src/nodes/kernels/x64/<op_name>_kernel.cpp` | JIT kernel implementation (Step 3) |
+
+## Step-by-Step Implementation
+
+### 1. Add Type Enum Entry
+
+In `src/plugins/intel_cpu/src/cpu_types.h`, add the new type to the `Type` enum:
+
+```cpp
+enum class Type : uint8_t {
+ // ... existing entries ...
+ OpName, // <-- Add alphabetically or near related ops
+};
+```
+
+### 2. Add String-to-Type Mapping
+
+In `src/plugins/intel_cpu/src/cpu_types.cpp`, add the mapping in TWO places:
+
+**a) In the `type_to_name_tbl` map (op type string → Type enum):**
+
+```cpp
+{"OpName", Type::OpName},
+```
+
+**b) In the `type_to_str()` switch (Type enum → debug string), add a CASE:**
+
+```cpp
+CASE(OpName);
+```
+
+> **Note:** The string key in `type_to_name_tbl` must match the op's
+> `get_type_name()` return value exactly. Check the core op's `OPENVINO_OP("...")`
+> macro to find the correct string.
+
+### 3. Create the Node Header
+
+Create `src/plugins/intel_cpu/src/nodes/<op_name>.h`:
+
+```cpp
+// Copyright (C) 2018-2026 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#pragma once
+
+#include <memory>
+#include <oneapi/dnnl/dnnl_common.hpp>
+#include <string>
+
+#include "graph_context.h"
+#include "node.h"
+#include "openvino/core/node.hpp"
+
+namespace ov::intel_cpu::node {
+
+class OpName : public Node {
+public:
+ OpName(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr& context);
+
+ static bool isSupportedOperation(const std::shared_ptr<const ov::Node>& op,
+ std::string& errorMessage) noexcept;
+ void getSupportedDescriptors() override;
+ void initSupportedPrimitiveDescriptors() override;
+ void execute(const dnnl::stream& strm) override;
+ [[nodiscard]] bool created() const override;
+ [[nodiscard]] bool needPrepareParams() const override;
+ void executeDynamicImpl(const dnnl::stream& strm) override;
+
+private:
+ // Op-specific attributes
+ // Template helpers for type dispatch
+};
+
+} // namespace ov::intel_cpu::node
+```
+
+**Key decisions for the header:**
+
+| Question | If yes | If no |
+|----------|--------|-------|
+| Does the op need ISA-specific or multi-backend paths? | Use the Executor framework (`ExecutorFactory` + `ExecutorPtr`) — see section below | Use direct `execute()` with `OV_SWITCH` type dispatch |
+| Does the op need custom shape inference? | Add custom `ShapeInferFactory` | Use `NgraphShapeInferFactory` |
+| Does the op need `prepareParams()`? | Override `needPrepareParams` → `true` | Override → `false` |
+| Does the op data-dependent output shape? | Override `needShapeInfer()` | Don't override |
+
+### 4. Create the Node Source
+
+Create `src/plugins/intel_cpu/src/nodes/<op_name>.cpp`:
+
+```cpp
+// Copyright (C) 2018-2026 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#include "<op_name>.h"
+
+#include <cstddef>
+#include <memory>
+#include <oneapi/dnnl/dnnl_common.hpp>
+#include <string>
+
+#include "cpu_types.h"
+#include "graph_context.h"
+#include "memory_desc/cpu_memory_desc.h"
+#include "node.h"
+#include "onednn/iml_type_mapper.h"
+#include "openvino/core/except.hpp"
+#include "openvino/core/node.hpp"
+#include "openvino/core/type.hpp"
+#include "openvino/core/type/element_type.hpp"
+#include "openvino/op/<op_name>.hpp" // Core op header
+#include "openvino/reference/<op_name>.hpp" // Reference implementation
+#include "selective_build.h"
+#include "shape_inference/shape_inference_cpu.hpp"
+
+namespace ov::intel_cpu::node {
+
+// ═══════════════════════════════════════════════════════════════════
+// Constructor
+// ═══════════════════════════════════════════════════════════════════
+OpName::OpName(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr& context)
+ : Node(op, context, NgraphShapeInferFactory(op)) {
+ std::string errorMessage;
+ if (!isSupportedOperation(op, errorMessage)) {
+ OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
+ }
+ // Extract attributes from the core op:
+ // const auto typed_op = ov::as_type_ptr<const ov::op::vX::OpName>(op);
+ // m_attribute = typed_op->get_attribute();
+}
+
+// ═══════════════════════════════════════════════════════════════════
+// Supported Operation Check
+// ═══════════════════════════════════════════════════════════════════
+bool OpName::isSupportedOperation(const std::shared_ptr<const ov::Node>& op,
+ std::string& errorMessage) noexcept {
+ try {
+ if (!ov::is_type<ov::op::vX::OpName>(op)) {
+ errorMessage = "Only opsetX OpName operation is supported";
+ return false;
+ }
+ // Add additional checks: shape constraints, attribute values, etc.
+ } catch (...) {
+ return false;
+ }
+ return true;
+}
+
+// ═══════════════════════════════════════════════════════════════════
+// Descriptor Setup
+// ═══════════════════════════════════════════════════════════════════
+void OpName::getSupportedDescriptors() {
+ // Validation is already done in the core op.
+ // Add CPU-specific validation here if needed.
+}
+
+void OpName::initSupportedPrimitiveDescriptors() {
+ if (!supportedPrimitiveDescriptors.empty()) {
+ return;
+ }
+
+ auto inputPrecision = getOriginalInputPrecisionAtPort(0);
+ auto outputPrecision = getOriginalOutputPrecisionAtPort(0);
+
+ // Constrain to supported precisions
+ if (none_of(inputPrecision,
+ ov::element::f32,
+ ov::element::bf16, // requires avx512_core_bf16
+ ov::element::f16,
+ ov::element::i32)) {
+ inputPrecision = ov::element::f32;
+ }
+
+ // Register supported primitive descriptors with layout+precision
+ addSupportedPrimDesc(
+ {{LayoutType::ncsp, inputPrecision}}, // inputs
+ {{LayoutType::ncsp, outputPrecision}}, // outputs
+ impl_desc_type::ref); // implementation type
+}
+
+// ═══════════════════════════════════════════════════════════════════
+// Execution
+// ═══════════════════════════════════════════════════════════════════
+bool OpName::created() const {
+ return getType() == Type::OpName;
+}
+
+bool OpName::needPrepareParams() const {
+ return false;
+}
+
+void OpName::executeDynamicImpl(const dnnl::stream& strm) {
+ execute(strm);
+}
+
+void OpName::execute([[maybe_unused]] const dnnl::stream& strm) {
+ // Option A: Call the reference implementation directly
+ // ov::reference::op_name(getSrcDataAtPortAs<const T>(0),
+ // getDstDataAtPortAs<T>(0),
+ // ov::Shape{getSrcMemoryAtPort(0)->getStaticDims()},
+ // /* attributes */);
+
+ // Option B: Use OV_SWITCH for type dispatch
+ // (see SearchSorted or SegmentMax for pattern)
+}
+
+} // namespace ov::intel_cpu::node
+```
+
+### 5. Register in Node Factory
+
+In `src/plugins/intel_cpu/src/nodes_factory.cpp`:
+
+**a) Add the include:**
+
+```cpp
+#include "nodes/<op_name>.h"
+```
+
+**b) Add the registration macro in `NodesFactory::NodesFactory()`:**
+
+```cpp
+INTEL_CPU_NODE(OpName, Type::OpName);
+```
+
+> **Architecture-specific registration:** If the node is only supported on
+> x86-64 (e.g., has JIT kernels), wrap both the include and registration in:
+> ```cpp
+> #if defined(OPENVINO_ARCH_X86_64)
+> INTEL_CPU_NODE(OpName, Type::OpName);
+> #endif
+> ```
+
+### 6. Shape Inference
+
+**Standard ops** — Use `NgraphShapeInferFactory(op)` in the constructor (default).
+This delegates to the core op's `validate_and_infer_types()`.
+
+**Custom shape inference** — When the core shape inference is insufficient or when
+output shapes depend on input data at runtime:
+
+Create `src/plugins/intel_cpu/src/shape_inference/custom/<op_name>.hpp`:
+
+```cpp
+#pragma once
+
+#include <memory>
+#include <utility>
+
+#include "openvino/core/node.hpp"
+#include "shape_inference/shape_inference_cpu.hpp"
+
+namespace ov::intel_cpu::node {
+
+class OpNameShapeInferFactory : public ShapeInferFactory {
+public:
+ explicit OpNameShapeInferFactory(std::shared_ptr<ov::Node> op) : m_op(std::move(op)) {}
+ [[nodiscard]] ShapeInferPtr makeShapeInfer() const override;
+
+private:
+ std::shared_ptr<ov::Node> m_op;
+};
+
+} // namespace ov::intel_cpu::node
+```
+
+Then in the node constructor, use `OpNameShapeInferFactory(op)` instead of
+`NgraphShapeInferFactory(op)`.
+
+### 7. Dynamic Shapes Support
+
+Dynamic shapes are a **mandatory** requirement for new CPU node implementations.
+
+Key methods to implement:
+
+| Method | Purpose |
+|--------|---------|
+| `executeDynamicImpl(strm)` | Called during dynamic-shape execution. Usually delegates to `execute(strm)`. |
+| `needPrepareParams()` | Return `true` if internal state (e.g., JIT kernel) must be rebuilt when shapes change. |
+| `needShapeInfer()` | Override if output shape depends on input **data** (not just input shapes). |
+| `createPrimitive()` | Called once after shapes are resolved. Allocate JIT kernels here (with caching). |
+
+**Pattern for data-dependent output shapes** (see `SegmentMax` for reference):
+
+```cpp
+bool OpName::needShapeInfer() const {
+ if (inputShapesModified()) {
+ return true;
+ }
+ // Check if data that affects output shape has changed
+ // Compare against cached values
+ return false;
+}
+```
+
+### 8. Build Verification
+
+```bash
+cd build
+cmake --build . --target ov_cpu_func_tests -j$(nproc) 2>&1 | tail -20
+# Or for a quicker check:
+cmake --build . --target openvino_intel_cpu_plugin -j$(nproc) 2>&1 | tail -20
+```
+
+Verify no compilation errors before proceeding.
+
+## Type Dispatch Pattern (OV_SWITCH — Mandatory for Conditional Compilation)
+
+For ops that need to handle multiple element types, **always** use the `OV_SWITCH`
+macro for precision dispatch. This is **required** for the CPU plugin's
+conditional compilation feature — `OV_SWITCH` allows the build system to
+eliminate unused type specialisations at compile time, reducing binary size.
+
+**Do NOT** use manual `if/else` or `switch` chains on element type — they break
+conditional compilation.
+
+```cpp
+namespace {
+struct OpNameContext {
+ OpName& node;
+};
+} // namespace
+
+template <class T>
+struct OpName::OpNameExecute {
+ void operator()(OpNameContext& ctx) {
+ ctx.node.executeImpl<T>();
+ }
+};
+
+void OpName::execute([[maybe_unused]] const dnnl::stream& strm) {
+ auto precision = getParentEdgeAt(0)->getMemory().getDesc().getPrecision();
+ OpNameContext ctx = {*this};
+ OV_SWITCH(intel_cpu,
+ OpNameExecute,
+ ctx,
+ precision,
+ OV_CASE(ov::element::f32, float),
+ OV_CASE(ov::element::bf16, ov::bfloat16),
+ OV_CASE(ov::element::f16, ov::float16),
+ OV_CASE(ov::element::i32, int32_t))
+}
+```
+
+## Executor Pattern (Standard Architecture for Non-Trivial Ops)
+
+The executor framework is the **standard architecture** for any CPU node that is
+more complex than simple portable C++ code. This includes ops with:
+- JIT kernels (these become `ExecutorType::Jit` implementations)
+- oneDNN primitives (these become `ExecutorType::Dnnl` implementations)
+- Multiple backend targets (x64/ARM/RISC-V)
+- Any ISA-specific optimisation
+
+Study these canonical implementations in this order:
+1. `eltwise_implementations.cpp` — simplest executor pattern (Jit + ACL + Reference)
+2. `fullyconnected_implementations.cpp` — full-featured (MLAS, 1x1conv, ACL, KleidiAI, oneDNN)
+3. `convolution_implementations.cpp` — layout-aware implementations with `MemoryFormatFilter`
+
+### Architecture Overview
+
+```
+Node (e.g. Eltwise, FullyConnected, Convolution)
+ ├── OpNameAttrs (op config struct: <op_name>_config.hpp)
+ ├── MemoryArgs memory (maps ARG_SRC/ARG_DST/... → MemoryPtr)
+ ├── ExecutorFactoryPtr<OpNameAttrs> factory
+ │ ├── filters ExecutorImplementation<Attrs> list by:
+ │ │ ├── supports(config, memoryFormatFilter) — ISA, precision, layout
+ │ │ ├── createOptimalConfig(config) — preferred memory format
+ │ │ └── acceptsShape(attrs, memory) — shape-dependent heuristics
+ │ └── make(memory) → returns ExecutorPtr or VariableExecutor
+ └── ExecutorPtr executor
+ ├── update(memory) — called in prepareParams()
+ └── execute(memory) — called in execute()
+```
+
+### Step 1: Define the Attrs Struct
+
+Create `src/plugins/intel_cpu/src/nodes/executors/<op_name>_config.hpp`:
+
+```cpp
+// Copyright (C) 2018-2026 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#pragma once
+
+#include "executor_config.hpp"
+#include "post_ops.hpp" // if post-ops fusion is supported
+
+namespace ov::intel_cpu {
+
+struct OpNameAttrs {
+ // Op-specific attributes needed by all implementations.
+ // Examples: float epsilon; int axis; bool keep_dims;
+ PostOps postOps; // include if the op supports post-op fusion
+};
+
+using OpNameConfig = executor::Config<OpNameAttrs>;
+
+} // namespace ov::intel_cpu
+```
+
+### Step 2: Register the `getImplementations` Specialisation
+
+**a) Declare in `implementations.hpp`** — add alongside existing declarations:
+
+```cpp
+// OpName
+template <>
+const std::vector<ExecutorImplementation<OpNameAttrs>>& getImplementations();
+```
+
+**b) Define in `<op_name>_implementations.cpp`:**
+
+The file registers all implementation variants in **priority order** (highest
+first). Each entry uses an `OV_CPU_INSTANCE_*` macro that conditionally compiles
+the implementation based on the target architecture:
+
+| Macro | Active When |
+|-------|-------------|
+| `OV_CPU_INSTANCE_COMMON(...)` | Always (portable code) |
+| `OV_CPU_INSTANCE_X64(...)` | x86-64 only |
+| `OV_CPU_INSTANCE_DNNL_X64(...)` | x86-64 with oneDNN |
+| `OV_CPU_INSTANCE_DNNL(...)` | Any arch with oneDNN |
+| `OV_CPU_INSTANCE_ACL(...)` | AArch64 with ARM Compute Library |
+| `OV_CPU_INSTANCE_KLEIDIAI(...)` | AArch64 with KleidiAI |
+| `OV_CPU_INSTANCE_MLAS_X64(...)` | x86-64 with MLAS |
+| `OV_CPU_INSTANCE_RISCV64(...)` | RISC-V 64 only |
+
+Each `ExecutorImplementation<Attrs>` has 6 fields:
+1. **name** — unique human-readable string (e.g. `"op_name_jit_ncsp"`)
+2. **ExecutorType** — `Jit`, `Dnnl`, `Acl`, `Reference`, etc.
+3. **OperationType** — `OperationType::OpName`
+4. **supports** — lambda returning `bool`. Use `VERIFY(condition, MESSAGE)` macro
+ for debuggable rejection. Can take `(const Config&)` or
+ `(const Config&, const MemoryFormatFilter&)`.
+5. **createOptimalConfig** — lambda returning `std::optional<Config>`. Return
+ `{}` (nullopt) if the current memory config is already acceptable. Use
+ `createOptimalConfigCommon()` helper with `TypeMapping` and `LayoutConfig`.
+6. **acceptsShape** — lambda `(const Attrs&, const MemoryArgs&) -> bool`. Pass
+ `AcceptsAnyShape<Attrs>` (or `{}`) for shape-agnostic implementations.
+7. **create** — lambda returning `ExecutorPtr`. Use `CreateDefault<Executor, Attrs>{}`
+ for simple cases or a custom lambda for complex wiring (e.g., `DnnlExecutor`).
+
+```cpp
+// Copyright (C) 2018-2026 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#include "nodes/executors/executor_implementation.hpp"
+#include "nodes/executors/implementations.hpp"
+#include "nodes/executors/implementation_utils.hpp"
+#include "nodes/executors/debug_messages.hpp"
+#include "nodes/executors/<op_name>_config.hpp"
+#include "nodes/executors/precision_translation.hpp"
+#include "nodes/executors/type_mask.hpp"
+#include "utils/arch_macros.h"
+
+// Include the actual executor headers:
+#include "nodes/executors/jit/<op_name>_jit.hpp" // JIT executor (x64)
+// #include "nodes/executors/acl/<op_name>_acl.hpp" // ACL executor (ARM)
+#include "nodes/executors/ref/<op_name>_ref.hpp" // Reference executor
+
+#if defined(OPENVINO_ARCH_X86_64)
+# include "cpu/x64/cpu_isa_traits.hpp"
+#endif
+
+namespace ov::intel_cpu {
+
+using namespace ov::element;
+using namespace TypeMaskAlias;
+using namespace executor;
+
+using LayoutConfig = std::vector<LayoutType>;
+
+// TypeMapping defines precision transformations per implementation.
+// Each row: {input_precisions..., output_precisions...} → {transform_functions...}
+// Transform helpers: bypass() = keep as-is, just<T>() = force to T, use<N>() = match arg N
+static const TypeMapping opNameTypeMapping {
+ // {src, dst} pt<src, dst>
+ {{_f32, _f32}, {bypass(), bypass()}},
+ {{_bf16, _bf16 | _f32}, {bypass(), bypass()}},
+ {{_any, _any}, {just<f32>(), just<f32>()}}, // fallback
+};
+
+static const MappingNotation opNameMappingNotation {
+ {ARG_SRC, 0},
+ {ARG_DST, 1},
+};
+
+// to keep OV_CPU_INSTANCE macros aligned
+// clang-format off
+template <>
+const std::vector<ExecutorImplementation<OpNameAttrs>>& getImplementations() {
+ static const std::vector<ExecutorImplementation<OpNameAttrs>> implementations {
+ OV_CPU_INSTANCE_X64(
+ "op_name_jit_ncsp",
+ ExecutorType::Jit,
+ OperationType::OpName,
+ [](const OpNameConfig& config) -> bool {
+ VERIFY(dnnl::impl::cpu::x64::mayiuse(
+ dnnl::impl::cpu::x64::avx2), UNSUPPORTED_ISA);
+ // Add precision / attr checks as needed
+ return true;
+ },
+ // createOptimalConfig
+ [](const OpNameConfig& config) -> std::optional<OpNameConfig> {
+ return createOptimalConfigCommon(config,
+ opNameTypeMapping,
+ LayoutConfig{LayoutType::ncsp, LayoutType::ncsp},
+ opNameMappingNotation);
+ },
+ AcceptsAnyShape<OpNameAttrs>,
+ CreateDefault<JitOpNameExecutor, OpNameAttrs>{}
+ )
+ OV_CPU_INSTANCE_COMMON(
+ "op_name_ref_ncsp",
+ ExecutorType::Reference,
+ OperationType::OpName,
+ [](const OpNameConfig& config) -> bool { return true; },
+ [](const OpNameConfig& config) -> std::optional<OpNameConfig> {
+ return createOptimalConfigCommon(config,
+ opNameTypeMapping,
+ LayoutConfig{LayoutType::ncsp, LayoutType::ncsp},
+ opNameMappingNotation);
+ },
+ AcceptsAnyShape<OpNameAttrs>,
+ CreateDefault<RefOpNameExecutor, OpNameAttrs>{}
+ )
+ };
+ return implementations;
+}
+// clang-format on
+
+} // namespace ov::intel_cpu
+```
+
+### Step 3: Implement the Concrete Executor Classes
+
+Each executor implements the `Executor` base class from `executor.hpp`:
+
+```cpp
+class Executor {
+public:
+ virtual bool update(const MemoryArgs& memory) = 0; // reshape / re-init
+ virtual void execute(const MemoryArgs& memory) = 0; // run computation
+ virtual impl_desc_type implType() const = 0; // report impl type
+ virtual ~Executor() = default;
+};
+```
+
+**Reference executor** (portable C++):
+
+```cpp
+class RefOpNameExecutor : public Executor {
+public:
+ RefOpNameExecutor(const OpNameAttrs& attrs,
+ const MemoryArgs& memory,
+ const ExecutorContext::CPtr& context);
+ bool update(const MemoryArgs& memory) override;
+ void execute(const MemoryArgs& memory) override;
+ impl_desc_type implType() const override { return impl_desc_type::ref; }
+};
+```
+
+**JIT executor** (wraps JIT kernel + CpuParallel):
+
+```cpp
+class JitOpNameExecutor : public Executor {
+public:
+ JitOpNameExecutor(const OpNameAttrs& attrs,
+ const MemoryArgs& memory,
+ const ExecutorContext::CPtr& context);
+ bool update(const MemoryArgs& memory) override;
+ void execute(const MemoryArgs& memory) override;
+ impl_desc_type implType() const override { return impl_desc_type::jit_avx2; }
+private:
+ std::shared_ptr<JitKernelBase> m_kernel;
+ // ... kernel compile params, context, etc.
+};
+```
+
+### Step 4: Wire the Node to Use ExecutorFactory
+
+In the **node header**, replace direct `execute()` logic with executor fields:
+
+```cpp
+#include "nodes/executors/executor.hpp"
+#include "nodes/executors/executor_factory.hpp"
+#include "nodes/executors/<op_name>_config.hpp"
+#include "nodes/executors/memory_arguments.hpp"
+
+// Inside the class:
+private:
+ OpNameAttrs m_attrs;
+ MemoryArgs m_memory;
+ ExecutorFactoryPtr<OpNameAttrs> m_factory;
+ ExecutorPtr m_executor = nullptr;
+```
+
+In **`initSupportedPrimitiveDescriptors()`** (follows `conv.cpp` pattern):
+
+```cpp
+void OpName::initSupportedPrimitiveDescriptors() {
+ // 1. Populate m_attrs from the core op
+ // m_attrs.epsilon = ...; m_attrs.axis = ...;
+ // m_attrs.postOps = getPostOps(fusedWith);
+
+ // 2. Build memory descriptors per port
+ const auto& creatorsMap = BlockedDescCreator::getCommonCreators();
+ VecMemoryDescs srcDescs;
+ for (size_t i = 0; i < getOriginalInputsNumber(); i++) {
+ srcDescs.push_back(creatorsMap.at(LayoutType::ncsp)->createSharedDesc(
+ getOriginalInputPrecisionAtPort(i), getInputShapeAtPort(i)));
+ }
+ auto dstDesc = creatorsMap.at(LayoutType::ncsp)->createSharedDesc(
+ getOriginalOutputPrecisionAtPort(0), getOutputShapeAtPort(0));
+
+ MemoryDescArgs descs{
+ {ARG_SRC, srcDescs[0]},
+ {ARG_DST, dstDesc},
+ };
+
+ // 3. Create executor factory — this filters & ranks implementations
+ auto executionContext = std::make_shared<ExecutorContext>(
+ context, getImplPriority());
+ m_factory = std::make_shared<ExecutorFactory<OpNameAttrs>>(
+ m_attrs, executionContext, descs);
+
+ // 4. Let factory decide optimal memory descriptors
+ const auto nodeDescList = m_factory->getProperMemoryDescriptors(descs);
+ for (const auto& nodeDescs : nodeDescList) {
+ NodeConfig nodeConfig;
+ nodeConfig.inConfs.resize(srcDescs.size());
+ // ... populate from nodeDescs (see conv.cpp / fc.cpp pattern) ...
+ nodeConfig.outConfs.emplace_back(nodeDescs.at(ARG_DST));
+ supportedPrimitiveDescriptors.emplace_back(nodeConfig, impl_desc_type::undef);
+ }
+}
+```
+
+In **`prepareParams()`**:
+
+```cpp
+void OpName::prepareParams() {
+ m_memory[ARG_SRC] = getSrcMemoryAtPort(0);
+ m_memory[ARG_DST] = getDstMemoryAtPort(0);
+
+ if (!m_executor) {
+ m_executor = m_factory->make(m_memory);
+ }
+ m_executor->update(m_memory);
+}
+```
+
+In **`execute()`**:
+
+```cpp
+void OpName::execute([[maybe_unused]] const dnnl::stream& strm) {
+ m_executor->execute(m_memory);
+}
+```
+
+### Key Executor Framework Utilities
+
+| Utility | Location | Purpose |
+|---------|----------|---------|
+| `VERIFY(cond, msg)` | `debug_messages.hpp` | Debug-logged rejection in `supports()` |
+| `TypeMapping` / `MappingNotation` | `precision_translation.hpp` | Precision transform rules |
+| `createOptimalConfigCommon()` | `implementation_utils.hpp` | Standard config optimisation |
+| `AcceptsAnyShape<Attrs>` | `implementation_utils.hpp` | Shape-agnostic stub |
+| `HasNoOptimalConfig<Attrs>` | `implementation_utils.hpp` | No config override stub |
+| `SupportsAnyConfig<Attrs>` | `implementation_utils.hpp` | Unconditional support stub |
+| `CreateDefault<Executor, Attrs>` | `implementation_utils.hpp` | Simple `make_shared` factory |
+| `CreateDnnlDefault<Prim, Attrs>` | `implementation_utils.hpp` | `DnnlExecutor` wrapper factory |
+| `OV_CPU_INSTANCE_*` macros | `utils/arch_macros.h` | Conditional compilation per arch |
+
+> **Key advantage:** The `ExecutorFactory` automatically handles runtime
+> selection between JIT / oneDNN / ACL / Reference implementations based on
+> hardware capabilities, precision matching, and memory format preferences.
+> When multiple implementations match, `VariableExecutor` handles fallback.
+> The `OV_CPU_INSTANCE_*` macros ensure that code for unavailable platforms is
+> compiled away, supporting the conditional compilation infrastructure.
+
+## Code Quality Checklist
+
+Before proceeding to the next step, verify:
+
+- [ ] `clang-format` passes: code follows `src/.clang-format` rules
+ (Google style, 4-space indent, 120 col limit).
+- [ ] `clang-tidy` passes: code follows `src/plugins/intel_cpu/src/.clang-tidy`
+ rules.
+- [ ] Copyright header is present on all new files.
+- [ ] SPDX license identifier: `Apache-2.0`.
+- [ ] Namespace is `ov::intel_cpu::node`.
+- [ ] `[[nodiscard]]` on const getter methods.
+- [ ] `[[maybe_unused]]` on `const dnnl::stream& strm` in `execute()` when
+ the stream is not used.
+- [ ] No raw `new` / `delete` — use smart pointers.
+- [ ] No `using namespace std;` or similar broad using-directives.
+
+## Output
+
+- All source files created/updated per the file structure above.
+- Build compiles without errors.
+- Proceed to **cpu_op_optimization** skill.
diff --git a/.github/agents-prototype/skills/add-cpu-op/step3-optimization.md b/.github/agents-prototype/skills/add-cpu-op/step3-optimization.md
new file mode 100644
index 00000000000..94c06859803
--- /dev/null
+++ b/.github/agents-prototype/skills/add-cpu-op/step3-optimization.md
@@ -0,0 +1,344 @@
+# Skill: CPU Op Optimization
+
+> Agent: `cpu_agent` — Step 3 of 4
+
+## Prerequisites
+
+- Completed **cpu_op_implementation** skill — node class compiles and executes
+ via reference implementation.
+- ISA targets and implementation strategy determined in **cpu_op_analysis**.
+
+## When to Apply
+
+This step is **mandatory** for performance-critical ops (element-wise, reductions,
+attention, normalization). It may be **skipped** for simple ops where the reference
+implementation is sufficient (mark the Step 3 checkpoint or step-local status as
+`skipped`; the final job `status` should still be `success` if implementation and
+tests pass).
+
+Skip criteria:
+- Op is rarely used in production models.
+- Reference implementation already meets performance requirements.
+- Op is pure data movement (handled efficiently by `Reorder` or `Reshape`).
+
+## Optimization Techniques
+
+All optimization techniques described below are used **inside executor
+implementations**. The executor framework handles ISA dispatch, fallback
+ordering, and precision matching — see `cpu_op_implementation` skill for
+the full wiring pattern. This skill focuses on the code that goes **inside**
+each executor class.
+
+### CpuParallel Multithreading
+
+The simplest and most common optimization. Use `CpuParallel` (available via
+`context->getCpuParallel()`) to parallelise the execution loop inside any
+executor — Reference, JIT, or oneDNN.
+
+**File:** `src/plugins/intel_cpu/src/cpu_parallel.hpp`
+
+**Available methods:**
+
+| Method | Signature | Use Case |
+|--------|-----------|----------|
+| `parallel_for` | `(D0, func(i))` | 1D iteration |
+| `parallel_for2d` | `(D0, D1, func(i, j))` | 2D iteration |
+| `parallel_for3d` | `(D0, D1, D2, func(i, j, k))` | 3D iteration (batch × spatial) |
+| `parallel_for4d` | `(D0, D1, D2, D3, func(...))` | 4D (batch × channels × H × W) |
+| `parallel_for5d` | `(D0, D1, D2, D3, D4, func(...))` | 5D tensors |
+| `parallel_for6d` | `(D0, ..., D5, func(...))` | 6D tensors |
+| `parallel_sum` | `(D0, init, func(i))` | Parallel reduction |
+| `parallel_sum2d` | `(D0, D1, init, func(i, j))` | 2D parallel reduction |
+| `parallel_sum3d` | `(D0, D1, D2, init, func(i, j, k))` | 3D parallel reduction |
+| `parallel_simple` | `(nthr, func(ithr, nthr))` | Manual thread partitioning |
+
+**Example — element-wise op with CpuParallel inside a Reference executor:**
+
+```cpp
+void RefOpNameExecutor::execute(const MemoryArgs& memory) {
+ auto* src = memory.at(ARG_SRC)->getDataAs<const float>();
+ auto* dst = memory.at(ARG_DST)->getDataAs<float>();
+ auto total = memory.at(ARG_SRC)->getShape().getElementsCount();
+
+ m_context->getCpuParallel()->parallel_for(total, [&](size_t i) {
+ dst[i] = /* element-wise computation on */ src[i];
+ });
+}
+```
+
+**Example — batch-parallelised reduction:**
+
+```cpp
+const auto& shape = memory.at(ARG_SRC)->getStaticDims();
+auto batch = shape_size(shape) / shape.back();
+auto inner = shape.back();
+
+m_context->getCpuParallel()->parallel_for(batch, [&](size_t b) {
+ auto* row_src = src + b * inner;
+ auto* row_dst = dst + b * inner;
+ // Per-row reduction + normalization
+ float sum = 0.0f;
+ for (size_t i = 0; i < inner; i++) {
+ sum += row_src[i] * row_src[i];
+ }
+ float scale = 1.0f / std::sqrt(sum / inner + eps);
+ for (size_t i = 0; i < inner; i++) {
+ row_dst[i] = row_src[i] * scale;
+ }
+});
+```
+
+### Creating JIT Executor Implementations
+
+JIT kernels are **not** used directly from the node class. Instead, they are
+wrapped inside an executor class that implements the `Executor` interface and
+is registered as an `ExecutorType::Jit` entry in `<op_name>_implementations.cpp`.
+
+The ISA dispatch (`mayiuse(avx512_core)` vs `mayiuse(avx2)`) happens in the
+`supports()` predicate of the `ExecutorImplementation`, **not** in the node.
+
+**Study** `eltwise_implementations.cpp` — it shows Jit executors
+(`eltwise_jit_ncsp`, `eltwise_jit_nspc`) alongside Reference executors, all
+as `ExecutorImplementation<EltwiseAttrs>` entries.
+
+#### Step 1: Write the JIT Kernel
+
+**Directory:** `src/plugins/intel_cpu/src/nodes/kernels/x64/`
+
+```cpp
+// <op_name>_kernel.hpp
+#pragma once
+
+#include "nodes/kernels/x64/jit_kernel_base.hpp"
+
+namespace ov::intel_cpu::kernel {
+
+struct jit_<op_name>_compile_params {
+ ov::element::Type src_prc;
+ ov::element::Type dst_prc;
+ size_t data_size;
+ // Op-specific compile-time parameters
+};
+
+struct jit_<op_name>_call_args {
+ const uint8_t* src;
+ uint8_t* dst;
+ // Op-specific runtime arguments
+};
+
+template <dnnl::impl::cpu::x64::cpu_isa_t isa>
+class jit_<op_name>_kernel : public JitKernelBase {
+public:
+ DECLARE_CPU_JIT_AUX_FUNCTIONS(jit_<op_name>_kernel)
+
+ explicit jit_<op_name>_kernel(const jit_<op_name>_compile_params& jcp);
+ void generate() override;
+
+private:
+ jit_<op_name>_compile_params m_jcp;
+ // Register assignments, helper methods
+};
+
+} // namespace ov::intel_cpu::kernel
+```
+
+#### Step 2: Wrap the Kernel in a JIT Executor Class
+
+Place in `src/plugins/intel_cpu/src/nodes/executors/jit/<op_name>_jit.hpp`:
+
+```cpp
+#pragma once
+
+#include "nodes/executors/executor.hpp"
+#include "nodes/executors/<op_name>_config.hpp"
+#include "nodes/executors/executor_context.hpp"
+
+namespace ov::intel_cpu {
+
+class JitOpNameExecutor : public Executor {
+public:
+ JitOpNameExecutor(const OpNameAttrs& attrs,
+ const MemoryArgs& memory,
+ const ExecutorContext::CPtr& context);
+
+ bool update(const MemoryArgs& memory) override;
+ void execute(const MemoryArgs& memory) override;
+ impl_desc_type implType() const override { return impl_desc_type::jit_avx2; }
+
+private:
+ OpNameAttrs m_attrs;
+ ExecutorContext::CPtr m_context;
+ std::shared_ptr<kernel::JitKernelBase> m_kernel;
+ // ... cached shape info, working buffers
+};
+```
+
+The constructor creates / compiles the JIT kernel. `update()` re-compiles if
+shapes changed. `execute()` sets up call args and invokes the kernel inside
+a `CpuParallel` loop over the outer dimension.
+
+#### Step 3: Register in `<op_name>_implementations.cpp`
+
+```cpp
+OV_CPU_INSTANCE_X64(
+ "op_name_jit_ncsp",
+ ExecutorType::Jit,
+ OperationType::OpName,
+ [](const OpNameConfig& config) -> bool {
+ VERIFY(dnnl::impl::cpu::x64::mayiuse(
+ dnnl::impl::cpu::x64::avx2), UNSUPPORTED_ISA);
+ return true;
+ },
+ [](const OpNameConfig& config) -> std::optional<OpNameConfig> {
+ return createOptimalConfigCommon(config,
+ opNameTypeMapping,
+ LayoutConfig{LayoutType::ncsp, LayoutType::ncsp},
+ opNameMappingNotation);
+ },
+ AcceptsAnyShape<OpNameAttrs>,
+ CreateDefault<JitOpNameExecutor, OpNameAttrs>{}
+ )
+```
+
+For an AVX-512 variant, add a **second** entry before the AVX2 one (higher
+priority first) with `mayiuse(avx512_core)` in the `supports` predicate and
+a correspondingly wider implementation.
+
+**ISA-specific considerations:**
+
+| ISA | Vector Width | Key Features |
+|-----|-------------|--------------|
+| AVX2 | 256-bit (8×f32) | `ymm` registers, FMA, most common JIT baseline |
+| AVX-512 (Core) | 512-bit (16×f32) | `zmm` registers, mask registers, wider SIMD |
+| AVX-512 BF16 | 512-bit | `avx512_core_bf16` — required for BF16 compute |
+| AVX-512 VNNI | 512-bit | `vpdpbusd` for INT8 dot products |
+| AMX | Tile-based | `tdpbf16ps` / `tdpbssd` for matrix ops |
+
+> **Note:** SSE 4.2 is no longer a target ISA. The minimal baseline is portable
+> C++ code. JIT kernels start from AVX2.
+
+**Reference JIT executor implementations to study:**
+
+| Op | Executor | Key Pattern |
+|----|----------|-------------|
+| Eltwise | `EltwiseStatefulExecutor` (Jit + Ref) | Element-wise, multiple layouts |
+| RMSNorm | `nodes/kernels/x64/rms_kernel.hpp` | Reduction + normalize |
+| RoPE | `nodes/kernels/x64/rope_kernel.hpp` | Element-wise with indexing |
+
+### Creating oneDNN Executor Implementations
+
+For ops that map to oneDNN primitives (convolutions, matmul, pooling, softmax,
+layer normalization, etc.), create an `ExecutorType::Dnnl` implementation using
+the `DnnlExecutor` wrapper.
+
+**Study** `convolution_implementations.cpp` — it registers multiple oneDNN
+variants differentiated by memory layout (nspc, ncsp, nCsp16c, nCsp8c), each
+as a separate `ExecutorImplementation<ConvAttrs>`.
+
+#### DnnlExecutor Pattern
+
+Use the `CreateDnnlDefault<Primitive, Attrs>` helper to create a standard
+`DnnlExecutor` that wraps a oneDNN primitive:
+
+```cpp
+OV_CPU_INSTANCE_DNNL_X64(
+ "op_name_dnnl_nspc",
+ ExecutorType::Dnnl,
+ OperationType::OpName,
+ [](const OpNameConfig& config, const MemoryFormatFilter& filter) -> bool {
+ VERIFY(filter.isSuitableMemoryFormatFilter(
+ MemoryFormatFilter::nspc), UNSUPPORTED_MEMORY_FORMAT);
+ return true;
+ },
+ [](const OpNameConfig& config) -> std::optional<OpNameConfig> {
+ return createOptimalConfigCommon(config,
+ opNameDnnlTypeMapping,
+ LayoutConfig{LayoutType::nspc, LayoutType::nspc},
+ opNameMappingNotation);
+ },
+ AcceptsAnyShape<OpNameAttrs>,
+ CreateDnnlDefault<DnnlOpNamePrimitive, OpNameAttrs>{}
+ )
+```
+
+The `DnnlExecutor<Primitive, Attrs, ShapeAgnosticData>` template:
+- Calls `Primitive::createDescriptors()` to build oneDNN primitive descriptors
+- Manages primitive caching via `ExecutorContext`
+- Implements `update()` / `execute()` around the oneDNN primitive execution
+
+**Note:** `CreateDnnlDefault` accepts optional flags: `{cacheWeights, fc3Das2D}`.
+
+#### `MemoryFormatFilter`
+
+oneDNN implementations typically require specific memory layouts. Use the
+extended `supports` predicate form that takes `MemoryFormatFilter`:
+
+```cpp
+[](const OpNameConfig& config, const MemoryFormatFilter& filter) -> bool {
+ VERIFY(filter.isSuitableMemoryFormatFilter(
+ MemoryFormatFilter::nspc), UNSUPPORTED_MEMORY_FORMAT);
+ // additional ISA / precision checks
+ return true;
+}
+```
+
+## JIT Eltwise Emitters
+
+For ops routed through the `Eltwise` node (see "Fast Path" in [**cpu_op_implementation**](skills/add-cpu-op/step2-implementation.md)), JIT execution uses **eltwise emitter classes** rather than the executor framework. Each ISA has its own emitter base class.
+
+### Emitter Class Pattern
+
+```cpp
+// Header (jit_eltwise_emitters.hpp)
+class jit_<op_name>_emitter : public jit_emitter {
+public:
+ jit_<op_name>_emitter(dnnl::impl::cpu::x64::jit_generator* host,
+ dnnl::impl::cpu::x64::cpu_isa_t host_isa,
+ ov::element::Type exec_prc = ov::element::f32);
+
+ size_t get_inputs_count() const override { return 1; }
+
+private:
+ void emit_impl(const std::vector<size_t>& in_vec_idxs,
+ const std::vector<size_t>& out_vec_idxs) const override;
+ template <dnnl::impl::cpu::x64::cpu_isa_t isa>
+ void emit_isa(const std::vector<size_t>& in_vec_idxs,
+ const std::vector<size_t>& out_vec_idxs) const;
+ void register_table_entries() override;
+ size_t aux_vecs_count() const override; // return count of needed aux vmm registers
+};
+```
+
+### Coefficient Tables
+
+Use `push_arg_entry_of("name", hex_value, true)` in `register_table_entries()`:
+
+```cpp
+void jit_<op_name>_emitter::register_table_entries() {
+ // Float constants as hex IEEE 754
+ push_arg_entry_of("coeff_a", 0x3f800000, true); // 1.0f
+ push_arg_entry_of("abs_mask", 0x7fffffff, true); // strip sign bit
+ push_arg_entry_of("pos_inf", 0x7f800000, true); // +inf
+ push_arg_entry_of("qnan", 0x7fc00000, true); // quiet NaN
+}
+// Access in emit_isa: table_val("coeff_a")
+```
+
+## Functional Verification
+
+After optimization, verify correctness before proceeding to full testing:
+
+```bash
+# Quick functional check
+cd build
+cmake --build . --target ov_cpu_func_tests -j$(nproc)
+./bin/intel64/Release/ov_cpu_func_tests --gtest_filter=*<OpName>*
+```
+
+## Output
+
+- Optimized implementation with ISA-specific paths.
+- JIT kernels created (if applicable).
+- `CpuParallel` integration for multi-threaded execution.
+- Functional verification passes.
+- Proceed to **cpu_op_testing** skill.
diff --git a/.github/agents-prototype/skills/add-cpu-op/step4-testing.md b/.github/agents-prototype/skills/add-cpu-op/step4-testing.md
new file mode 100644
index 00000000000..7ab72c73409
--- /dev/null
+++ b/.github/agents-prototype/skills/add-cpu-op/step4-testing.md
@@ -0,0 +1,330 @@
+# Skill: CPU Op Testing
+
+> Agent: `cpu_agent` — Step 4 of 4
+
+## Prerequisites
+
+- Completed **cpu_op_implementation** — node compiles and has basic execution.
+- Completed **cpu_op_optimization** (or skipped if reference-only).
+
+## Test Categories
+
+### 1. Shared Single-Layer Tests (Mandatory)
+
+**Directory:** `src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/`
+
+These tests instantiate the shared OpenVINO layer tests that are common across
+all plugins (CPU, GPU, Template). They ensure the CPU implementation produces
+results consistent with the reference.
+
+Dynamic shape scenarios can also be tested via shared single-layer tests by
+using `ov::test::static_shapes_to_test_representation` with dynamic `InputShape`
+entries (e.g., `{{-1, -1}, {{1, 16}, {2, 32}}}`), not only static shapes.
+
+**File to create:** `<op_name>.cpp`
+
+**Pattern:**
+
+```cpp
+// Copyright (C) 2018-2026 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#include "single_op_tests/<op_name>.hpp"
+#include "common_test_utils/test_constants.hpp"
+
+namespace {
+using ov::test::OpNameLayerTest;
+
+const std::vector<ov::element::Type> model_types = {
+ ov::element::f32,
+ ov::element::bf16,
+ ov::element::f16,
+};
+
+const std::vector<std::vector<ov::Shape>> input_shapes_static = {
+ {{1, 16}},
+ {{2, 32}},
+ {{1, 3, 224, 224}},
+ {{2, 64, 7, 7}},
+};
+
+// Dynamic shapes can also be tested in shared tests using InputShape:
+// const std::vector<std::vector<InputShape>> input_shapes_dynamic = {
+// {{{-1, -1}, {{1, 16}, {2, 32}}}},
+// {{{{1, 4}, {16, 64}}, {{1, 16}, {4, 64}}}},
+// };
+
+const auto params = ::testing::Combine(
+ ::testing::ValuesIn(
+ ov::test::static_shapes_to_test_representation(input_shapes_static)),
+ ::testing::ValuesIn(model_types),
+ // Op-specific parameters
+ ::testing::Values(ov::test::utils::DEVICE_CPU)
+);
+
+INSTANTIATE_TEST_SUITE_P(smoke_OpName,
+ OpNameLayerTest,
+ params,
+ OpNameLayerTest::getTestCaseName);
+
+} // namespace
+```
+
+**Test naming:** Use the `smoke_` prefix for basic functionality tests,
+`nightly_` for exhaustive tests.
+
+### 2. Custom CPU Single-Layer Tests (Recommended)
+
+**Directory:** `src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/`
+
+These tests verify CPU-specific implementation details that shared tests don't
+cover:
+- Specific memory layouts (channels-last).
+- ISA-specific implementation selection (`jit_avx2`, `jit_avx512`).
+- Dynamic shape scenarios.
+- Edge cases specific to the CPU implementation.
+
+**File to create:** `<op_name>.cpp`
+
+**Pattern:**
+
+```cpp
+// Copyright (C) 2018-2026 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#include "shared_test_classes/base/ov_subgraph.hpp"
+#include "utils/cpu_test_utils.hpp"
+#include "utils/filter_cpu_info.hpp"
+#include "openvino/op/<op_name>.hpp"
+
+using namespace CPUTestUtils;
+
+namespace ov {
+namespace test {
+
+using OpNameLayerCPUTestParamSet = std::tuple<
+ InputShape, // Input shape (supports dynamic)
+ ElementType, // Input element type
+ // Op-specific attributes
+ CPUSpecificParams // CPU layout + implementation check
+>;
+
+class OpNameLayerCPUTest
+ : public testing::WithParamInterface<OpNameLayerCPUTestParamSet>,
+ virtual public ov::test::SubgraphBaseTest,
+ public CPUTestsBase {
+public:
+ static std::string getTestCaseName(
+ const testing::TestParamInfo<OpNameLayerCPUTestParamSet>& obj) {
+ const auto& [shapes, inType, /* attrs, */ cpuParams] = obj.param;
+ std::ostringstream results;
+ results << "IS=" << ov::test::utils::partialShape2str({shapes.first}) << "_";
+ results << "TS=";
+ for (const auto& item : shapes.second) {
+ results << ov::test::utils::vec2str(item) << "_";
+ }
+ results << "Prc=" << inType << "_";
+ results << CPUTestsBase::getTestCaseName(cpuParams);
+ return results.str();
+ }
+
+protected:
+ void SetUp() override {
+ const auto& [shapes, _inType, /* attrs, */ cpuParams] = this->GetParam();
+ inType = _inType;
+ std::tie(inFmts, outFmts, priority, selectedType) = cpuParams;
+ if (selectedType.empty()) {
+ selectedType = getPrimitiveType();
+ }
+ selectedType = makeSelectedTypeStr(selectedType, inType);
+ targetDevice = ov::test::utils::DEVICE_CPU;
+ init_input_shapes({shapes});
+
+ ov::ParameterVector params;
+ for (auto&& shape : inputDynamicShapes) {
+ params.push_back(
+ std::make_shared<ov::op::v0::Parameter>(inType, shape));
+ }
+ // Build the op graph
+ auto op = std::make_shared<ov::op::vX::OpName>(
+ params[0] /*, attributes */);
+ function = create_ov_model(inType, params, op, "OpName");
+ }
+};
+
+TEST_P(OpNameLayerCPUTest, CompareWithRefs) {
+ run();
+ CheckPluginRelatedResults(compiledModel, "OpName");
+}
+
+namespace {
+
+// ═══════════════════════════════════════════════════════════════════
+// CPU-Specific Parameters
+// ═══════════════════════════════════════════════════════════════════
+const auto cpuParams_nchw = CPUSpecificParams{{nchw}, {nchw}, {}, {}};
+const auto cpuParams_nhwc = CPUSpecificParams{{nhwc}, {nhwc}, {}, {}};
+
+// ═══════════════════════════════════════════════════════════════════
+// Static Shape Tests
+// ═══════════════════════════════════════════════════════════════════
+const std::vector<InputShape> staticShapes4D = {
+ {{}, {{1, 16, 8, 8}}},
+ {{}, {{2, 32, 4, 4}}},
+ {{}, {{1, 64, 1, 1}}},
+};
+
+INSTANTIATE_TEST_SUITE_P(smoke_OpName_Static,
+ OpNameLayerCPUTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(staticShapes4D),
+ ::testing::Values(ElementType::f32, ElementType::bf16),
+ // Op-specific attribute values
+ ::testing::Values(cpuParams_nchw, cpuParams_nhwc)),
+ OpNameLayerCPUTest::getTestCaseName);
+
+// ═══════════════════════════════════════════════════════════════════
+// Dynamic Shape Tests
+// ═══════════════════════════════════════════════════════════════════
+const std::vector<InputShape> dynamicShapes4D = {
+ // {PartialShape, list of concrete shapes to test}
+ {{-1, -1, -1, -1}, {{1, 16, 8, 8}, {2, 32, 4, 4}, {1, 64, 1, 1}}},
+ {{{1, 4}, {16, 64}, {1, 16}, {1, 16}}, {{1, 16, 8, 8}, {4, 64, 16, 16}}},
+};
+
+INSTANTIATE_TEST_SUITE_P(smoke_OpName_Dynamic,
+ OpNameLayerCPUTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(dynamicShapes4D),
+ ::testing::Values(ElementType::f32),
+ // Op-specific attribute values
+ ::testing::Values(cpuParams_nchw)),
+ OpNameLayerCPUTest::getTestCaseName);
+
+} // namespace
+} // namespace test
+} // namespace ov
+```
+
+### Eltwise-Routed Ops: Use Activation Test Infrastructure
+
+For ops routed through the existing `Eltwise` node (see **cpu_op_implementation** Fast Path),
+**do not create a separate custom test file**. Instead, extend the existing activation test infrastructure:
+
+**`src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/classes/activation.cpp`:**
+1. Add `{ActivationTypes::OpName, {{}}}` to `activationTypes()` (or `activationTypesDynamicMath()` for ref-only ops).
+2. Add `OpName` to `getPrimitiveType()` jit lists for ARM64 and riscv64.
+3. Add edge-case injection in `ActivationLayerCPUTest::generate_inputs()` for domain-bounded ops.
+
+**`src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/activation.cpp`:**
+- The op is already covered by the parameterized `ActivationLayerTest` and `ActivationLayerCPUTest` once added to the `activationTypes()` map — no new `INSTANTIATE_TEST_SUITE_P` needed.
+
+### 3. Edge Cases to Cover
+
+| Category | Test Cases |
+|----------|-----------|
+| **Shapes** | Scalar input, 1-element tensor, very large tensor, zero-dimension (empty) |
+| **Precisions** | `f32`, `bf16`, `f16`, `i8`, `u8`, `i32`, `i64` (as applicable) |
+| **Layouts** | Planar (`ncsp`), channels-last (`nspc`) |
+| **Dynamic shapes** | Fully dynamic (`{-1, -1, ...}`), partially dynamic, shape-changing across inferences |
+| **Rank variation** | 1D, 2D, 3D, 4D, 5D (as supported by the op) |
+| **Attribute values** | All valid attribute combinations, especially boundary values |
+| **Numerical stability** | Very small values (denormals), very large values, NaN, Inf |
+
+### 4. Verifying ISA Implementation Selection
+
+Custom CPU tests can verify that the correct implementation type is selected:
+
+```cpp
+TEST_P(OpNameLayerCPUTest, CompareWithRefs) {
+ run();
+ // Verify the correct CPU implementation was chosen
+ CheckPluginRelatedResults(compiledModel, "OpName");
+}
+```
+
+The `CheckPluginRelatedResults` function validates that `selectedType`
+(e.g., `jit_avx512_FP32`) matches the expected implementation based on the
+current hardware.
+
+## Build and Run Tests
+
+### Build
+
+```bash
+cd build
+
+# Build shared functional tests
+cmake --build . --target ov_cpu_func_tests -j$(nproc)
+
+# Or build only the CPU plugin library
+cmake --build . --target openvino_intel_cpu_plugin -j$(nproc)
+```
+
+### Run Shared Tests
+
+```bash
+./bin/intel64/Release/ov_cpu_func_tests \
+ --gtest_filter=*smoke*OpName*
+```
+
+### Run Custom CPU Tests
+
+```bash
+./bin/intel64/Release/ov_cpu_func_tests \
+ --gtest_filter=*OpNameLayerCPUTest*
+```
+
+### Run All Tests for the Op
+
+```bash
+./bin/intel64/Release/ov_cpu_func_tests \
+ --gtest_filter=*OpName*
+```
+
+### Run with Verbose Output
+
+```bash
+./bin/intel64/Release/ov_cpu_func_tests \
+ --gtest_filter=*OpName* \
+ --gtest_print_time=1
+```
+
+## Debug Capabilities
+
+The CPU plugin provides debug features documented in
+`src/plugins/intel_cpu/docs/debug_capabilities/`:
+
+```bash
+# Print execution graph with performance counters
+export OV_CPU_DEBUG_LOG=1
+
+# Dump node execution details
+export OV_CPU_EXEC_GRAPH_INFO=1
+```
+
+## Test Failure Troubleshooting
+
+| Symptom | Likely Cause | Fix |
+|---------|-------------|-----|
+| Test not found | Test not registered in CMake or wrong filter | Check test file is under correct directory |
+| Accuracy mismatch | Incorrect precision handling | Verify data type dispatch and precision conversion |
+| Segfault | Memory stride/offset calculation error | Check `getStrides()`, `getStaticDims()` usage |
+| Shape mismatch | Incorrect shape inference | Verify `NgraphShapeInferFactory` or custom shape inference |
+| Wrong impl selected | `initSupportedPrimitiveDescriptors` ordering | First matching descriptor is selected — order matters |
+| Dynamic shape failure | Missing `executeDynamicImpl` | Ensure `executeDynamicImpl` delegates to `execute` |
+
+## Output
+
+- All shared single-layer tests pass.
+- Custom CPU single-layer tests pass (static + dynamic shapes).
+- Report `success` + list of files created to OV Orchestrator.
+
+### Files Created in This Step
+
+| File | Purpose |
+|------|---------|
+| `src/plugins/intel_cpu/tests/functional/shared_tests_instances/single_layer_tests/<op_name>.cpp` | Shared test instantiation |
+| `src/plugins/intel_cpu/tests/functional/custom/single_layer_tests/<op_name>.cpp` | Custom CPU-specific tests |
diff --git a/.github/agents-prototype/skills/add-fe-op/SKILL.md b/.github/agents-prototype/skills/add-fe-op/SKILL.md
new file mode 100644
index 00000000000..b5532f1b732
--- /dev/null
+++ b/.github/agents-prototype/skills/add-fe-op/SKILL.md
@@ -0,0 +1,97 @@
+---
+name: add-fe-op
+description: Adds a new operation to OpenVINO Frontend pipelines with translator updates, registration, and tests.
+---
+
+# Agent Skill: Add New Operation to OpenVINO Frontend
+
+## Goal
+Enable a new operation in an OpenVINO Frontend (FE) pipeline — translator creation, registration, conversion validation, and tests.
+
+## Framework-Specific Workflows
+
+Each frontend has its own detailed workflow. Read the one matching the target framework:
+
+| Frontend | Skill file | What it covers |
+|---|---|---|
+| **PyTorch** | [pytorch.md](pytorch.md) | NodeContext API, `op_table.cpp` registration (TorchScript + FX/Export), `translate_1to1_match_*` wrappers, Python layer tests, Mark operations |
+| **ONNX** | [onnx.md](onnx.md) | `ov::frontend::onnx::Node` API, `ONNX_OP` macro registration with `OPSET_SINCE`/`OPSET_RANGE`, `.prototxt` test models, C++ GTest cases, normalize-step transformations |
+
+## Related Skills (investigation & debugging)
+
+| Frontend | Skill file | When to use |
+|---|---|---|
+| ONNX | [conversion-issues/onnx.md](../conversion-issues/onnx.md) | Conversion failures, accuracy bugs, shape/type mismatches, opset version gaps |
+| PyTorch | [conversion-issues/pytorch.md](../conversion-issues/pytorch.md) | Conversion failures, accuracy bugs, tracing mode issues, normalize-step failures |
+
+## Notes
+
+- Keep this skill instruction-only in markdown.
+
+---
+
+## Instruction Workflow (TensorFlow and generic fallback)
+
+The following sections apply to frontends **not** covered by the framework-specific files above (e.g., TensorFlow), or as a general reference when no framework-specific skill is available.
+
+### 1) Check current support state
+- Verify whether translator file already exists.
+- Verify whether op is already registered in frontend mapping table.
+- If both exist and conversion is known to pass, skip scaffolding.
+- If only partial state exists, repair only missing parts.
+
+### 2) Add translator logic
+- Preferred path: emit real OV conversion logic when the operation maps to an OpenVINO op or a set of operations that will provide reasonable performance.
+- If the same operation already exists in another frontend, extract/reuse common translation logic instead of duplicating it.
+- For simple 1:1 ops, prefer existing helper translation patterns/utilities already used in FE codebase.
+- Fallback path: emit safe placeholder translator only when real mapping is unavailable.
+- Never claim full support when fallback translator is used.
+
+### 3) Register operation in frontend tables
+- PyTorch:
+ - Add converter declaration in op table.
+ - Add TorchScript key registration (for example `aten::op`).
+ - Add FX key registration (for example `aten.op.default`).
+- TensorFlow:
+ - For supported unary ops, prefer generic unary registration path.
+ - For unsupported cases, register dedicated translator function.
+- ONNX:
+ - Ensure `ONNX_OP` macro registration exists in translator file.
+
+### 4) Add tests
+- Add frontend smoke test file under `tests/frontend` (not available for PyTorch).
+- Add framework layer test under `tests/layer_tests` where supported.
+- Ensure test naming follows existing suite conventions.
+
+### 5) Build prerequisites for validation
+- Ensure frontend changes are available to runtime before conversion checks.
+- Build frontend targets from source or use an existing OpenVINO build/package that already includes your FE changes.
+- If neither is true, do not report conversion status as passed; mark validation as blocked.
+
+### 6) Validate conversion and finalize
+- run conversion check from generated <frontend> model.
+- if automated validation is unavailable, mark as skipped with explicit reason.
+- Confirm no duplicate registrations are introduced.
+- Confirm rerun is idempotent.
+- Report one of three states: fully enabled, partially repaired, or scaffolded with fallback.
+
+## Translation Recommendations
+
+- Prefer runtime shape computation over conversion-time shape extraction.
+ - Use `ShapeOf`-based graph logic for shape-dependent behavior.
+ - Avoid relying on `get_shape()` / fully static shape reads during FE conversion.
+ - `get_partial_shape()` is acceptable for compile-time rank-only decisions.
+
+- Handle data types according to framework semantics.
+ - If PyTorch op behavior allows mixed input types, preserve this in translation.
+ - Do not over-constrain translators to a single dtype when mixed-type execution is valid.
+
+- Avoid constants tied to compile-time element type queries.
+ - Do not create `Constant` values from `get_element_type()` when type can be dynamic at conversion time.
+ - Prefer runtime type-safe construction paths that remain valid for dynamic element types.
+
+## Notes
+
+- Keep this skill instruction-only in markdown.
+- Prefer minimal, root-cause updates over broad refactors.
+- Do not mark operation as supported unless FE conversion produces OV graph nodes (not framework fallback nodes).
diff --git a/.github/agents-prototype/skills/add-fe-op/onnx.md b/.github/agents-prototype/skills/add-fe-op/onnx.md
new file mode 100644
index 00000000000..e5159c1e704
--- /dev/null
+++ b/.github/agents-prototype/skills/add-fe-op/onnx.md
@@ -0,0 +1,301 @@
+# Skill: Add a New Operation Translator to the OpenVINO ONNX Frontend
+
+---
+
+## 1. Prerequisites
+
+Before writing any code:
+
+- [ ] Read the [ONNX spec for the op](https://onnx.ai/onnx/operators/) — inputs, outputs, attributes, type constraints, and behavioral notes.
+- [ ] Check the [ONNX Operator Changelog](https://github.com/onnx/onnx/blob/main/docs/Changelog.md) for all opset versions that introduced or modified the op.
+- [ ] Identify the matching OpenVINO op(s) in `src/core/include/openvino/op/`. If none exists, use a composition of existing ops or escalate to the Core OpSpec Agent.
+- [ ] Search `src/frontends/common_translators/` — a shared translator may already exist or be partially implemented.
+- [ ] Check if other frontends (PyTorch, TF) already have a translator for the same operation; it may be reusable or a model to follow.
+
+---
+
+## 2. Key Source Locations
+
+| Path | Description |
+|---|---|
+| `src/frontends/onnx/frontend/src/op/` | Per-op translator files — create your new `.cpp` file here. `ONNX_OP` registration goes at the bottom of this file. |
+| `src/frontends/onnx/frontend/src/core/operator_set.hpp` | `ONNX_OP` and `ONNX_OP_M` macros. |
+| `src/frontends/onnx/frontend/src/version_range.hpp` | `OPSET_SINCE`, `OPSET_RANGE`, `OPSET_IN` helpers. |
+| `src/frontends/onnx/frontend/src/core/node.hpp` | `ov::frontend::onnx::Node` — the context object passed to each translator. |
+| `src/frontends/onnx/frontend/src/utils/common.hpp` | Shared helpers: `is_input_valid`, `handle_opset6_binary_op`. **Always check here.** |
+| `src/frontends/onnx/frontend/CMakeLists.txt` | Add new `.cpp` file here under `SOURCES`. |
+| `src/frontends/onnx/tests/onnx_import.in.cpp` | Main import/inference tests. Add test cases here. |
+| `src/frontends/onnx/tests/models/` | `.prototxt` test model definitions. Add test models here. |
+
+---
+
+## 3. `ov::frontend::onnx::Node` API Reference
+
+`Node` is the context object every translator receives.
+
+```cpp
+#include "core/node.hpp"
+
+// Get all op inputs as OpenVINO outputs:
+ov::OutputVector inputs = node.get_ov_inputs();
+
+// Get a specific input:
+auto x = node.get_ov_inputs()[0];
+
+// Get an attribute with a default value:
+int64_t axis = node.get_attribute_value<int64_t>("axis", 0);
+std::vector<int64_t> pads = node.get_attribute_value<std::vector<int64_t>>("pads", {0, 0});
+std::string auto_pad = node.get_attribute_value<std::string>("auto_pad", "NOTSET");
+
+// Check if an attribute exists:
+bool has_pads = node.has_attribute("pads");
+
+// Check if an optional input is present (not "missing"):
+#include "utils/common.hpp"
+bool valid = common::is_input_valid(node, 2);
+```
+
+---
+
+## 4. Registration Macros
+
+The `ONNX_OP` macro is placed **at the bottom of the per-op `.cpp` file** (not in `ops_bridge.cpp`). Look at existing op files such as `src/frontends/onnx/frontend/src/op/sequence_insert.cpp` or `src/frontends/onnx/frontend/src/op/resize.cpp` as reference.
+
+**Example** (adapt op name and version range to your op):
+
+```
+// Single version range:
+ONNX_OP("GridSample", OPSET_SINCE(16), ai_onnx::opset_16::grid_sample);
+
+// Multiple ranges when behavior changed between opsets:
+ONNX_OP("Resize", OPSET_RANGE(10, 10), ai_onnx::opset_10::resize);
+ONNX_OP("Resize", OPSET_RANGE(11, 17), ai_onnx::opset_11::resize);
+ONNX_OP("Resize", OPSET_SINCE(18), ai_onnx::opset_18::resize);
+
+// Specific individual opset versions (when there are gaps):
+ONNX_OP("Cast", OPSET_IN({1, 6, 9, 13, 19}), ai_onnx::opset_13::cast);
+```
+
+---
+
+## 5. Step-by-Step Implementation
+
+### 5a. Create the translator file
+
+ONNX op translators consist of **a single `.cpp` file only** — no corresponding `.hpp` is needed.
+
+Read an existing op as your template. Good references:
+- `src/frontends/onnx/frontend/src/op/sequence_insert.cpp` (simple, recent pattern)
+- `src/frontends/onnx/frontend/src/op/resize.cpp` (multi-opset-version example)
+
+Adapt the chosen template to your op. Do not copy-paste blindly — understand each section before writing.
+
+### 5b. Handling multiple opset versions
+
+When an op was added in opset 9 and modified in opset 13:
+
+```cpp
+// ---- opset_9 namespace ----
+namespace opset_9 {
+ov::OutputVector my_op(const ov::frontend::onnx::Node& node) {
+ // opset 9 implementation
+}
+} // namespace opset_9
+
+// ---- opset_13 namespace ----
+namespace opset_13 {
+ov::OutputVector my_op(const ov::frontend::onnx::Node& node) {
+ // opset 13 implementation (new behavior/attributes)
+}
+} // namespace opset_13
+```
+
+```cpp
+ONNX_OP("MyOp", OPSET_RANGE(9, 12), ai_onnx::opset_9::my_op);
+ONNX_OP("MyOp", OPSET_SINCE(13), ai_onnx::opset_13::my_op);
+
+### 5c. Handling simple binary/elementwise ops
+
+```cpp
+#include "utils/common.hpp"
+
+ov::OutputVector add(const ov::frontend::onnx::Node& node) {
+ return common::handle_opset6_binary_op<ov::op::v1::Add>(node);
+}
+```
+
+### 5d. Using shared helpers
+
+```cpp
+#include "utils/common.hpp"
+
+// Check optional input before accessing it:
+const auto inputs = node.get_ov_inputs();
+if (common::is_input_valid(node, 1)) {
+ auto bias = inputs[1];
+ // ... use bias ...
+}
+```
+
+### 5e. Checking and using `common_translators`
+
+```bash
+grep -rn '<op_name>' src/frontends/common_translators/include/common_translators.hpp
+```
+
+If found, use it directly:
+
+```cpp
+#include "common_translators.hpp"
+
+ov::OutputVector my_op(const ov::frontend::onnx::Node& node) {
+ return common_translators::translate_<op>(node.get_ov_inputs(), attributes...);
+}
+```
+
+### 5f. Mark operations for special types
+
+For ops that process complex or quantized tensors:
+
+```cpp
+#include "openvino/frontend/complex_type_mark.hpp"
+
+// In normalize-step MatcherPass (if needed):
+auto complex_mark = std::make_shared<ComplexTypeMark>(input, input_et);
+```
+
+### 5g. Normalize-step transformations
+
+For ops that require post-translation graph rewrites (e.g., resolving Mark operations or merging multi-op patterns):
+
+1. Create a `MatcherPass` in `src/frontends/onnx/frontend/src/transforms/` (or `src/frontends/common_translators/` for shared transforms).
+2. Register in `FrontEnd::normalize()` in `frontend.cpp`.
+
+### 5h. Update `CMakeLists.txt`
+
+In `src/frontends/onnx/frontend/CMakeLists.txt`:
+```cmake
+set(SOURCES
+ ...
+ src/op/<new_op>.cpp
+ ...
+)
+```
+
+## 6. Adding Tests
+
+### 6a. Create a `.prototxt` test model
+
+In `src/frontends/onnx/tests/models/<op_name>.prototxt`:
+
+```protobuf
+ir_version: 7
+graph {
+ node {
+ op_type: "GridSample"
+ attribute {
+ name: "mode"
+ s: "bilinear"
+ type: STRING
+ }
+ input: "X"
+ input: "grid"
+ output: "Y"
+ }
+ name: "test_grid_sample"
+ input {
+ name: "X"
+ type { tensor_type { elem_type: 1 shape { dim { dim_value: 1 } ... }}}
+ }
+ output {
+ name: "Y"
+ type { tensor_type { elem_type: 1 shape { ... }}}
+ }
+}
+opset_import { version: 16 }
+```
+
+### 6b. Add C++ test cases
+
+In `src/frontends/onnx/tests/onnx_import.in.cpp`:
+
+```cpp
+NGRAPH_TEST(${BACKEND_NAME}, onnx_model_<op_name>) {
+ const auto function = onnx_import::import_onnx_model(
+ file_util::path_join(CommonTestUtils::getExecutionDirectory(),
+ SERIALIZED_ZOO, "onnx/<op_name>.prototxt"));
+
+ auto test_case = test::TestCase(function, s_device);
+ test_case.add_input<float>({...}); // input values
+ test_case.add_expected_output<float>(Shape{...}, {...}); // expected output
+ test_case.run();
+}
+```
+
+### 6c. Add multiple test scenarios
+
+Cover all important cases:
+- Basic case with default attributes
+- Non-default attribute values
+- Edge cases (empty tensor, scalar, dynamic rank)
+- Multiple opset versions if behavior differs
+
+---
+
+## 7. Build and Test
+
+```bash
+# Build the ONNX frontend:
+cmake --build build --target openvino_onnx_frontend -j$(nproc)
+
+# Build and run tests:
+cmake --build build --target ov_onnx_frontend_tests -j$(nproc)
+cd build && ctest -R "ov_onnx_frontend_tests" --output-on-failure -j$(nproc)
+
+# Run a specific test:
+ctest -R "onnx_model_<op_name>" -V
+
+# Apply clang-format:
+cmake --build build --target clang_format_fix_all -j$(nproc)
+```
+
+---
+
+## 8. Validation Checklist
+
+- [ ] **ONNX spec consulted** — all attributes, input/output optionality, type constraints covered.
+- [ ] **All opset versions covered** — `ONNX_OP` registrations span the correct version ranges.
+- [ ] **Optional inputs guarded** — `common::is_input_valid(node, N)` used for all optional inputs.
+- [ ] **Default attribute values** — per ONNX spec for each opset version.
+- [ ] **CMakeLists.txt updated** — new `.cpp` added to `SOURCES`.
+- [ ] **`ONNX_OP` registration added** — macro at bottom of the new `.cpp` translator file (not in `ops_bridge.cpp`).
+- [ ] **Test model added** — `.prototxt` covers basic case and edge cases.
+- [ ] **C++ test added** — at least one test in `onnx_import.in.cpp`.
+- [ ] **All ONNX tests pass** — `ctest -R ov_onnx_frontend_tests` green.
+- [ ] **clang-format applied** — no formatting diffs.
+- [ ] **Supported ops doc updated** — `src/frontends/onnx/docs/supported_ops.md` (if maintained).
+
+---
+
+## 9. Common Pitfalls
+
+| Pitfall | Explanation |
+|---|---|
+| **Wrong opset range** | `OPSET_SINCE(11)` instead of `OPSET_RANGE(11, 17)` when the op changed at opset 18. |
+| **Attribute type mismatch** | `get_attribute_value<int64_t>()` vs `get_attribute_value<float>()` — wrong type silently returns a default value. |
+| **Not checking common_translators** | Many ops are already in `src/frontends/common_translators/`. Check before writing a new one. |
+| **Forgetting `is_input_valid()`** | Accessing `inputs[2]` when the input is optional and absent causes a crash. |
+| **Missing `#include`** | Each OpenVINO op class needs its header (e.g., `#include "openvino/op/add.hpp"`). |
+| **Broadcasting edge cases** | ONNX uses Numpy-style broadcasting; verify with scalar and 0-rank tensor inputs. |
+| **Not handling empty attribute list** | Some attributes may have list type with empty default; `get_attribute_value<std::vector<int64_t>>("axis", {})`. |
+| **Mark operations missing** | For complex/quantized/sequence types, the normalize-step won't resolve correctly without the corresponding Mark operation. |
+
+---
+
+## 10. Reference Links
+
+- [ONNX Operator Specifications](https://onnx.ai/onnx/operators/)
+- [ONNX Operator Changelog](https://github.com/onnx/onnx/blob/main/docs/Changelog.md)
+- [OpenVINO Available Operations](https://docs.openvino.ai/latest/openvino_docs_ops_opset.html)
+- [OpenVINO ONNX Frontend README](src/frontends/onnx/README.md)
+- [OpenVINO ONNX Supported Ops](src/frontends/onnx/docs/supported_ops.md)
diff --git a/.github/agents-prototype/skills/add-fe-op/pytorch.md b/.github/agents-prototype/skills/add-fe-op/pytorch.md
new file mode 100644
index 00000000000..a60068c35e0
--- /dev/null
+++ b/.github/agents-prototype/skills/add-fe-op/pytorch.md
@@ -0,0 +1,337 @@
+# Skill: Add a New Operation Translator to the OpenVINO PyTorch Frontend
+
+---
+
+## 1. Prerequisites
+
+Before writing any code:
+
+- [ ] Read the [PyTorch documentation](https://pytorch.org/docs/stable/) for the op — function signature, parameter types, and behavioral notes.
+- [ ] Check the [PyTorch ATen operator schema](https://github.com/pytorch/pytorch/blob/main/aten/src/ATen/native/native_functions.yaml) for all overloads.
+- [ ] Identify whether the op needs to be supported in **TorchScript** (`aten::op`), **torch.export/FX** (`aten.op.overload`), or both.
+- [ ] Identify the matching OpenVINO op(s) in `src/core/include/openvino/op/`. If none exists, escalate to the Core OpSpec Agent.
+- [ ] Search `src/frontends/common_translators/` — a shared implementation may already exist.
+- [ ] Check if the op can be expressed using existing `translate_1to1_match_*` wrappers.
+
+---
+
+## 2. Key Source Locations
+
+| Path | Description |
+|---|---|
+| `src/frontends/pytorch/src/op/` | Per-op translator files — create your new file here. |
+| `src/frontends/pytorch/src/op_table.cpp` | Operator registry — `get_supported_ops_ts()` and `get_supported_ops_fx()`. Add registration here. |
+| `src/frontends/pytorch/include/openvino/frontend/pytorch/node_context.hpp` | `NodeContext` — the context object each translator receives. |
+| `src/frontends/pytorch/src/utils.hpp` | Shared helpers: `num_inputs_check`, `make_optional_bias`, `get_shape_rank`, `normalize_axis`, `numel`, `convert_dtype`, `concat_list_construct`. **Always check here first.** |
+| `src/frontends/pytorch/src/pt_framework_node.hpp` | `PtFrameworkNode` — placeholder for unconverted ops. |
+| `src/frontends/pytorch/src/transforms/` | Normalize-step transformations — `MatcherPass` subclasses that run after initial translation. |
+| `src/frontends/pytorch/CMakeLists.txt` | Add new `.cpp` files here. |
+| `tests/layer_tests/pytorch_tests/` | Python layer tests — create `test_<op>.py` here. |
+| `tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py` | `PytorchLayerTest` base class. |
+
+---
+
+## 3. `NodeContext` API Reference
+
+`NodeContext` is the context object every translator receives.
+
+```cpp
+#include "openvino/frontend/pytorch/node_context.hpp"
+
+// Get an input by index:
+ov::Output<ov::Node> x = context.get_input(0);
+
+// Get a constant input (already a tensor, reads the value):
+int64_t dim = context.const_input<int64_t>(1);
+double alpha = context.const_input<double>(2);
+std::vector<int64_t> shape = context.const_input<std::vector<int64_t>>(3);
+
+// Check if an optional input is None:
+bool is_none = context.input_is_none(2);
+
+// Mark a created node (MANDATORY for every created OV node):
+auto add = context.mark_node(std::make_shared<ov::op::v1::Add>(x, y));
+
+// Get the number of inputs:
+size_t n = context.get_input_size();
+```
+
+---
+
+## 4. Registration in `op_table.cpp`
+
+### Define converter function
+
+```cpp
+// In the OP_CONVERTER macro (or standalone function):
+OP_CONVERTER(translate_<new_op>) {
+ // context is NodeContext&
+ num_inputs_check(context, 1, 3);
+ const auto x = context.get_input(0);
+ // ...
+ return {context.mark_node(std::make_shared<ov::op::v0::Relu>(x))};
+}
+```
+
+### Register in `get_supported_ops_ts()` (TorchScript)
+
+```cpp
+{"aten::<op_name>", ov::frontend::pytorch::op::translate_<new_op>},
+```
+
+### Register in `get_supported_ops_fx()` (torch.export / FX)
+
+```cpp
+{"aten.<op_name>.default", ov::frontend::pytorch::op::translate_<new_op>},
+{"aten.<op_name>.Tensor", ov::frontend::pytorch::op::translate_<new_op>},
+```
+
+### 1:1 mapping wrappers (no custom logic needed)
+
+```cpp
+// Single input → single output, same type:
+{"aten::relu", op::translate_1to1_match_1_inputs<opset10::Relu>},
+{"aten.relu.default", op::translate_1to1_match_1_inputs<opset10::Relu>},
+
+// Two inputs, type-aligned:
+{"aten::add.Tensor", op::translate_1to1_match_2_inputs_align_types<opset1::Add>},
+
+// Inplace variant:
+{"aten::relu_", op::inplace_op<op::translate_1to1_match_1_inputs<opset10::Relu>>},
+```
+
+---
+
+## 5. Step-by-Step Implementation
+
+### 5a. Create the translator file
+
+Use the template below as your starting point, then read the matching example to adapt it
+to your op's specific inputs and attribute handling:
+
+```cpp
+// src/frontends/pytorch/src/op/<new_op>.cpp
+// Starting template — adapt inputs, attribute reads, and OV op to your case.
+
+#include "openvino/frontend/pytorch/node_context.hpp"
+#include "openvino/op/<ov_op>.hpp"
+#include "utils.hpp"
+
+namespace ov::frontend::pytorch::op {
+
+OutputVector translate_<new_op>(const NodeContext& context) {
+ // Minimum 1 input, maximum 3 — adjust for your op:
+ num_inputs_check(context, 1, 3);
+
+ const auto x = context.get_input(0);
+
+ // Read constant scalar attribute (if needed):
+ // const auto alpha = context.const_input<float>(1);
+
+ // Read constant integer attribute (if needed):
+ // const auto dim = context.const_input<int64_t>(2);
+
+ // Guard optional input (if needed):
+ // if (!context.input_is_none(1)) { ... }
+
+ auto result = std::make_shared<ov::op::v0::YourOp>(x /*, other inputs */);
+ return {context.mark_node(result)};
+}
+
+} // namespace ov::frontend::pytorch::op
+```
+
+> `context.mark_node(...)` is **mandatory** on every created OV node — do not omit it.
+
+Real implementations to read before adapting your code:
+- `src/frontends/pytorch/src/op/upsample.cpp` — optional inputs, resize semantics
+- `src/frontends/pytorch/src/op/layer_norm.cpp` — shared helpers (`normalize_axis`, `make_optional_bias`)
+- `src/frontends/pytorch/src/op/linear.cpp` — attribute translation, bias handling
+
+After creating the file, declare the translator in `src/frontends/pytorch/src/op/op.hpp`.
+
+### 5b. 1:1 mapping (no custom translator needed)
+
+When the PyTorch op maps directly to a single OV op with the same input/output arity and no attribute translation:
+
+```cpp
+// In op_table.cpp, no new .cpp file needed:
+{"aten::abs", op::translate_1to1_match_1_inputs<opset1::Abs>},
+{"aten.abs.default", op::translate_1to1_match_1_inputs<opset1::Abs>},
+```
+
+### 5c. Multi-input with type alignment
+
+```cpp
+OutputVector translate_add(const NodeContext& context) {
+ num_inputs_check(context, 2, 3);
+ auto x = context.get_input(0);
+ auto y = context.get_input(1);
+ align_eltwise_input_types(context, x, y, false, false);
+ return {context.mark_node(std::make_shared<v1::Add>(x, y))};
+}
+```
+
+### 5d. Using shared helpers
+
+```cpp
+#include "utils.hpp"
+
+OutputVector translate_layer_norm(const NodeContext& context) {
+ num_inputs_check(context, 2, 3);
+ auto x = context.get_input(0);
+ auto axes = context.const_input<std::vector<int64_t>>(1);
+
+ // Utility: normalize axis values to positive range
+ const auto rank = get_shape_rank(context, x);
+ axes = normalize_axis(axes, rank);
+
+ // Utility: make optional bias (returns Constant(0) if input is None)
+ auto bias = make_optional_bias(context, x, 2);
+
+ return { /* ... */ };
+}
+```
+
+### 5e. Normalize-step transformations
+
+For ops that need graph-level rewriting after translation:
+
+```cpp
+// In src/frontends/pytorch/src/transforms/<my_transform>.cpp:
+class MyTransform : public ov::pass::MatcherPass {
+public:
+ MyTransform() {
+ auto pattern = ov::pass::pattern::wrap_type<SequenceMark>();
+ auto callback = [](ov::pass::pattern::Matcher& m) -> bool {
+ // Pattern match + transform logic
+ return true;
+ };
+ auto m = std::make_shared<ov::pass::pattern::Matcher>(pattern, "MyTransform");
+ register_matcher(m, callback);
+ }
+};
+
+// Register in src/frontends/pytorch/src/frontend.cpp, in FrontEnd::normalize():
+manager.register_pass<MyTransform>();
+```
+
+### 5f. Update `CMakeLists.txt`
+
+In `src/frontends/pytorch/CMakeLists.txt`:
+```cmake
+set(SOURCES
+ ...
+ src/op/<new_op>.cpp
+ ...
+)
+```
+
+---
+
+## 6. Adding Tests
+
+### 6a. Create a Python layer test
+
+In `tests/layer_tests/pytorch_tests/test_<op_name>.py`:
+
+```python
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+import pytest
+import torch
+import numpy as np
+from pytorch_layer_test_class import PytorchLayerTest
+
+
+class TestMyOp(PytorchLayerTest):
+ def _prepare_input(self):
+ return (np.random.randn(1, 3, 224, 224).astype(np.float32),)
+
+ def create_model(self, dim, keepdim):
+ class MyModel(torch.nn.Module):
+ def __init__(self, dim, keepdim):
+ super().__init__()
+ self.dim = dim
+ self.keepdim = keepdim
+
+ def forward(self, x):
+ return torch.my_op(x, dim=self.dim, keepdim=self.keepdim)
+
+ return MyModel(dim, keepdim), None, "my_op"
+
+ @pytest.mark.nightly
+ @pytest.mark.precommit
+ @pytest.mark.parametrize("dim", [0, 1, -1])
+ @pytest.mark.parametrize("keepdim", [True, False])
+ def test_my_op(self, dim, keepdim, ie_device, precision, ir_version):
+ self._test(*self.create_model(dim, keepdim), ie_device, precision, ir_version)
+
+ @pytest.mark.nightly
+ @pytest.mark.precommit_torch_export
+ @pytest.mark.parametrize("dim", [0, 1])
+ def test_my_op_torch_export(self, dim, ie_device, precision, ir_version):
+ self._test(*self.create_model(dim, True), ie_device, precision, ir_version,
+ trace_model=True)
+```
+
+---
+
+## 7. Build and Test
+
+```bash
+# Build the PyTorch frontend:
+cmake --build build --target openvino_pytorch_frontend -j$(nproc)
+
+# Run layer tests (TorchScript mode):
+TEST_DEVICE=CPU TEST_PRECISION=FP32 python3 -m pytest tests/layer_tests/pytorch_tests/test_<op>.py -v -k "precommit"
+
+# Run with torch.export mode:
+TEST_DEVICE=CPU TEST_PRECISION=FP32 PYTORCH_TRACING_MODE=EXPORT python3 -m pytest tests/layer_tests/pytorch_tests/test_<op>.py -v -k "precommit_torch_export"
+
+# Apply clang-format:
+cmake --build build --target clang_format_fix_all -j$(nproc)
+```
+
+---
+
+## 8. Validation Checklist
+
+- [ ] **PyTorch schema consulted** — all inputs (including optional), constants, and attributes covered.
+- [ ] **TorchScript mapping added** — registered in `get_supported_ops_ts()`.
+- [ ] **FX/Export mapping added** — registered in `get_supported_ops_fx()` for all overload variants.
+- [ ] **Inplace variant handled** — registered with `inplace_op<>` if applicable.
+- [ ] **`mark_node()` called** — on every `std::make_shared<...>()` in the translator.
+- [ ] **Optional inputs checked** — `input_is_none()` guard before each optional access.
+- [ ] **`num_inputs_check()` called** — validates expected input count.
+- [ ] **CMakeLists.txt updated** — new `.cpp` file added.
+- [ ] **Layer test added** — `test_<op>.py` with `@pytest.mark.precommit` and `@pytest.mark.precommit_torch_export`.
+- [ ] **Both tracing modes pass** — TorchScript and Export.
+- [ ] **clang-format applied** — no formatting diffs.
+
+---
+
+## 9. Common Pitfalls
+
+| Pitfall | Explanation |
+|---|---|
+| **Forgetting `mark_node()`** | Every `std::make_shared<...>()` must be wrapped with `context.mark_node()`. |
+| **Not checking `input_is_none()`** | Optional inputs (e.g., bias, weight) may be None. Always guard before access. |
+| **TorchScript vs FX name mismatch** | `aten::op_name` vs `aten.op_name.overload` — missing FX mapping causes silent `PtFrameworkNode` under `torch.export`. |
+| **Missing inplace wrapper** | `aten::relu_` must use `inplace_op<translate_1to1_match_1_inputs<Relu>>`, not a separate translator. |
+| **Wrong `const_input<T>()` type** | Using `const_input<int64_t>()` for a float attribute silently returns a wrong value. |
+| **Not using `num_inputs_check()`** | Missing this guard leads to hard-to-debug out-of-bounds crashes when the model has fewer inputs. |
+| **Not checking `common_translators`** | Check `src/frontends/common_translators/` before writing a new translator. |
+| **Dynamic shape assumptions** | Translators must not assume static dimensions. Use `get_shape_rank()` and dynamic-safe OV ops. |
+| **Missing pytest marks** | `@pytest.mark.precommit` and `@pytest.mark.precommit_torch_export` are required for CI gating. |
+
+---
+
+## 10. Reference Links
+
+- [PyTorch Operator Documentation](https://pytorch.org/docs/stable/torch.html)
+- [PyTorch ATen native_functions.yaml](https://github.com/pytorch/pytorch/blob/main/aten/src/ATen/native/native_functions.yaml)
+- [torch.export Reference](https://pytorch.org/docs/stable/export.html)
+- [OpenVINO Available Operations](https://docs.openvino.ai/latest/openvino_docs_ops_opset.html)
+- [OpenVINO PyTorch Frontend README](src/frontends/pytorch/README.md)
diff --git a/.github/agents-prototype/skills/add-fe-op/step1-analysis.md b/.github/agents-prototype/skills/add-fe-op/step1-analysis.md
new file mode 100644
index 00000000000..2eee7cf8510
--- /dev/null
+++ b/.github/agents-prototype/skills/add-fe-op/step1-analysis.md
@@ -0,0 +1,134 @@
+# Skill: FE Op Analysis
+
+> Source: `skills/add-fe-op/SKILL.md` (Step 1)
+> Agent: `fe_agent`
+
+## When to Use
+
+- Model conversion fails with a missing translator or unsupported op error from a FE.
+- An operation is absent from the FE op mapping table.
+- Partial support exists (translator file present but registration missing, or vice versa).
+
+## Procedure
+
+### 1. Identify the operation and source framework
+
+From the error context / conversion log, extract:
+
+- Exact op name:
+ - PyTorch: `aten::op_name` (TorchScript) or `aten.op_name.default` (FX)
+ - TensorFlow: `tf.nn.op_name` or raw op string (e.g. `GatherNd`)
+ - ONNX: op string (e.g. `ScatterND`, versioned by opset)
+- Source framework: `pytorch`, `tensorflow`, or `onnx`
+- Version/variant where applicable (ONNX opset, TorchScript vs FX namespace)
+
+### 2. Check current support state
+
+Browse or clone `https://github.com/openvinotoolkit/openvino` and run:
+
+**PyTorch:**
+```bash
+# Translator file
+ls src/frontends/pytorch/src/op/<op_name>.cpp
+
+# TorchScript key
+grep -n 'aten::<op_name>' src/frontends/pytorch/src/op_table.cpp
+
+# FX key
+grep -n 'aten\.<op_name>' src/frontends/pytorch/src/op_table.cpp
+```
+
+**TensorFlow:**
+```bash
+ls src/frontends/tensorflow/src/op/<op_name>.cpp
+grep -n '<OpName>' src/frontends/tensorflow/src/op_table.cpp
+```
+
+**ONNX:**
+```bash
+ls src/frontends/onnx/src/ops/<op_name>.cpp
+grep -rn 'ONNX_OP.*"<OpName>"' src/frontends/onnx/src/ops/
+```
+
+Support states:
+
+| State | Meaning |
+|-------|---------|
+| `full` | Translator file + registration both present → skip scaffolding |
+| `partial` | One piece missing → repair only that part |
+| `missing` | Nothing exists → full scaffold needed |
+
+### 3. Research the op semantics
+
+Consult official documentation for:
+
+- Math formula / semantics
+- Inputs, outputs, attributes
+- Data types and broadcasting rules
+- Edge cases (empty tensors, negative indices, etc.)
+
+| Framework | Reference |
+|-----------|-----------|
+| PyTorch | https://pytorch.org/docs/stable/generated/torch.<op>.html |
+| TensorFlow | https://www.tensorflow.org/api_docs/python/tf/ |
+| ONNX | https://onnx.ai/onnx/operators/ |
+
+### 4. Check for equivalent OV core op
+
+Search existing OV ops:
+
+```bash
+grep -r '<OpName>\|<semantic_keyword>' \
+ openvino/src/core/include/openvino/op/ \
+ openvino/src/core/include/openvino/opsets/
+```
+
+Decision table:
+
+| Situation | Action |
+|-----------|--------|
+| 1:1 match with existing OV op | Real translation — proceed |
+| Composition of existing OV ops produces correct semantics | Real translation — proceed |
+| No match; decomposing is too slow or inaccurate | **Escalate to Core Agent** |
+| Operation is clearly decomposable via graph transform | Decomposable — flag for Transformation Agent |
+
+### 5. Check cross-frontend reuse
+
+If the same op exists in another frontend, reuse its logic rather than duplicating:
+
+```bash
+grep -rn '<op_name>' src/frontends/ --include="*.cpp"
+```
+
+If a working implementation found in another FE, extract shared translation
+logic into a common utility header instead of copy-pasting.
+
+## Output
+
+Return a structured analysis block:
+
+```
+op_name: <name>
+source_framework: <pytorch|tensorflow|onnx>
+support_state: <full|partial|missing>
+translator_file: <path or "missing">
+registration:
+ torchscript_key: <yes|no> # PyTorch only
+ fx_key: <yes|no> # PyTorch only
+ onnx_op_macro: <yes|no> # ONNX only
+ tf_table_entry: <yes|no> # TF only
+math_formula: <brief description>
+inputs: [<name: type>, ...]
+outputs: [<name: type>, ...]
+attributes: [<name: type = default>, ...]
+ov_equivalent: <op name(s) or "none">
+cross_fe_reuse: <yes|no> — <source path if yes>
+action: <translate|repair|escalate_to_core>
+reason: <why this action was chosen>
+```
+
+### Action routing
+
+- `action=translate` or `action=repair` → proceed to **fe_op_translation** skill.
+- `action=escalate_to_core` → fill the full escalation payload (see `fe_agent.md`)
+ and stop. Do not proceed to Translation skill.
diff --git a/.github/agents-prototype/skills/add-fe-op/step2-translation.md b/.github/agents-prototype/skills/add-fe-op/step2-translation.md
new file mode 100644
index 00000000000..31425bab117
--- /dev/null
+++ b/.github/agents-prototype/skills/add-fe-op/step2-translation.md
@@ -0,0 +1,176 @@
+# Skill: FE Op Translation
+
+> Source: `skills/add-fe-op/SKILL.md` (Step 2 + Translation Recommendations)
+> Agent: `fe_agent`
+
+## Prerequisites
+
+- Completed **fe_op_analysis** with `action=translate` or `action=repair`.
+- Op name, source framework, support state, inputs/outputs/attributes are known.
+- OV equivalent op (or a composition path) identified.
+
+---
+
+## Translation paths by frontend
+
+### PyTorch
+
+Translator file: `src/frontends/pytorch/src/op/<op_name>.cpp`
+
+```cpp
+// Minimal PyTorch FE translator template
+#include "openvino/frontend/pytorch/node_context.hpp"
+#include "openvino/op/<ov_op>.hpp"
+#include "utils.hpp"
+
+namespace ov {
+namespace frontend {
+namespace pytorch {
+namespace op {
+
+using namespace ov::op;
+
+OutputVector translate_<op_name>(const NodeContext& context) {
+ // Validate input count
+ num_inputs_check(context, <min_inputs>, context.get_input_size());
+
+ // Fetch inputs
+ auto x = context.get_input(0);
+ // auto attr = context.const_input<int64_t>(1); // for attribute-valued inputs
+
+ // Build OV subgraph
+ auto result = std::make_shared<v0::YourOvOp>(x /*, attrs */);
+ return {result};
+}
+
+} // namespace op
+} // namespace pytorch
+} // namespace frontend
+} // namespace ov
+```
+
+### TensorFlow
+
+Translator file: `src/frontends/tensorflow/src/op/<op_name>.cpp`
+
+Preferred patterns:
+
+- **Unary elementwise**: use the generic unary registration path (see `unary_op.cpp`).
+- **Complex**: write a dedicated translator function.
+
+```cpp
+#include "common_op_table.hpp"
+#include "openvino/op/<ov_op>.hpp"
+
+namespace ov {
+namespace frontend {
+namespace tensorflow {
+namespace op {
+
+OutputVector translate_<op_name>(const NodeContext& context) {
+ default_op_checks(context, 1, {"<TF_OP_NAME>"});
+ auto x = context.get_input(0);
+ auto result = std::make_shared<ov::op::v0::YourOvOp>(x);
+ set_node_name(context.get_name(), result);
+ return {result->output(0)};
+}
+
+} // namespace op
+} // namespace tensorflow
+} // namespace frontend
+} // namespace ov
+```
+
+### ONNX
+
+Translator file: `src/frontends/onnx/src/ops/<op_name>.cpp`
+
+```cpp
+#include "core/null_node.hpp"
+#include "openvino/frontend/onnx/extension/conversion.hpp"
+#include "openvino/op/<ov_op>.hpp"
+
+namespace ngraph {
+namespace onnx_import {
+namespace op {
+namespace set_<version> {
+
+ov::OutputVector <op_name>(const ov::frontend::onnx::Node& node) {
+ const auto inputs = node.get_ov_inputs();
+ auto x = inputs.at(0);
+ // auto attr_val = node.get_attribute_value<int64_t>("attr_name", default_val);
+ auto result = std::make_shared<ov::op::v0::YourOvOp>(x);
+ return {result};
+}
+
+} // namespace set_<version>
+} // namespace op
+} // namespace onnx_import
+} // namespace ngraph
+```
+
+---
+
+## Translation Recommendations
+
+### Shape handling
+
+- **Prefer runtime ShapeOf-based graph logic** for shape-dependent behavior.
+- Avoid `get_shape()` (fully static read at conversion time).
+- `get_partial_shape()` is acceptable for compile-time rank-only decisions.
+
+```cpp
+// Preferred: runtime shape computation
+auto shape_node = std::make_shared<v3::ShapeOf>(x, element::i64);
+// Avoid:
+// auto static_shape = x.get_shape(); // will fail for dynamic input
+```
+
+### Data type handling
+
+- If the framework op allows mixed input types, preserve this in translation — do
+ not over-constrain to a single dtype.
+- Do not create `Constant` values from `get_element_type()` when the element type
+ can be dynamic at conversion time.
+
+```cpp
+// Preferred: type-safe runtime path
+// Avoid:
+// auto type_const = Constant::create(element::i64, {1}, {x.get_element_type()});
+```
+
+### Reuse and simplification
+
+- For simple 1:1 ops, check `utils.hpp` and `utils_quantize.hpp` for helpers
+ before writing new code.
+- If the same op already has a translator in another frontend (detected in
+ `fe_op_analysis`), extract the shared logic into a common utility header
+ rather than duplicating.
+
+---
+
+## Fallback Translator
+
+When a real OV mapping is unavailable:
+
+```cpp
+OutputVector translate_<op_name>_stub(const NodeContext& context) {
+ // FALLBACK: no OV op mapping — op is not yet supported.
+ // The FE Agent will escalate to Core Agent for a new core op.
+ OPENVINO_THROW("No FE translation for op: <op_name>");
+}
+```
+
+A fallback stub:
+- Keeps the model from crashing on unrelated unsupported ops.
+- Does **not** count as support.
+- Must be reported as `partial`, never `success`.
+- Always triggers the FE→Core escalation path.
+
+---
+
+## Output
+
+- Modified or created translator `.cpp` file (ready for commit/patch).
+- Notes for the Registration skill: which keys / macros need adding.
+- Translation complexity label: `real_translation` or `fallback_stub`.
diff --git a/.github/agents-prototype/skills/add-fe-op/step3-registration.md b/.github/agents-prototype/skills/add-fe-op/step3-registration.md
new file mode 100644
index 00000000000..c065d8fb40b
--- /dev/null
+++ b/.github/agents-prototype/skills/add-fe-op/step3-registration.md
@@ -0,0 +1,31 @@
+# Skill: FE Op Registration — Verification Checklist
+
+> For registration instructions see the per-frontend skill files:
+> - **PyTorch**: [pytorch.md](pytorch.md) §4 and §5 (op_table.cpp, TorchScript key, FX key)
+> - **ONNX**: [onnx.md](onnx.md) §4 (ONNX_OP macro in per-op `.cpp`)
+> - **TensorFlow / generic**: [SKILL.md](SKILL.md) §3
+
+Use this checklist to confirm registration is complete before proceeding to testing.
+
+---
+
+## Verification Checklist
+
+**PyTorch:**
+- [ ] `OP_CONVERTER(translate_<op_name>)` declaration present in `op_table.cpp`
+- [ ] TorchScript key `aten::<op_name>` registered
+- [ ] FX key `aten.<op_name>.default` registered
+- [ ] All overload variants covered (`aten.<op_name>.Tensor`, `aten.<op_name>.Scalar`, …)
+- [ ] `CMakeLists.txt` updated to include new `.cpp`
+
+**TensorFlow:**
+- [ ] `op_table.cpp` entry present (unary path or dedicated)
+- [ ] `CMakeLists.txt` updated
+
+**ONNX:**
+- [ ] `ONNX_OP` macro present in translator `.cpp` file (not in `ops_bridge.cpp`)
+- [ ] Opset range is accurate (cross-check with ONNX spec)
+- [ ] `CMakeLists.txt` updated
+
+**All frontends:**
+- [ ] No duplicate registrations introduced
diff --git a/.github/agents-prototype/skills/add-fe-op/step4-testing.md b/.github/agents-prototype/skills/add-fe-op/step4-testing.md
new file mode 100644
index 00000000000..e04d45c391f
--- /dev/null
+++ b/.github/agents-prototype/skills/add-fe-op/step4-testing.md
@@ -0,0 +1,74 @@
+# Skill: FE Op Testing
+
+> Source: `skills/add-fe-op/SKILL.md` (Steps 4, 5, 6)
+
+## Prerequisites
+
+- Completed **fe_op_registration** — translator file and registration entries are in place.
+
+---
+
+## Writing Tests
+
+Follow the test patterns described in the per-frontend skill files:
+- **PyTorch**: [pytorch.md](pytorch.md) §5 — `PytorchLayerTest` class structure, TorchScript and FX paths, `@pytest.mark.nightly` / `@pytest.mark.precommit`
+- **ONNX**: [onnx.md](onnx.md) §6 — `.prototxt` test model and C++ GTest pattern
+- **TensorFlow / generic**: follow naming conventions in `tests/layer_tests/tensorflow_tests/`
+
+Look at tests for a similar existing op in the same directory as the starting point.
+
+---
+
+## Conversion Validation
+
+After writing translator and registration, run the end-to-end conversion check using the
+**`verify-conversion`** skill:
+
+> Read and follow: `skills/verify-conversion/SKILL.md`
+
+The skill auto-detects the conversion path (optimum-intel / ovc / convert_model) and
+runs a numerical sanity check. Report the outcome (`validation=pass|fail|blocked`) back
+to the FE Agent before generating the patch.
+
+---
+
+## Git Patch Generation
+
+After translator, registration, and test files are written, generate a patch file.
+Run:
+
+```
+python .github/scripts/meat/generate_patch.py --component fe_<frontend> --op <op_name>
+```
+
+Place the resulting `.patch` file in `agent-results/frontend/patches/`.
+
+---
+
+## Save Patch and Report
+
+Write the patch path and validation status to the FE Agent output file:
+
+```
+python .github/scripts/meat/record_result.py --agent frontend --op <op_name> --patch <patch_path> --validation <pass|fail|blocked>
+```
+
+---
+
+## Reporting States
+
+| State | Meaning |
+|-------|---------|
+| `success` | Real translation in place, conversion produces OV graph nodes, tests written |
+| `partial` | Fallback stub in place — model does not crash, but no real OV graph yet |
+| `blocked` | Validation could not run (installed OV does not contain FE patch) |
+| `failed` | Translator or test produced errors |
+
+---
+
+## Output
+
+- Test files created and ready for commit.
+- Git patch file: `patches/fe_<op_name>_<frontend>.patch`
+- Patch available in `agent-results/pytorch-fe/patches/`.
+- Validation status reported back to FE Agent.
diff --git a/.github/agents-prototype/skills/add-fusion-transformation/SKILL.md b/.github/agents-prototype/skills/add-fusion-transformation/SKILL.md
new file mode 100644
index 00000000000..e49e5b0548e
--- /dev/null
+++ b/.github/agents-prototype/skills/add-fusion-transformation/SKILL.md
@@ -0,0 +1,141 @@
+---
+name: add-fusion-transformation
+description: Adds a new OpenVINO fusion transformation (subgraph to one or several operations) and corresponding tests.
+---
+
+# Agent Skill: Add New Fusion Transformation in OpenVINO
+
+## Goal
+Provide an instruction-only workflow to implement a new OpenVINO graph fusion transformation that replaces a matched subgraph with one operation (or a compact operation sequence), including regression tests.
+
+Expected outcome:
+
+- New transformation pass implementation
+- Pass registration in the appropriate pipeline
+- Positive and negative transformation tests
+- Functional coverage when behavior is user-visible
+
+---
+
+## Scope
+
+This workflow applies to OpenVINO transformation development in `openvino/` for:
+
+- **Fusion transformations** — pattern-based graph fusion that replaces a matched subgraph with:
+ - a single fused op, or
+ - several ops preserving semantics with lower runtime overhead
+ - _Purpose: optimization (reduced dispatch overhead, better hardware mapping)_
+
+- **Decomposition transformations** — pattern-based replacement that expands a complex op into a
+ sequence of simpler, already-supported ops:
+ - _Purpose: **enablement prerequisite** — makes an unsupported op runnable on all backends
+ without adding a new core op. Use when the semantics can be faithfully expressed via existing ops._
+ - Decomposition is the first thing to evaluate when a new op is needed. If the op is
+ decomposable, no new core op class is necessary.
+
+The workflow covers:
+
+1. Pattern design and safety guards
+2. Pass implementation and registration
+3. Runtime correctness constraints (shape/type/friendly name/rt_info)
+4. Unit and functional regression tests
+
+---
+
+## Architecture
+
+Model Graph → Pattern Matcher Pass → Subgraph Replacement → Validation/Inference Tests
+
+---
+
+## Expected Repository Layout
+
+openvino/
+├─ src/common/transformations/
+│ ├─ include/transformations/
+│ │ └─ <domain>/<fusion_name>.hpp
+│ ├─ src/transformations/
+│ │ └─ <domain>/<fusion_name>.cpp
+│ ├─ src/transformations/common_optimizations/
+│ │ └─ common_optimizations.cpp (or relevant pipeline file)
+│ └─ tests/
+│ ├─ common_optimizations/
+│ │ └─ <fusion_name>.cpp
+│ └─ utils/
+└─ tests/
+ └─ layer_tests/ or functional/ (if user-visible behavior/perf contract is affected)
+
+---
+
+## Instruction Workflow
+
+### 1) Confirm the fusion does not already exist
+- Search for equivalent matcher patterns and passes.
+- If similar fusion exists, extend it instead of creating a duplicate pass.
+- Reuse existing helper utilities and pattern predicates where possible.
+
+### 2) Define fusion contract before coding
+- Specify exact matched subgraph topology and constraints.
+- Specify replacement graph (single op or multi-op compact form).
+- Document semantic invariants:
+ - output values
+ - element types
+ - ranks/dynamic-shape compatibility
+ - runtime info / friendly names
+- Identify explicit no-fuse conditions (negative guards).
+
+### 3) Implement matcher pass
+- Add pass class declaration in header and implementation in source.
+- Prefer `ov::pass::MatcherPass` for local rewrite; use `GraphRewrite` only when grouping multiple related matchers.
+- Make predicates strict enough to avoid unsafe rewrites.
+- Preserve node names and `rt_info` where expected.
+- Register and copy runtime info for replacement nodes.
+- Avoid hidden behavior changes; if assumptions are violated, do not fuse.
+
+### 4) Register pass in the right optimization pipeline
+- Add the pass to the appropriate transformation pipeline file.
+- Keep registration order consistent with dependencies (producer fusions before consumer fusions when required).
+- Do not widen pass scope beyond the intended domain.
+
+### 5) Add transformation unit tests
+- Add tests under transformations test suite with:
+ - positive case(s): pattern is fused
+ - negative case(s): pattern must remain unchanged when guards fail
+ - dynamic-shape/type coverage where relevant
+- Compare transformed function against expected reference graph.
+- Ensure tests validate both structure and semantics.
+
+### 6) Add functional/layer tests when externally observable
+- If fusion changes user-visible behavior/performance-sensitive execution path, add/extend functional tests.
+- Cover representative input shapes/dtypes and backend-relevant conditions.
+- Keep tests minimal and deterministic.
+
+### 7) Validate and finalize
+- Ensure pass is deterministic and idempotent.
+- Verify no duplicated matcher registration.
+- Confirm no fallback behavior silently changes model semantics.
+- Report one of:
+ - fully implemented + covered,
+ - partially implemented (missing functional coverage),
+ - blocked with explicit reason.
+
+---
+
+## Fusion Design Recommendations
+
+- Prefer root-cause optimization: fuse only when the resulting graph is strictly safer/faster or equivalent.
+- Favor existing OpenVINO ops over introducing new custom ops unless required.
+- Keep pattern predicates robust for partial/dynamic shapes.
+- Avoid expensive checks in hot transformation loops when cheaper predicates exist.
+- Reuse canonical helper utilities for constants, shape checks, and node replacement.
+
+---
+
+## Notes
+
+- Keep this skill instruction-only in markdown.
+- Do not claim fusion support without both positive and negative tests.
+- Avoid broad refactoring unrelated to the fusion objective.
+- Preserve compatibility with existing passes and test baselines.
+
+```
\ No newline at end of file
diff --git a/.github/agents-prototype/skills/add-fusion-transformation/step1-analysis.md b/.github/agents-prototype/skills/add-fusion-transformation/step1-analysis.md
new file mode 100644
index 00000000000..5f6dae6ba6e
--- /dev/null
+++ b/.github/agents-prototype/skills/add-fusion-transformation/step1-analysis.md
@@ -0,0 +1,132 @@
+# Skill: OpenVINO Transformation Analysis
+
+## Purpose
+
+Analyse an OpenVINO IR sub-graph to identify the optimal fusion pattern and
+transformation type before any implementation work begins. Produces a structured
+`transformation_analysis.md` that the implementation skill consumes.
+
+## When to invoke
+
+- Transformation Agent Step 1
+- Any time you need to decide *which* `ov::pass` class to use and *why*
+
+---
+
+## Steps
+
+### Step 1: Load Op Spec and Existing Graph
+
+Obtain the op spec from `agent-results/core-opspec/` (written by Core OpSpec Agent).
+If not available, find the op specification in the OpenVINO documentation directory:
+`docs/articles_en/documentation/openvino-ir-format/operation-sets/`
+
+Export the target model to IR and locate the sub-graph visually using the
+OpenVINO Model Explorer or by reading the XML file directly. Focus on
+identifying:
+- Which node types appear before/after the target op
+- Constant vs. dynamic inputs on each node
+- Shape and dtype at each port
+- Output consumer count for each node
+
+### Step 2: Draw the Sub-Graph Pattern
+
+Produce a textual node diagram (**this is an example structure — adapt to your actual sub-graph**):
+
+```
+Parameter(input) ──► MatMul ──────────────► Add ──► Result
+ ▲ ▲
+Constant(weights) ─────┘ Constant(bias) ──┘
+```
+
+For each node record:
+- Op type and version (e.g. `MatMul v0`)
+- Input sources: parameter (dynamic), constant (static), intermediate (op output)
+- Output consumers (does anything else use this output?)
+- Shape and dtype at each port
+
+### Step 3: Identify Constant Constraints
+
+A `MatcherPass` can only reliably fuse when certain inputs are `Constant` nodes
+(otherwise the fusion is not safe at compile time). List each input and whether
+it must be constant for the fusion to be valid.
+
+If non-constant inputs must be treated as runtime values, the transformation may
+need to be a `FunctionPass` or use symbolic shape analysis.
+
+### Step 4: Classify Transformation Type
+
+Apply this decision tree:
+
+```
+Is the fusion local (fixed sub-graph topology)?
+ YES → Does it need to run before any other pass touches these nodes?
+ YES → MatcherPass registered early in common_optimizations
+ NO → MatcherPass registered at the appropriate priority slot
+ NO → Does the pass need consumer information (backward)?
+ YES → BackwardGraphRewrite
+ NO → FunctionPass (iterate over all nodes manually)
+```
+
+| Type | When | Examples in codebase |
+|---|---|---|
+| `MatcherPass` | Local topology, pattern of 2-10 ops | `FuseMHATokensSplit`, `FuseConvolutionSimpleLeakyRelu` |
+| `FunctionPass` | Multi-pattern or graph-wide | `ConstantFolding`, `AlignMixedFP32FP16Types` |
+| `BackwardGraphRewrite` | Consumer-first needed | `ConvertPrecision` (when checking all consumers) |
+| `GraphRewrite` | Forward multi-pattern | Wraps multiple `MatcherPass` instances |
+
+### Step 5: Find a Template to Follow
+
+Search for the syntactically closest existing transformation in `src/common/transformations/`
+by subgraph depth and operator types. For example, if your pattern fuses two ops, look for
+existing two-op fusions; if it decomposes a complex op, look for similar decompositions.
+
+Search the headers directory to find candidates:
+
+```
+dir src\common\transformations\include\transformations\common_optimizations\
+```
+
+Read the closest match in full — it is your implementation template.
+Do not copy-paste; understand each section before adapting it to your pattern.
+
+### Step 6: Output `transformation_analysis.md`
+
+Write your analysis result to `agent-results/transformation/transformation_analysis.md`.
+Include at minimum:
+- ASCII diagram of the matched sub-graph
+- Chosen transformation type and rationale
+- Constant constraints for each input
+- Template reference (path to the transformation used as template)
+- Registration target (which pipeline file and position)
+
+**Example output structure** (adapt content to your specific transformation):
+
+```
+## Transformation Analysis
+
+Target pattern: [ASCII diagram]
+
+Transformation type: MatcherPass
+
+Rationale: Fixed topology of 3 ops with constant weights and bias.
+MatcherPass is optimal — fires once per match with O(n) complexity.
+
+Constant constraints:
+- weights: MUST be Constant
+- bias: MUST be Constant
+
+Template reference:
+src/common/transformations/src/transformations/common_optimizations/fuse_u4_weights_zero_point.cpp
+
+Registration target:
+src/common/transformations/src/transformations/common_optimizations/common_optimizations.cpp
+```
+
+---
+
+## Output
+
+`transformation_analysis.md` written to `artifacts/` or posted as issue comment.
+Contains everything required by `openvino_transformation_implementation` to start
+coding without further research.
diff --git a/.github/agents-prototype/skills/add-fusion-transformation/step2-implementation.md b/.github/agents-prototype/skills/add-fusion-transformation/step2-implementation.md
new file mode 100644
index 00000000000..ae5c9ce5e4b
--- /dev/null
+++ b/.github/agents-prototype/skills/add-fusion-transformation/step2-implementation.md
@@ -0,0 +1,157 @@
+# Skill: OpenVINO Transformation Implementation
+
+## Purpose
+
+Implement a single OpenVINO `MatcherPass` / `FunctionPass` / `BackwardGraphRewrite`
+from the `transformation_analysis.md` produced by the analysis skill.
+Covers: header, source, CMake registration, pass-pipeline registration.
+
+## When to invoke
+
+- Transformation Agent Step 2 (after analysis is complete)
+- When a `patch_type=transformation` git patch exists and needs refinement
+
+---
+
+## Steps
+
+### Step 1: Create Header File
+
+Location: `src/common/transformations/include/transformations/<domain>/<pass_name>.hpp`
+
+Read an existing transformation header as your template. Good references:
+- `src/common/transformations/include/transformations/common_optimizations/fuse_u4_weights_zero_point.hpp`
+- `src/common/transformations/include/transformations/common_optimizations/matmul_multiply_fusion.hpp`
+
+Every header must include:
+- `OPENVINO_RTTI("ClassName", "0")` macro
+- `TRANSFORMATIONS_API` export macro
+- A doxygen comment with before/after ASCII diagram
+
+Do not copy-paste the template file directly; read and adapt the structure.
+
+### Step 2: Create Source File
+
+Location: `src/common/transformations/src/<domain>/<pass_name>.cpp`
+
+Use the template below as your starting point, then read the closest existing transformation to
+adapt the pattern to your sub-graph:
+
+```cpp
+// Starting template — adapt node types, input count, and guards to your sub-graph.
+
+<PassName>::<PassName>() {
+ MATCHER_SCOPE(<PassName>);
+
+ // Describe the pattern bottom-up (root last):
+ auto input = pattern::any_input();
+ auto weights = pattern::wrap_type<ov::op::v0::Constant>();
+ auto root_op = pattern::wrap_type<ov::op::vN::SomeOp>({input, weights});
+
+ ov::matcher_pass_callback callback = [=](pattern::Matcher& m) {
+ const auto& pmap = m.get_pattern_map();
+ const auto& root = pmap.at(root_op);
+
+ // Guard: skip if node is shared (multiple consumers)
+ if (root->get_output_target_inputs(0).size() != 1)
+ return false;
+
+ auto fused = std::make_shared<ov::op::vN::FusedOp>(
+ pmap.at(input), pmap.at(weights));
+ ov::copy_runtime_info({root}, fused);
+ fused->set_friendly_name(root->get_friendly_name());
+ ov::replace_node(root, fused);
+ return true;
+ };
+
+ auto m = std::make_shared<pattern::Matcher>(root_op, matcher_name);
+ register_matcher(m, callback);
+}
+```
+
+Key implementation patterns to follow from the template:
+
+- Use `MATCHER_SCOPE(ClassName)` at the start of the constructor
+- Use `pattern::wrap_type<Op>({...})` for node matching
+- Use `pattern::consumers_count(N)` to guard on consumer count
+- Call `ov::copy_runtime_info({old_nodes...}, new_node)` before replacement
+- Call `fused->set_friendly_name(root->get_friendly_name())`
+- Call `ov::replace_node(old_root, new_node)` as the last step
+- Return `true` from callback on successful replacement
+
+Real transformations to read before adapting your code:
+- `src/common/transformations/src/transformations/common_optimizations/fuse_u4_weights_zero_point.cpp`
+- `src/common/transformations/src/transformations/common_optimizations/matmul_multiply_fusion.cpp`
+
+For `FunctionPass` (full-graph traversal), read:
+- `src/common/transformations/src/transformations/common_optimizations/align_mixed_fp32_fp16_types.cpp`
+
+### Step 3: Update CMakeLists.txt
+
+The CMake build system picks up any `.cpp` file listed in the `LIBRARY_SRC` variable.
+Add your new `.cpp` to `src/common/transformations/CMakeLists.txt` in the `LIBRARY_SRC` set.
+Add the corresponding `.hpp` to `PUBLIC_HEADERS`.
+
+**Do not add a new `add_library` or `add_test_target` call** — the existing targets
+already compile everything in `LIBRARY_SRC`.
+
+### Step 4: Register in the Pass Pipeline
+
+**For general (all-backend) use:**
+```cpp
+// src/common/transformations/src/transformations/common_optimizations/common_optimizations.cpp
+// Find the block of ADD_MATCHER calls. Insert in priority order.
+ADD_MATCHER(manager, FuseMyOp)
+```
+
+**For backend-specific use (CPU only):**
+```cpp
+// src/plugins/intel_cpu/src/graph_optimizer.cpp
+ApplyCommonOptimizations::run_on_model(model) {
+ ...
+ manager.register_pass<ov::pass::FuseMyOp>();
+ ...
+}
+```
+
+**With pass config (opt-in by consumer):**
+```cpp
+manager.register_pass<ov::pass::FuseMyOp>();
+// Disabled by default; backend enables explicitly:
+pass_config->enable<ov::pass::FuseMyOp>();
+```
+
+### Step 5: Self-Check
+
+After writing implementation and tests, verify the transformation fires correctly.
+Run the cross-platform validation script:
+
+```
+python .github/scripts/meat/validate_transformation.py --pass-name <ClassName>
+```
+
+The script loads the model at `agent-results/analyze-and-convert/ov_model_*/openvino_model.xml`,
+applies the transformation, and reports whether the fused op appears in the resulting graph.
+
+---
+
+## Common Pitfalls
+
+| Problem | Fix |
+|---|---|
+| Pass fires but output shape is wrong | Call `fused->validate_and_infer_types()` after replacing |
+| Pattern matches but replacement crashes | Ensure all `shared_ptr` casts are checked with `ov::as_type_ptr` |
+| Pass fires on non-constant input | Add `pattern::wrap_type<Constant>()` with a predicate check in callback |
+| Pass does not fire at all | Verify node consumer count (`consumers_count`) and output port indices |
+| Accuracy drops after fusion | Check that the fused op handles transposed inputs the same way as the original sub-graph |
+
+---
+
+## Output
+
+Modified files:
+- `src/common/transformations/include/transformations/<domain>/<pass_name>.hpp`
+- `src/common/transformations/src/<domain>/<pass_name>.cpp`
+- `src/common/transformations/CMakeLists.txt`
+- `src/common/transformations/src/transformations/common_optimizations/common_optimizations.cpp`
+ (or backend-specific file)
diff --git a/.github/agents-prototype/skills/add-fusion-transformation/workflow.md b/.github/agents-prototype/skills/add-fusion-transformation/workflow.md
new file mode 100644
index 00000000000..b44f8fae476
--- /dev/null
+++ b/.github/agents-prototype/skills/add-fusion-transformation/workflow.md
@@ -0,0 +1,230 @@
+# Skill: Add OpenVINO Fusion Transformation (End-to-End)
+
+> **Upstream skill spec:** `skills/add-fusion-transformation/SKILL.md`
+> This file is the Copilot-ready, agent-executable version of that specification.
+
+## Purpose
+
+End-to-end workflow for implementing a new **pattern-based graph fusion or decomposition
+transformation** in OpenVINO. Covers: problem framing → design → implementation →
+registration → unit tests → patch generation.
+
+Based on the OpenVINO transformation API patterns in `src/common/transformations/`.
+
+---
+
+## Architecture
+
+```
+Model Graph → Pattern Matcher Pass → Subgraph Replacement → Validation/Inference Tests
+```
+
+---
+
+## Repository Layout
+
+```
+openvino/
+├─ src/common/transformations/
+│ ├─ include/transformations/
+│ │ └─ <domain>/<fusion_name>.hpp
+│ ├─ src/transformations/
+│ │ └─ <domain>/<fusion_name>.cpp
+│ ├─ src/transformations/common_optimizations/
+│ │ └─ common_optimizations.cpp (or relevant pipeline file)
+│ └─ tests/
+│ ├─ common_optimizations/
+│ │ └─ <fusion_name>.cpp
+│ └─ utils/
+└─ tests/
+ └─ layer_tests/ or functional/ (if user-visible behavior/perf contract is affected)
+```
+
+---
+
+## When to invoke
+
+- Transformation Agent, whenever a new fusion pass needs to be created from scratch
+- `patch_type=transformation` shortcut path (incoming patch already exists — apply,
+ validate, then follow Steps 4–6 for testing and registration)
+
+---
+
+## Steps
+
+### Step 1: Confirm the fusion does not already exist
+
+- Search for equivalent matcher patterns and passes (`grep -r "MatcherPass\|register_pass" src/common/transformations/`).
+- If a similar fusion exists, extend it instead of creating a duplicate pass.
+- Reuse existing helper utilities and pattern predicates where possible.
+
+---
+
+### Step 2: Define fusion contract and understand the problem
+
+Before writing any code:
+
+1. **Read the op spec** (from Core OpSpec Agent or issue comment) to confirm:
+ - What does the new fused op do?
+ - What sub-graph does it replace?
+ - Are there accuracy or performance requirements?
+
+2. **Confirm the fusion makes sense at graph level:**
+ - The pattern must be composable (inputs/outputs align exactly)
+ - No side-effecting ops in the middle of the pattern
+ - The replacement preserves dtype and broadcast semantics
+
+3. **Specify semantic invariants** documented before coding:
+ - Output values, element types, ranks/dynamic-shape compatibility
+ - Runtime info / friendly names preserved
+ - Explicit no-fuse conditions (negative guards)
+
+4. **Choose the pass type** using `openvino_transformation_analysis` skill.
+
+### Step 3: Design the Fusion Pattern
+
+Produce a before/after diagram:
+
+```
+BEFORE:
+ x ──► MatMul(transB=true) ──► Add ──► gate1
+ ▲ ▲
+ W ───────┘ bias ────────┘
+
+AFTER:
+ x ──► FusedLinear(W, bias) ──► gate1
+```
+
+Write down:
+- Matching conditions (e.g., `transB=true` required, `bias` must be 1-D Constant)
+- Output consumer constraints (e.g., `Add` must have exactly one consumer)
+- Edge case exclusions (e.g., no fusion when weights are FP16 quantised)
+
+### Step 4: Implement Header and Source
+
+Follow **`openvino_transformation_implementation`** skill exactly.
+
+Checklist after writing:
+- [ ] `OPENVINO_RTTI("ClassName", "0")` present
+- [ ] `MATCHER_SCOPE` macro used (sets `matcher_name`)
+- [ ] `ov::copy_runtime_info` called before `ov::replace_node`
+- [ ] `friendly_name` copied from the root node of the replaced sub-graph
+- [ ] No raw `delete` or manual output re-wiring
+
+### Step 5: Register the Pass
+
+Determine registration location from the analysis output.
+
+For **common_optimizations**, find the section that groups related passes and insert
+your pass alphabetically/logically within that group.
+
+The CMake build system picks up any new `.cpp` in `src/common/transformations/src/` automatically
+— **do NOT manually edit `CMakeLists.txt`** unless you are adding a new subdirectory.
+
+Verify the registration order does not break existing passes:
+- Constant folding must run BEFORE pattern-matching passes that require constant inputs
+- Layout-changing passes must run AFTER all arithmetic fusions
+
+### Step 6: Write Unit Tests
+
+Location: `src/common/transformations/tests/<domain>/`
+
+Required test file: `test_<pass_name>.cpp`
+
+Read the closest existing transformation test as your template. Good references:
+- `src/common/transformations/tests/common_optimizations/fuse_u4_weights_zero_point.cpp`
+- `src/common/transformations/tests/common_optimizations/matmul_multiply_fusion_tests.cpp`
+
+Each test file must include at minimum:
+- **One positive test** (`TransformationTestsF`) that verifies the pattern fires and produces the expected replacement graph.
+- **One negative test** that verifies the pattern does NOT fire when a guard condition fails (e.g., non-constant weights, multi-consumer output).
+- **One output-type-preservation test** for FP16/BF16 inputs if the fusion touches precision.
+
+**Functional / layer tests (when externally observable):**
+If the fusion changes user-visible behavior or a performance-sensitive execution path,
+add/extend functional tests under `tests/layer_tests/` or `tests/functional/`.
+Keep tests minimal and deterministic.
+
+### Step 7: Build, Verify and Generate Patch
+
+```bash
+# Build only the transformations library and its tests
+cmake --build build/ --target ov_transformations_func_tests -j$(nproc)
+
+# Run only this test
+./build/src/common/transformations/tests/ov_transformations_func_tests \
+ --gtest_filter="*FuseMyOp*"
+```
+
+All three tests must pass:
+- `FuseMyOp_Basic` → PASSED
+- `FuseMyOp_Negative_DynamicWeights` → PASSED
+- `FuseMyOp_OutputTypePreserved` → PASSED
+
+**Validate and finalize before generating the patch:**
+- Ensure the pass is deterministic and idempotent.
+- Verify no duplicated matcher registration.
+- Confirm no fallback behavior silently changes model semantics.
+
+#### Generate the patch
+
+```bash
+git add src/common/transformations/
+git commit -m "transformations: add FuseMyOp MatcherPass
+
+Fuses MatMul(transB=true) + Add(constant_bias) into a single
+MyFusedOp to reduce kernel dispatch overhead.
+
+Refs: #<issue_number>"
+
+git format-patch HEAD~1 --stdout > \
+ transformation-fuse-my-op-${GITHUB_RUN_ID}.patch
+```
+
+The patch is available in `agent-results/transformation/` for collection by the orchestrator.
+
+---
+
+## Fusion Design Recommendations
+
+- Prefer root-cause optimization: fuse only when the resulting graph is strictly safer/faster or equivalent.
+- Favor existing OpenVINO ops over introducing new custom ops unless required.
+- Keep pattern predicates robust for partial/dynamic shapes.
+- Avoid expensive checks in hot transformation loops when cheaper predicates exist.
+- Reuse canonical helper utilities for constants, shape checks, and node replacement.
+- Prefer `ov::pass::MatcherPass` for local rewrite; use `GraphRewrite` only when grouping multiple related matchers.
+- Avoid hidden behavior changes; if assumptions are violated, do not fuse.
+
+---
+
+## Design Checklist (before declaring success)
+
+- [ ] Pattern fires exactly once per matching sub-graph (not multiple times)
+- [ ] Pattern does NOT fire on known negative cases (non-constant inputs, wrong consumer count)
+- [ ] Friendly name is preserved on the fused node
+- [ ] RT info propagated with `copy_runtime_info`
+- [ ] Output type and shape inferred correctly after fusion
+- [ ] Pass registered at the correct position in the pipeline
+- [ ] Both header and source files added to CMakeLists.txt
+- [ ] At least 3 unit tests written (positive, negative, type-preservation)
+- [ ] Patch generated and saved to agent-results/transformation/
+
+---
+
+## Notes
+
+- Do not claim fusion support without both positive and negative tests.
+- Avoid broad refactoring unrelated to the fusion objective.
+- Preserve compatibility with existing passes and test baselines.
+- Only touches `src/common/transformations/` (general) or the specific plugin path
+ if the transformation is backend-exclusive — never both in the same implementation.
+
+---
+
+## Key References
+
+- Transformation API docs: https://docs.openvino.ai/2025/documentation/openvino-extensibility/transformation-api.html
+- Existing fusion examples:
+ - `src/common/transformations/src/transformations/common_optimizations/fuse_u4_weights_zero_point.cpp`
+ - `src/common/transformations/src/transformations/common_optimizations/matmul_multiply_fusion.cpp`
+- Test utilities: `src/common/transformations/tests/utils/compare_graphs.hpp`
diff --git a/.github/agents-prototype/skills/add-gpu-op/SKILL.md b/.github/agents-prototype/skills/add-gpu-op/SKILL.md
new file mode 100644
index 00000000000..b231b12d5d7
--- /dev/null
+++ b/.github/agents-prototype/skills/add-gpu-op/SKILL.md
@@ -0,0 +1,33 @@
+---
+name: add-gpu-op
+description: Add a new operation to the OpenVINO GPU plugin — OpenCL kernel design, oneDNN-backed paths, sub-group/LWS tuning, and functional tests.
+---
+
+# Skill: Add GPU Op
+
+## When to use
+When the Core OpSpec agent has produced a new op spec and you need to implement
+GPU plugin support: kernel implementation, registration, and testing.
+
+## Steps
+
+Execute in order — each step produces artifacts consumed by the next.
+
+| Step | File | Purpose |
+|---|---|---|
+| 0a | [step0-plan.md](step0-plan.md) | Read op spec, build implementation plan, decide kernel vs oneDNN path |
+| 0b | [step0-parse-spec.md](step0-parse-spec.md) | Parse op spec JSON/MD into GPU-readable format |
+| 1 | [step1-hardware-analysis.md](step1-hardware-analysis.md) | Identify hardware constraints, sub-group size, memory layout requirements |
+| 2 | [step2-file-structure.md](step2-file-structure.md) | Create kernel and primitive files, register in factory |
+| 3a | [step3-kernel-development.md](step3-kernel-development.md) | Write OpenCL kernel (blocked reads, sub-groups, LWS tuning) |
+| 3b | [step3-write-tests.md](step3-write-tests.md) | Write layer tests |
+| 3c | [step3-run-tests.md](step3-run-tests.md) | Run and verify tests |
+| 3d | [step3-profiling.md](step3-profiling.md) | Profile and tune kernel |
+| 4 | [step4-onednn-integration.md](step4-onednn-integration.md) | Add oneDNN-backed primitive path where applicable |
+| 5 | [step5-optimize.md](step5-optimize.md) | Final performance optimizations |
+
+## Entry point for orchestrated use
+
+When invoked by the GPU Agent or Enable Operator Agent, start from
+[orchestrator.md](orchestrator.md) — it selects the relevant subset of steps
+based on the op type and available hardware.
diff --git a/.github/agents-prototype/skills/add-gpu-op/opset-migration.md b/.github/agents-prototype/skills/add-gpu-op/opset-migration.md
new file mode 100644
index 00000000000..b455e62e6ed
--- /dev/null
+++ b/.github/agents-prototype/skills/add-gpu-op/opset-migration.md
@@ -0,0 +1,179 @@
+---
+name: gpu-opset-migration
+description: Opset version update and migration strategy for OpenVINO GPU plugin operations
+---
+
+# Purpose
+
+Guide the process of updating GPU plugin operations when OpenVINO introduces new Opset versions. Ensures backward compatibility, proper spec analysis, and correct handling of new data types (bf16, fp16).
+
+# When to Use
+
+Use this skill when:
+- A new OpenVINO Opset version is released and existing GPU ops need updating
+- Migrating an operation from an older Opset version to a newer one
+- Adding support for new data types introduced in a new Opset
+
+```mermaid
+flowchart TD
+ A[New Opset Released] --> B[Analyze Spec Changes]
+ B --> C{Breaking Changes?}
+ C -->|Yes| D[Plan Migration]
+ C -->|No| E[Version Bump Only]
+ D --> F[Implement Changes]
+ F --> G[Verify Backward Compat]
+ E --> G
+ G --> H[Test All Versions]
+ H --> I[Done]
+```
+
+# Procedure
+
+1. **Step 1: Spec Analysis** — Compare old and new Opset versions for the target Op
+2. **Step 2: Backward Compatibility** — Ensure legacy behavior is preserved
+3. **Step 3: Data Type Support** — Add new data type support if required
+4. **Step 4: Implementation** — Update the GPU plugin code
+5. **Step 5: Verification** — Test both old and new Opset versions
+
+---
+
+# Prerequisites Check
+
+Verify you have access to the OpenVINO Opset specifications:
+
+**Windows (PowerShell):**
+```powershell
+# Check if OpenVINO source is available with opset definitions
+Test-Path "src\core\include\openvino\op\ops.hpp"
+```
+
+**Ubuntu:**
+```bash
+# Check if OpenVINO source is available with opset definitions
+test -f src/core/include/openvino/op/ops.hpp && echo "OK" || echo "MISSING"
+```
+
+- **If successful:** Proceed to "Quick Start - Main Steps"
+- **If failed:** Clone or checkout the OpenVINO repository first
+
+---
+
+# Quick Start
+
+## Installation (Prerequisites Check failed)
+
+Ensure the OpenVINO source tree is available. Clone from:
+```bash
+git clone https://github.com/openvinotoolkit/openvino.git
+```
+
+---
+
+## Main Steps (Prerequisites Check passed)
+
+### Step 1: Spec Analysis
+
+Compare Opset versions to identify changes. Invoke `parse-op-spec` for both the old and new Opset version specs to produce structured summaries, then compare:
+
+1. **Locate the Op specification** in:
+ - `src/core/include/openvino/op/` — C++ Op definitions
+ - OpenVINO Opset documentation: https://docs.openvino.ai/latest/openvino_docs_ops_opset.html
+
+2. **Compare versions** — Identify:
+ - New attributes or parameters added
+ - Changed behavior or semantics
+ - New input/output specifications
+ - Deprecated features
+
+3. **Document changes** in a comparison table:
+
+| Aspect | Old Version | New Version | Impact |
+|---|---|---|---|
+| Attributes | ... | ... | ... |
+| Inputs/Outputs | ... | ... | ... |
+| Behavior | ... | ... | ... |
+
+### Step 2: Backward Compatibility
+
+**Critical rule:** Legacy behavior must be preserved.
+
+- If the new version adds optional parameters, set defaults matching the old version's behavior
+- If semantics changed, maintain a version check in the implementation
+- Support both old and new Opset versions simultaneously
+
+**Pattern:**
+```cpp
+// Example: Version-aware implementation
+if (op_version >= 14) {
+ // New behavior
+} else {
+ // Legacy behavior (must match old opset exactly)
+}
+```
+
+### Step 3: Data Type Support
+
+Check `clinfo` extensions for hardware data type support:
+
+| Extension | Data Type | Notes |
+|---|---|---|
+| `cl_khr_fp16` | fp16 (half) | Most Intel GPUs support this |
+| `cl_intel_bfloat16_conversions` | bf16 | Xe-HPG (Arc) and newer |
+| `cl_khr_fp64` | fp64 (double) | Rarely needed; not on all GPUs |
+
+**Windows (PowerShell):**
+```powershell
+clinfo | Select-String -Pattern "cl_khr_fp16|cl_intel_bfloat16|cl_khr_fp64"
+```
+
+**Ubuntu:**
+```bash
+clinfo | grep -E "cl_khr_fp16|cl_intel_bfloat16|cl_khr_fp64"
+```
+
+If a new Opset requires `bf16`/`fp16`:
+- Add data type support to the kernel selector
+- Update JitConstants with appropriate type definitions
+- Add test cases for new data types
+
+### Step 4: Implementation
+
+Update the following files (see `gpu-op-file-structure` skill for paths):
+
+1. **Op translation** (`src/plugins/intel_gpu/src/plugin/ops/<op_name>.cpp`):
+ - Update `Create<OpName>Op` to handle new Opset version
+ - Map new attributes to primitive parameters
+
+2. **Primitive** (`src/plugins/intel_gpu/include/intel_gpu/primitives/<op_name>.hpp`):
+ - Add new fields if the Opset adds parameters
+
+3. **Kernel implementation** (kernel selector files):
+ - Update JitConstants for new parameters
+ - Modify OpenCL kernel if operation logic changed
+
+### Step 5: Verification
+
+Invoke `write-gpu-tests` to add test cases for the new Opset version and data types, then invoke `run-gpu-tests` to execute:
+
+1. **New version tests:** Run functional tests filtered to the target op
+2. **Backward compatibility:** Run functional tests also for the old Opset version filter (`*<OpName>*v<OldVersion>*`)
+
+Both must pass before the migration is considered complete.
+
+---
+
+# Troubleshooting
+
+- **Old tests fail after migration**: Check that default values match the old Opset behavior
+- **New data type not supported**: Verify hardware support via `clinfo` extensions
+- **Type mismatch errors**: Ensure kernel selector handles all supported data types
+- **Missing Op in new Opset**: Check if the Op was renamed or merged with another Op
+- **Backward compat breaks**: Review all code paths — version checks must cover all branches
+
+---
+
+# References
+
+- Related skills: `gpu-kernel-enabling`, `gpu-op-file-structure`, `collect-gpu-hardware-spec`, `write-gpu-tests`, `run-gpu-tests`
+- OpenVINO Opset documentation: https://docs.openvino.ai/latest/openvino_docs_ops_opset.html
+- Op definitions: `src/core/include/openvino/op/`
diff --git a/.github/agents-prototype/skills/add-gpu-op/orchestrator.md b/.github/agents-prototype/skills/add-gpu-op/orchestrator.md
new file mode 100644
index 00000000000..ad63479a990
--- /dev/null
+++ b/.github/agents-prototype/skills/add-gpu-op/orchestrator.md
@@ -0,0 +1,170 @@
+---
+name: intel-gpu-kernel
+description: Entry point for OpenVINO GPU plugin kernel implementation — guides the full development workflow from hardware spec collection through kernel enabling, profiling, and optimization by routing to specialized sub-skills
+---
+
+# Purpose
+
+Orchestrate the full development workflow for Intel OpenVINO GPU plugin kernel implementation, covering both custom OpenCL kernels and oneDNN primitive integration, by routing to specialized sub-skills for each phase.
+
+# When to Use
+
+Use this skill as the **entry point** for any Intel OpenVINO GPU plugin kernel implementation task. It will guide you through the complete workflow by referencing the appropriate sub-skill at each stage.
+
+**CRITICAL**: Before generating any kernel code, you must collect the target hardware specifications via `clinfo` (see `collect-gpu-hardware-spec` skill).
+
+# Procedure
+
+Follow this workflow in order. Each step links to a dedicated skill with detailed procedures.
+
+1. **Step 0:** Analyze the Op spec and create an implementation plan (`plan-op-implementation` with `parse-op-spec`)
+2. **Step 1:** Collect target GPU hardware specs via clinfo (`collect-gpu-hardware-spec`)
+3. **Step 2:** Build the OpenVINO tree with GPU enabled (`build-openvino`)
+4. **Step 3:** Determine file locations and naming conventions (`gpu-op-file-structure`)
+5. **Step 4:** Implement C++ primitives, create ref kernel, write and run tests (`gpu-kernel-enabling` → `write-gpu-tests` → `run-gpu-tests`)
+6. **Step 4.5:** *(Conditional)* Integrate oneDNN primitive if available (`gpu-integrate-onednn-primitive`)
+7. **Step 5:** *(Mandatory)* Apply hardware-aware optimizations and produce Performance Comparison Report (`gpu-kernel-optimize`)
+
+> `gpu-kernel-device-timing` is used as a utility within Steps 4, 4.5, and 5.
+
+---
+
+# Prerequisites Check
+
+This is a routing skill — it delegates work to sub-skills. Verify you are in the OpenVINO source tree:
+
+**Windows (PowerShell):**
+```powershell
+# Verify OpenVINO GPU plugin source tree is available
+Test-Path "src\plugins\intel_gpu\src\kernel_selector\kernels"
+```
+
+**Ubuntu:**
+```bash
+# Verify OpenVINO GPU plugin source tree is available
+test -d src/plugins/intel_gpu/src/kernel_selector/kernels && echo "OK" || echo "MISSING"
+```
+
+- **If successful:** Proceed to "Quick Start - Main Steps"
+- **If failed:** Ensure you are in the OpenVINO source root directory
+
+---
+
+# Quick Start
+
+## Installation (Prerequisites Check failed)
+
+Clone or navigate to the OpenVINO source repository:
+```bash
+git clone https://github.com/openvinotoolkit/openvino.git
+cd openvino
+```
+
+---
+
+## Main Steps (Prerequisites Check passed)
+
+Follow the Development Workflow below. Each step routes to a dedicated sub-skill.
+
+# Development Workflow
+
+```mermaid
+flowchart TD
+ Z[New Op Request] --> A["Step 0: plan-op-implementation\n(with parse-op-spec)"]
+ A --> B[Step 1: collect-gpu-hardware-spec]
+ B --> C[Step 2: build-openvino]
+ C --> D[Step 3: gpu-op-file-structure]
+ D --> E["Step 4: gpu-kernel-enabling\n→ write-gpu-tests → run-gpu-tests"]
+ E --> E1[Ref Baseline: gpu-kernel-device-timing]
+ E1 --> F{oneDNN primitive available?}
+ F -->|Yes| G[Step 4.5: gpu-integrate-onednn-primitive]
+ F -->|No| J
+ G --> J
+ J["Step 5: gpu-kernel-optimize (MANDATORY)"] --> J1[Opt Measurement: gpu-kernel-device-timing]
+ J1 --> K[Performance Comparison Report]
+ K --> L[Done]
+
+ subgraph Existing Op
+ N[Existing Op Needs New Opset Support?] --> M[gpu-opset-migration]
+ end
+
+ style E1 fill:#e0e0ff,stroke:#888
+ style J1 fill:#e0e0ff,stroke:#888
+```
+
+> **Note:** `gpu-kernel-device-timing` is a utility sub-skill used within Steps 4 and 5 to measure kernel device time via clintercept. It is not a standalone step — invoke it whenever you need a performance baseline or need to verify optimization progress.
+
+## Step 0: Plan Op Implementation
+**Skill:** `plan-op-implementation`
+
+Before any specs are collected or code is written, analyze the OpenVINO operation specification (often provided via docs URL) to map inputs, outputs, attributes, supported data types, and formulate a Single Layer Test (SLT) and kernel strategy.
+
+## Step 1: Collect Hardware Specs
+**Skill:** `collect-gpu-hardware-spec`
+
+Before writing any code, collect GPU hardware specs via `clinfo`. This determines SIMD size, sub-group preferences, SLM capacity, and tuning parameters.
+
+## Step 2: Build the GPU Plugin
+**Skill:** `build-openvino`
+
+Build the OpenVINO tree with Intel GPU enabled. In the GPU kernel workflow, use Debug builds for development and functional verification, Release builds for profiling and optimization, and Python/Wheel builds only when packaging or Python integration is required.
+
+## Step 3: File Structure & Naming
+**Skill:** `gpu-op-file-structure`
+
+Determine the exact file locations and naming conventions for the new operation. New ops use the `ocl_v2` co-located structure where `.cl` kernel files sit alongside `.cpp` graph impl files. All files must follow `snake_case` for filenames and `CamelCase` for class names across directories (kernel selector, `ocl_v2` graph impls with co-located CL kernels, primitives, plugin ops, tests).
+
+## Step 4: Kernel Enabling & Verification
+**Skills:** `gpu-kernel-enabling` → `write-gpu-tests` → `run-gpu-tests`
+
+Implement C++ primitives and create the reference OpenCL kernel (`gpu-kernel-enabling`), then write test code (`write-gpu-tests`), and finally execute tests to verify correctness (`run-gpu-tests`). After the ref kernel passes tests, measure the **Ref Baseline** via `gpu-kernel-device-timing`, then proceed to the optional oneDNN integration (Step 4.5).
+
+## Step 4.5: oneDNN Primitive Integration (Conditional)
+**Skill:** `gpu-integrate-onednn-primitive`
+
+If the target operation has an available oneDNN primitive, integrate the oneDNN-based path alongside the OpenCL kernel. This step runs **after** the Ref Baseline has been measured via `gpu-kernel-device-timing`. After integration, use `gpu-kernel-device-timing` again to profile the oneDNN path for comparison.
+
+## Step 5: Hardware-Aware Optimization
+**Skill:** `gpu-kernel-optimize`
+
+This step is **mandatory** — it produces the Performance Comparison Report (Ref vs Opt). Apply optimizations: sub-group size selection, block reads (fsv16), local work size tuning, and register pressure management. Create optimized kernel variants. Use `gpu-kernel-device-timing` iteratively during this step to measure each optimization iteration and verify improvement.
+
+## Opset Migration (When Needed)
+**Skill:** `gpu-opset-migration`
+
+Use this branch when you are updating an existing GPU operation for a newer OpenVINO Opset rather than enabling a brand-new operation. This migration path is separate from the main new-op flow above and focuses on backward compatibility, spec deltas, and new data type support.
+
+---
+
+# Sub-Skills Reference
+
+| Skill | Purpose | When |
+|---|---|---|
+| `parse-op-spec` | Fetch and parse Op specification into structured summary | Called by `plan-op-implementation` in Step 0 |
+| `plan-op-implementation` | Analyze Op spec and formulate primitive/kernel/test plan | Always first, before writing code |
+| `collect-gpu-hardware-spec` | Collect GPU specs via clinfo | After planning, before optimizing |
+| `build-openvino` | Build OpenVINO with the required GPU-oriented configuration | Before development/testing |
+| `gpu-op-file-structure` | Files to implement for new operation | When creating new op files |
+| `gpu-kernel-enabling` | Implement C++ primitives & create ref OpenCL kernel | Initial kernel enabling phase |
+| `write-gpu-tests` | Create SLT and unit test code for GPU ops | During enabling, migration, oneDNN integration |
+| `run-gpu-tests` | Execute GPU tests and dump kernel sources | After writing tests — verification utility |
+| `gpu-integrate-onednn-primitive` | Integrate oneDNN-based primitive | When oneDNN supports the op |
+| `gpu-kernel-device-timing` | Measure device timing with clintercept | During Steps 4, 4.5, and 5 — baseline and optimization iterations |
+| `gpu-kernel-optimize` | Hardware-aware kernel optimization | After ref kernel baseline is measured |
+| `gpu-opset-migration` | Opset version migration | When updating to new Opset |
+
+---
+
+# Troubleshooting
+
+- **Sub-skill not found by agent**: Ensure all sub-skill files exist under `skills/add-gpu-op/` and each has a valid YAML frontmatter with the correct skill name
+- **Wrong step order**: Always follow the numbered steps in sequence — skipping `plan-op-implementation` or `collect-gpu-hardware-spec` leads to incorrect kernel code
+- **Opset migration vs new op confusion**: If the Op already exists and only needs a version bump, use `gpu-opset-migration` instead of the full new-op flow
+- **Performance loop not converging**: If Step 5 optimization iterations do not improve timing, review the kernel strategy in the original `plan-op-implementation` output
+
+---
+
+# References
+
+- Skills directory: `skills/add-gpu-op/`
+- Repository guidelines: `.github/agents-prototype/gpu.agent.md`
diff --git a/.github/agents-prototype/skills/add-gpu-op/step0-parse-spec.md b/.github/agents-prototype/skills/add-gpu-op/step0-parse-spec.md
new file mode 100644
index 00000000000..3a399874b3b
--- /dev/null
+++ b/.github/agents-prototype/skills/add-gpu-op/step0-parse-spec.md
@@ -0,0 +1,159 @@
+---
+name: parse-op-spec
+description: Fetch and parse an OpenVINO operation specification from URL or text, extracting inputs, outputs, attributes, and data types into a structured summary
+---
+
+# Purpose
+
+Parse an Operation (Op) specification from a URL or pasted text and produce a structured summary of its inputs, outputs, attributes, and data types. This is a pure **extraction** utility — it does not make implementation decisions. The caller (e.g., `plan-op-implementation`, `gpu-opset-migration`) uses the extracted data for planning.
+
+# When to Use
+
+Use this skill whenever an Op specification needs to be read and structured:
+- As the first step of `plan-op-implementation` — parse a new Op spec
+- During `gpu-opset-migration` — parse the new Opset version spec for comparison with the old version
+
+```mermaid
+flowchart TD
+ A[URL or pasted text] --> B[Fetch / Read spec]
+ B --> C[Extract Op Name & Version]
+ C --> D[Extract Inputs]
+ C --> E[Extract Outputs]
+ C --> F[Extract Attributes]
+ D --> G[Map Data Types to OV precisions]
+ E --> G
+ F --> G
+ G --> H[Return structured summary]
+```
+
+# Procedure
+
+1. **Step 1: Acquire Specification** — Fetch URL or read pasted text
+2. **Step 2: Extract Elements** — Parse inputs, outputs, attributes, data types
+3. **Step 3: Map to OpenVINO Precisions** — Convert framework types to OV types
+4. **Step 4: Produce Structured Summary** — Return standardized output to the caller
+
+---
+
+# Prerequisites Check
+
+This skill requires an Op specification as input. No tools needed.
+
+**Windows (PowerShell):**
+```powershell
+Write-Host "Ready: Provide an Op spec URL or paste the specification text."
+```
+
+**Ubuntu:**
+```bash
+echo "Ready: Provide an Op spec URL or paste the specification text."
+```
+
+- **If Op spec is provided:** Proceed to "Quick Start - Main Steps"
+- **If no Op spec:** Ask the user for the specification URL or text
+
+---
+
+# Quick Start
+
+## Installation (Prerequisites Check failed)
+
+No installation required. Ask the user to provide:
+- An OpenVINO docs URL (e.g., `https://docs.openvino.ai/.../operation-specs/...`)
+- A PyTorch/TensorFlow/ONNX docs URL
+- Or directly pasted specification text
+
+---
+
+## Main Steps (Prerequisites Check passed)
+
+### Step 1: Acquire Specification
+
+- **If URL provided:** Fetch the webpage content.
+- **If text provided:** Read directly.
+- Note that framework documentation (PyTorch, TensorFlow, ONNX) may be structured differently than OpenVINO IR specifications.
+
+### Step 2: Extract Key Elements
+
+Parse the specification and extract:
+
+1. **Operation Name** — Name and version if applicable (e.g., `ScatterNDUpdate-15`)
+2. **Inputs** — For each input tensor:
+ - Name, rank/shape constraints (1D, 2D, etc.)
+ - Required data types
+ - Whether optional
+3. **Outputs** — For each output tensor:
+ - Name, rank/shape, deduced types
+4. **Attributes** — Static parameters:
+ - Name, type, default value, valid range
+ - Note: some frameworks treat attributes as inputs (or vice versa)
+5. **Broadcasting rules** — If mentioned in the spec
+
+### Step 3: Map Data Types to OpenVINO Precisions
+
+Convert framework-specific or generic types to supported OpenVINO precisions:
+
+| Framework Type | OpenVINO Precision |
+|---|---|
+| float / float32 | FP32 |
+| float16 / half | FP16 |
+| bfloat16 | BF16 |
+| int / int32 | I32 |
+| int64 / long | I64 |
+| int8 | I8 |
+| uint8 | U8 |
+| bool | BOOL |
+
+### Step 4: Produce Structured Summary
+
+Return the parsed data in this format:
+
+```markdown
+## Op Spec Summary: <OpName>
+
+**Version:** <version or N/A>
+**Source:** <URL or "pasted text">
+
+### Inputs
+| # | Name | Shape Constraint | Data Types | Optional |
+|---|------|-----------------|------------|----------|
+| 1 | ... | ... | ... | No |
+| 2 | ... | ... | ... | Yes |
+
+### Outputs
+| # | Name | Shape | Data Types |
+|---|------|-------|------------|
+| 1 | ... | ... | ... |
+
+### Attributes
+| Name | Type | Default | Description |
+|------|------|---------|-------------|
+| ... | ... | ... | ... |
+
+### Data Type Mapping
+| Role | Supported Precisions |
+|------|---------------------|
+| Data (T) | FP32, FP16, I32, I64 |
+| Index (T_IDX) | I32, I64 |
+
+### Broadcasting
+<rules or "None">
+```
+
+This summary is consumed by the caller — do not make implementation decisions here.
+
+---
+
+# Troubleshooting
+
+- **Op spec URL returns 404 or empty page**: Try the nightly docs URL variant or ask the user to paste the spec text directly
+- **Framework spec lacks explicit input/output types**: Infer types from usage context and document assumptions clearly
+- **Ambiguous attribute vs input distinction**: List both interpretations and let the caller decide
+
+---
+
+# References
+
+- Related skills: `plan-op-implementation`, `gpu-opset-migration`
+- OpenVINO Op specs: https://docs.openvino.ai/latest/openvino_docs_ops_opset.html
+- ONNX Op specs: https://onnx.ai/onnx/operators/
diff --git a/.github/agents-prototype/skills/add-gpu-op/step0-plan.md b/.github/agents-prototype/skills/add-gpu-op/step0-plan.md
new file mode 100644
index 00000000000..c7ee20a3372
--- /dev/null
+++ b/.github/agents-prototype/skills/add-gpu-op/step0-plan.md
@@ -0,0 +1,138 @@
+---
+name: plan-op-implementation
+description: Analyze OpenVINO runtime operation specifications (e.g., from docs URL) and create an implementation plan for the GPU plugin including primitive mapping, data types, and testing strategy.
+---
+
+# Purpose
+
+Analyze a new Operation (Op) specification and formulate a comprehensive implementation plan for the OpenVINO GPU plugin before any code is written or hardware metrics are gathered.
+
+# When to Use
+
+Use this skill as the **first step** (Step 0) in the `intel-gpu-kernel` workflow whenever a new GPU Op implementation is requested. The user provides an Op spec URL (OpenVINO, PyTorch, TensorFlow, or ONNX docs) or pasted text.
+
+```mermaid
+flowchart TD
+ A[Receive Op Spec URL or Text] --> B[Invoke parse-op-spec]
+ B --> C[Formulate Primitive Mapping]
+ C --> D[Outline Kernel Strategy]
+ D --> E[Plan SLT Coverage]
+ E --> F[Present Plan to User]
+ F --> G{User Approves?}
+ G -->|Yes| H[Proceed to intel-gpu-kernel Step 1]
+ G -->|No| I[Revise Plan]
+ I --> F
+```
+
+# Procedure
+
+Follow these steps exactly to plan the operation implementation.
+
+1. **Step 1: Analyze the Operation Specification** — Invoke `parse-op-spec` to fetch and extract inputs/outputs/attributes/types
+2. **Step 2: Formulate the Primitive Mapping Plan** — Design cldnn primitive, shape inference, precision support
+3. **Step 3: Outline Kernel Design Strategy** — Map to OpenCL work-items, identify dependencies, check oneDNN
+4. **Step 4: Plan Single Layer Test (SLT) Coverage** — Define test parameters, corner cases, reference impl
+5. **Step 5: Deliver the Implementation Plan** — Present summary and wait for user approval
+
+---
+
+# Prerequisites Check
+
+This skill requires an Op specification as input. No build tools are needed.
+
+**Windows (PowerShell):**
+```powershell
+# Verify the user has provided an Op spec URL or text
+# No tool installation needed — this is a planning-only skill
+Write-Host "Ready: Provide an Op spec URL or paste the specification text."
+```
+
+**Ubuntu:**
+```bash
+# Verify the user has provided an Op spec URL or text
+# No tool installation needed — this is a planning-only skill
+echo "Ready: Provide an Op spec URL or paste the specification text."
+```
+
+- **If Op spec is provided:** Proceed to "Quick Start - Main Steps"
+- **If no Op spec:** Ask the user for the specification URL or text
+
+---
+
+# Quick Start
+
+## Installation (Prerequisites Check failed)
+
+No installation required. Ask the user to provide the Operation Specification:
+- An OpenVINO docs URL (e.g., `https://docs.openvino.ai/.../operation-specs/...`)
+- A PyTorch/TensorFlow/ONNX docs URL
+- Or directly pasted specification text
+
+---
+
+## Main Steps (Prerequisites Check passed)
+
+## Step 1: Analyze the Operation Specification
+
+Invoke the `parse-op-spec` skill to fetch/read the spec and produce a structured summary of the Op (name, inputs, outputs, attributes, data type mapping).
+
+Review the returned summary and verify completeness before proceeding to Step 2.
+
+## Step 2: Formulate the Primitive Mapping Plan
+
+Plan how this operation maps to the OpenVINO GPU plugin (cldnn) graph structure.
+
+1. **Primitive Creation:** What will the `cldnn::primitive` struct look like? What fields does it need to store the operation attributes?
+2. **Shape Infer Logic:** How will the output shape be calculated from the inputs? Are there dynamic shapes to consider?
+ - **Static Shape:** Output dimensions are fully determined at graph compilation time.
+ - **Dynamic Shape:** If output size depends on data values at runtime (e.g., the number of filled rows), `shape_infer` must return `ov::PartialShape::dynamic()` for that dimension. Document the runtime mechanism needed to determine the actual output size (e.g., a counting pass, `set_output_shape`, or shape-of sub-graph).
+3. **Data Type / Precision Support:** Determine which layout (e.g., `bfyx`, `b_fs_yx_fsv16`) and precisions (e.g., `f32`, `f16`, `i32`) must be supported in the custom OpenCL kernel. Usually, coordinate types (`T_IDX`) must support `i32`/`i64` and data types (`T`) must support floating-point + integer types.
+
+## Step 3: Outline Kernel Design Strategy
+
+1. **Work Items and Execution Space:** How will the problem be mapped to OpenCL work-items? (e.g., 1 work-item per output element? 1 work-item per row?).
+2. **Dependencies:** Are there dependencies between elements that would prevent naive parallelization? If sequential dependencies exist, propose a concrete GPU-friendly strategy:
+ - **Two-pass approach:** Pass 1 counts/scans, Pass 2 scatters results (recommended for most cases).
+ - **Parallel prefix-sum (scan):** When cumulative counts determine output positions.
+ - **Atomic operations:** When contention is low and output order is unimportant.
+ - Document the chosen strategy and why it fits the operation.
+3. **Existing implementations:** Check if oneDNN provides an existing optimized primitive for this type of operation (e.g. convolution, matmul). If so, suggest integrating via `gpu-integrate-onednn-primitive` in later steps.
+
+## Step 4: Plan Single Layer Test (SLT) Coverage
+
+Define the scope for the functional tests (`SingleLayerTests`):
+1. **Test Parameters:** What parameters (precisions, input shapes, attributes) need to be iterated over?
+2. **Corner Cases:** Identify potential edge cases from the spec (e.g., empty rows, empty tensors, negative numbers, Out-of-Bounds handling).
+3. **Reference Implementation:** A reference implementation (e.g., in `ov::reference`) must exist or be created to check against.
+
+## Step 5: Deliver the Implementation Plan to User
+
+Present the summary to the user using the following format:
+1. **Summary of Op Spec** (Name, Inputs, Outputs, Attributes).
+2. **GPU Plugin Mapping** (Primitive struct design, precision/layout support).
+3. **Proposed Kernel Strategy** (GWS/LWS mapping idea).
+4. **SLT Test Plan** (Parameter sweep and corner cases).
+
+**WAIT FOR APPROVAL**: Ask the user to review the plan. Do not proceed to `intel-gpu-kernel` (Step 1) without user confirmation.
+
+---
+
+# Troubleshooting
+
+- **Op spec URL returns 404 or empty page**: Try the nightly docs URL variant or ask the user to paste the spec text directly
+- **Framework spec lacks explicit input/output types**: Infer types from usage context and document assumptions in the plan
+- **Dynamic output shape detected but unclear mechanism**: Default to two-pass approach (count pass + scatter pass) and note it in the plan for user review
+- **No reference implementation exists in `ov::reference`**: Flag this in the plan — a custom reference must be written during the enabling phase
+- **oneDNN availability uncertain**: List the operation as "check during Step 4.5" and proceed with OpenCL-first strategy
+
+---
+
+# Next Steps
+
+Once the plan is approved, the `intel-gpu-kernel` orchestrator routes you through the remaining steps. Proceed to **Step 1: `collect-gpu-hardware-spec`**.
+
+---
+
+# References
+
+- Related skills: `parse-op-spec`, `intel-gpu-kernel`, `gpu-integrate-onednn-primitive`
diff --git a/.github/agents-prototype/skills/add-gpu-op/step1-hardware-analysis.md b/.github/agents-prototype/skills/add-gpu-op/step1-hardware-analysis.md
new file mode 100644
index 00000000000..7d9688ef74a
--- /dev/null
+++ b/.github/agents-prototype/skills/add-gpu-op/step1-hardware-analysis.md
@@ -0,0 +1,133 @@
+---
+name: collect-gpu-hardware-spec
+description: Collect target Intel GPU hardware specifications via clinfo for kernel tuning parameter reference
+---
+
+# Purpose
+
+Collect the target Intel GPU hardware specifications via `clinfo` for use by other GPU skills. This is a mandatory first step before writing any OpenCL kernel code.
+
+# When to Use
+
+Use this skill **before** any GPU kernel development or optimization task. It provides the hardware context that all other GPU skills depend on.
+
+```mermaid
+flowchart TD
+ A[Start GPU Work] --> B[Run clinfo]
+ B --> C[Record Device Name, EUs, Sub-group Size, SLM, Max Work Group Size]
+ C --> D[Proceed to Kernel Development]
+```
+
+# Procedure
+
+Follow these steps in order:
+
+1. **Step 1: Acquire Hardware Specs** — Run `clinfo` and collect key parameters. If system has both iGPU and dGPU, collect specs for both.
+2. **Step 2: Identify Architecture** — Map Device Name to architecture family using the table below.
+3. **Step 3: Record Baseline** — Save the collected parameters for use by `gpu-kernel-enabling` and `gpu-kernel-optimize` skills.
+
+---
+
+# Prerequisites Check
+
+Verify that `clinfo` is available on the system:
+
+**Windows (PowerShell):**
+```powershell
+# Check if clinfo is available
+clinfo --version
+```
+
+**Ubuntu:**
+```bash
+# Check if clinfo is available
+clinfo --version
+```
+
+- **If successful:** Proceed to "Quick Start - Main Steps"
+- **If failed:** Follow "Quick Start - Installation" below
+
+---
+
+# Quick Start
+
+## Installation (Prerequisites Check failed)
+
+**Windows (PowerShell):**
+```powershell
+# clinfo is typically bundled with Intel GPU drivers
+# Ensure Intel GPU drivers are installed
+# Or install via package manager if available
+winget install --id Intel.clinfo --source winget
+```
+
+**Ubuntu:**
+```bash
+# Install clinfo
+sudo apt-get update
+sudo apt-get install -y clinfo
+```
+
+---
+
+## Main Steps (Prerequisites Check passed)
+
+### Step 1: Collect Hardware Specs
+
+**Windows (PowerShell):**
+```powershell
+# Collect GPU hardware specifications
+clinfo | Select-String -Pattern "Device Name|Max compute units|Max work group size|Max sub-groups|Max sub-group size|Local memory type|Local memory size|Global memory cache size"
+```
+
+**Ubuntu:**
+```bash
+# Collect GPU hardware specifications
+clinfo | grep -E "Device Name|Max compute units|Max work group size|Max sub-groups|Max sub-group size|Local memory type|Local memory size|Global memory cache size"
+```
+
+### Step 2: Identify Architecture
+
+Classify the GPU based on Device Name:
+
+| Device Name Pattern | Type | Architecture |
+|---|---|---|
+| HD Graphics, UHD Graphics | iGPU | Gen9 |
+| Iris Xe (TigerLake/AlderLake/RaptorLake) | iGPU | Xe-LP |
+| Intel Graphics (Meteor Lake / Arrow Lake) | iGPU | Xe-LPG |
+| Intel Graphics (Lunar Lake) | iGPU | Xe2-LPG |
+| Intel Graphics (Panther Lake) | iGPU | Xe3 |
+| Arc A-series (A370M, A580, A770, etc.) | dGPU | Xe-HPG |
+| Arc B-series (B570, B580) | dGPU | Xe2-HPG |
+| Data Center GPU Max (Ponte Vecchio) | dGPU | Xe-HPC |
+
+**If system has both iGPU and dGPU:** Collect specs for both and verify/validate/optimize on both devices.
+
+### Step 3: Record Baseline
+
+From the `clinfo` output, record these values. Tuning decisions (SIMD size, LWS, SLM usage) are made by the `gpu-kernel-optimize` skill based on these numbers.
+
+| Parameter | What It Determines |
+|---|---|
+| **Device Name** | iGPU vs dGPU, architecture family |
+| **Max compute units (EUs)** | Parallelism level needed |
+| **Max sub-group size** | SIMD width (8, 16, or 32) |
+| **Local memory size (SLM)** | Max tile size for blocked algorithms |
+| **Max work group size** | Upper bound for local work size |
+
+---
+
+# Troubleshooting
+
+- **"clinfo: command not found"**: Install Intel GPU compute runtime or clinfo package
+- **No GPU devices listed**: Ensure Intel GPU drivers and OpenCL runtime are installed
+- **Multiple devices shown**: Record specs for each device; use `--device_suffix` in tests to target specific GPU
+- **Missing sub-group info**: Older drivers may not report sub-group details; assume SIMD 16 as default
+
+---
+
+# References
+
+- Related skills: `gpu-kernel-enabling`, `gpu-kernel-optimize`, `build-openvino`
+- Intel OpenCL documentation: https://www.intel.com/content/www/us/en/developer/tools/opencl/overview.html
+- **Next Step:** Proceed to `build-openvino` (Step 2 of `intel-gpu-kernel` workflow)
\ No newline at end of file
diff --git a/.github/agents-prototype/skills/add-gpu-op/step2-file-structure.md b/.github/agents-prototype/skills/add-gpu-op/step2-file-structure.md
new file mode 100644
index 00000000000..668a2dffe7a
--- /dev/null
+++ b/.github/agents-prototype/skills/add-gpu-op/step2-file-structure.md
@@ -0,0 +1,217 @@
+---
+name: gpu-op-file-structure
+description: Files to implement for a new OpenVINO GPU plugin operation — naming conventions, directory locations, and required components
+---
+
+# Purpose
+
+Define the exact file locations, naming conventions, and directory structure for implementing a new operation in the OpenVINO GPU plugin. This is the authoritative reference for where every file must be placed.
+
+# When to Use
+
+Use this skill whenever creating or modifying files for a GPU plugin operation. The architecture and code inside these files should be directed by the design established in the `plan-op-implementation` skill. Reference this structure from other GPU skills (`gpu-kernel-enabling`, `gpu-kernel-optimize`, etc.) to ensure files are placed correctly.
+
+```mermaid
+flowchart TD
+ A[New Op: OpName] --> B[snake_case for files]
+ B --> C[CamelCase for classes]
+ C --> D[Create files in 6 directories]
+ D --> E1[1. Kernel Selector]
+ D --> E2[2. CL Kernels]
+ D --> E3[3. Primitives]
+ D --> E4[4. Graph Impls]
+ D --> E5[5. Plugin Ops]
+ D --> E6[6. Tests]
+```
+
+# Procedure
+
+1. **Step 1: Determine Op Name** — Convert to `snake_case` for files, `CamelCase` for classes
+2. **Step 2: Create All Required Files** — In the 6 directories listed below
+3. **Step 3: Verify Structure** — Ensure all files are in the correct locations
+
+---
+
+# Prerequisites Check
+
+Verify the OpenVINO GPU plugin source tree is available:
+
+**Windows (PowerShell):**
+```powershell
+Test-Path "src\plugins\intel_gpu\src\kernel_selector\kernels"
+```
+
+**Ubuntu:**
+```bash
+test -d src/plugins/intel_gpu/src/kernel_selector/kernels && echo "OK" || echo "MISSING"
+```
+
+- **If successful:** Proceed to "Quick Start - Main Steps"
+- **If failed:** Ensure you are in the OpenVINO source root directory
+
+---
+
+# Quick Start
+
+## Installation (Prerequisites Check failed)
+
+Navigate to the OpenVINO source root directory:
+```bash
+cd /path/to/openvino
+```
+
+---
+
+## Main Steps (Prerequisites Check passed)
+
+### Naming Conventions
+
+| Item | Convention | Example (Op: FillEmptyRows) |
+|---|---|---|
+| File names | `snake_case` | `fill_empty_rows` |
+| Class names | `CamelCase` | `FillEmptyRows` |
+| Kernel names | `snake_case` | `fill_empty_rows_ref` |
+| Directory names | `snake_case` | `fill_empty_rows/` |
+
+---
+
+### 1. Kernel Selector Layer (Host Logic)
+
+Defines parameters and selects the best kernel implementation.
+
+**Directory:** `src/plugins/intel_gpu/src/kernel_selector/kernels/<op_name>/`
+
+**Files to create:**
+
+| File | Purpose |
+|---|---|
+| `<op_name>_kernel_selector.h` | Kernel selector class declaration |
+| `<op_name>_kernel_selector.cpp` | Logic to select between Ref, Opt, or layout-specific kernels |
+| `<op_name>_kernel_base.h` | Base kernel class with parameter/JitConstant definitions |
+| `<op_name>_kernel_base.cpp` | Base kernel implementation |
+| `<op_name>_kernel_ref.h` | Reference kernel binder declaration |
+| `<op_name>_kernel_ref.cpp` | Reference kernel binder implementation |
+| `<op_name>_kernel_opt.h` | *(Optional)* Optimized kernel binder declaration |
+| `<op_name>_kernel_opt.cpp` | *(Optional)* Optimized kernel binder implementation |
+
+---
+
+### 2. OpenCL Kernel Source (Device Code)
+
+Contains the actual OpenCL C code that runs on the GPU.
+
+**Directory (ocl_v2):** `src/plugins/intel_gpu/src/graph/impls/ocl_v2/` — co-located with the Graph Impl `.cpp` file.
+
+**Directory (legacy kernel_selector):** `src/plugins/intel_gpu/src/kernel_selector/cl_kernels/` — used by older ops that have not migrated to ocl_v2.
+
+**Files to create (in the same directory as the Graph Impl):**
+
+| File | Purpose |
+|---|---|
+| `<op_name>_ref.cl` | Reference OpenCL kernel (clean, no HW-specific optimizations) |
+| `<op_name>_opt.cl` | *(Optional)* General optimized OpenCL kernel |
+| `<op_name>_<layout>.cl` | *(Optional)* Layout-specific optimized kernel (e.g., `_bfyx`, `_fsv16`) |
+
+> **New ops should use the `ocl_v2` co-located structure.** Place `.cl` files next to the `.cpp` Graph Impl file.
+
+---
+
+### 3. Primitive Definition (Internal API)
+
+Defines the structure used internally by the GPU plugin.
+
+**Directory:** `src/plugins/intel_gpu/include/intel_gpu/primitives/`
+
+**Files to create:**
+
+| File | Purpose |
+|---|---|
+| `<op_name>.hpp` | Primitive structure inheriting from `primitive_base` |
+
+---
+
+### 4. Implementation Logic (Graph Registration)
+
+Registers the primitive to the OpenCL backend with layout validation and kernel selection.
+
+**Directory:** `src/plugins/intel_gpu/src/graph/impls/ocl_v2/`
+
+**Files to create:**
+
+| File | Purpose |
+|---|---|
+| `<op_name>.cpp` | `create_<op_name>` implementation and layout validation |
+
+---
+
+### 5. Operation Translation (Plugin Layer)
+
+Converts the OpenVINO Core Op (`ov::op::vX`) to the GPU Plugin Primitive.
+
+**Directory:** `src/plugins/intel_gpu/src/plugin/ops/`
+
+**Files to create:**
+
+| File | Purpose |
+|---|---|
+| `<op_name>.cpp` | `Create<OpName>Op` function using `ProgramBuilder` |
+
+---
+
+### 6. Verification & Tests
+
+**Functional Single Layer Tests (Shared):**
+
+**Directory:** `src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/`
+
+| File | Purpose |
+|---|---|
+| `<op_name>.cpp` | Instantiation of shared OpenVINO layer tests |
+
+**Unit Tests (Internal):**
+
+**Directory:** `src/plugins/intel_gpu/tests/unit/test_cases/`
+
+| File | Purpose |
+|---|---|
+| `<op_name>_gpu_test.cpp` | gtest cases for edge cases, memory layouts, specific scenarios |
+
+---
+
+### Complete Example: `FillEmptyRows`
+
+Given: "Implement `FillEmptyRows`"
+
+| Component | File Path |
+|---|---|
+| **Kernel Selector** | `src/plugins/intel_gpu/src/kernel_selector/kernels/fill_empty_rows/fill_empty_rows_kernel_selector.h` |
+| | `src/plugins/intel_gpu/src/kernel_selector/kernels/fill_empty_rows/fill_empty_rows_kernel_selector.cpp` |
+| | `src/plugins/intel_gpu/src/kernel_selector/kernels/fill_empty_rows/fill_empty_rows_kernel_base.h` |
+| | `src/plugins/intel_gpu/src/kernel_selector/kernels/fill_empty_rows/fill_empty_rows_kernel_base.cpp` |
+| | `src/plugins/intel_gpu/src/kernel_selector/kernels/fill_empty_rows/fill_empty_rows_kernel_ref.h` |
+| | `src/plugins/intel_gpu/src/kernel_selector/kernels/fill_empty_rows/fill_empty_rows_kernel_ref.cpp` |
+| **Graph Impl + CL Kernel** | `src/plugins/intel_gpu/src/graph/impls/ocl_v2/fill_empty_rows.cpp` |
+| | `src/plugins/intel_gpu/src/graph/impls/ocl_v2/fill_empty_rows_ref.cl` |
+| **Primitive** | `src/plugins/intel_gpu/include/intel_gpu/primitives/fill_empty_rows.hpp` |
+| **Plugin Ops** | `src/plugins/intel_gpu/src/plugin/ops/fill_empty_rows.cpp` |
+| **Shared Tests** | `src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/fill_empty_rows.cpp` |
+| **Unit Tests** | `src/plugins/intel_gpu/tests/unit/test_cases/fill_empty_rows_gpu_test.cpp` |
+
+---
+
+# Troubleshooting
+
+- **Kernel not found at runtime**: Verify the `.cl` file is co-located in `ocl_v2/` (or in `cl_kernels/` for legacy ops) and registered in CMakeLists.txt
+- **Selector not picking the kernel**: Check that the kernel selector `.cpp` properly adds the kernel implementation
+- **Primitive not registered**: Ensure `<op_name>.cpp` in `graph/impls/ocl_v2/` registers the factory
+- **Tests not discovered**: Verify test file is added to the appropriate CMakeLists.txt
+- **Name mismatch errors**: Double-check `snake_case` for files and `CamelCase` for classes
+
+---
+
+# References
+
+- Related skills: `gpu-kernel-enabling`, `gpu-kernel-optimize`, `gpu-integrate-onednn-primitive`
+- Previous name: `gpu-file-structure` (renamed per review: this skill is about files-to-implement-for-new-operation)
+- OpenVINO GPU plugin source: `src/plugins/intel_gpu/`
+- **Next Step:** Proceed to `gpu-kernel-enabling` (Step 4 of `intel-gpu-kernel` workflow)
diff --git a/.github/agents-prototype/skills/add-gpu-op/step3-kernel-development.md b/.github/agents-prototype/skills/add-gpu-op/step3-kernel-development.md
new file mode 100644
index 00000000000..eb7b1dbef76
--- /dev/null
+++ b/.github/agents-prototype/skills/add-gpu-op/step3-kernel-development.md
@@ -0,0 +1,164 @@
+---
+name: gpu-kernel-enabling
+description: Initial OpenCL kernel creation, debugging, and functional verification for OpenVINO GPU plugin operations
+---
+
+# Purpose
+
+Guide the development of new OpenCL kernels for the OpenVINO GPU plugin. This covers creating reference kernels from OpenVINO core reference implementations, dumping kernel sources for inspection, and running functional verification tests.
+
+# When to Use
+
+Use this skill when implementing a new GPU operation (Op) that requires an OpenCL kernel, or when debugging an existing kernel.
+
+```mermaid
+flowchart TD
+ A[New Op Request] --> B[Run collect-gpu-hardware-spec]
+ B --> C[Create Reference Kernel]
+ C --> D[Dump & Inspect Kernel Source]
+ D --> E[Run Functional Tests]
+ E -->|Pass| F[Proceed to Profiling or Optimization]
+ E -->|Fail| G[Debug & Fix]
+ G --> D
+```
+
+# Procedure
+
+1. **Step 1: Hardware Context** — Run `collect-gpu-hardware-spec` skill first (if not done)
+2. **Step 2: Create Reference Kernel** — Write a clean baseline OpenCL kernel
+3. **Step 3: Dump & Inspect** — Verify macro substitution and kernel correctness
+4. **Step 4: Functional Verification** — Run unit and functional tests
+
+---
+
+# Prerequisites Check
+
+Verify the GPU plugin is built (see `build-openvino` skill):
+
+**Windows (PowerShell):**
+```powershell
+# Check Debug build exists
+Test-Path ".\build\bin\intel64\Debug\ov_gpu_unit_tests.exe"
+```
+
+**Ubuntu:**
+```bash
+# Check Debug build exists
+test -f ./build/bin/intel64/Debug/ov_gpu_unit_tests && echo "OK" || echo "MISSING"
+```
+
+- **If successful:** Proceed to "Quick Start - Main Steps"
+- **If failed:** Run `build-openvino` in Debug mode with tests enabled first
+
+---
+
+# Quick Start
+
+## Installation (Prerequisites Check failed)
+
+Build the GPU plugin first using the `build-openvino` skill in Debug mode.
+
+---
+
+## Main Steps (Prerequisites Check passed)
+
+### Step 1: Create Reference Kernel
+
+**Principle:** The reference kernel must be a clean, correct baseline — no hardware-specific optimizations (no sub-group usage, no local memory tiling).
+
+**Source for logic reference:**
+- OpenVINO core reference implementations are in:
+ `src/core/reference/include/openvino/reference/`
+- Use the C++ reference as a **logic reference only**. The OpenCL code must be written from scratch for correct GPU execution.
+
+**Reference kernel guidelines:**
+- Straightforward implementation matching the op specification
+- No `intel_sub_group_block_read` or sub-group functions
+- No shared local memory (SLM) tiling
+- Standard global memory reads/writes only
+- Clear, readable code that serves as a correctness baseline
+
+**File location:** See `gpu-op-file-structure` skill for exact paths.
+- Reference kernel → `src/plugins/intel_gpu/src/graph/impls/ocl_v2/<op_name>_ref.cl`
+
+### Step 2: Kernel Source Dump & Inspection
+
+After building, dump the compiled kernel source to verify macro substitution.
+
+**Windows (PowerShell):**
+```powershell
+# Enable kernel dumping
+$env:OV_GPU_DUMP_SOURCES_PATH = "<your path>"
+
+# Run a test to trigger kernel compilation
+.\build\bin\intel64\Debug\ov_gpu_unit_tests.exe --gtest_filter=*TargetOpName*
+
+# Check dumped .cl files in the working directory
+Get-ChildItem -Filter "*.cl" | Sort-Object LastWriteTime -Descending | Select-Object -First 5
+```
+
+**Ubuntu:**
+```bash
+# Enable kernel dumping
+export OV_GPU_DUMP_SOURCES_PATH="<your path>"
+
+# Run a test to trigger kernel compilation
+./build/bin/intel64/Debug/ov_gpu_unit_tests --gtest_filter=*TargetOpName*
+
+# Check dumped .cl files
+ls -lt *.cl | head -5
+```
+
+**Verification checklist:**
+- [ ] Macros from `clinfo` are correctly substituted (e.g., `#define SIMD_SIZE 16`)
+- [ ] Data types match expected precision (float, half, int)
+- [ ] No undefined macros or compilation errors in the dumped source
+
+### Step 3: Functional Verification
+
+Run unit tests and functional tests to verify kernel correctness.
+
+**Windows (PowerShell):**
+```powershell
+# Unit tests
+.\build\bin\intel64\Debug\ov_gpu_unit_tests.exe --gtest_filter=*TargetOpName* --device_suffix=0
+
+# Functional tests
+.\build\bin\intel64\Debug\ov_gpu_func_tests.exe --gtest_filter=*TargetOpName* --device_suffix=0
+```
+
+**Ubuntu:**
+```bash
+# Unit tests
+./build/bin/intel64/Debug/ov_gpu_unit_tests --gtest_filter=*TargetOpName* --device_suffix=0
+
+# Functional tests
+./build/bin/intel64/Debug/ov_gpu_func_tests --gtest_filter=*TargetOpName* --device_suffix=0
+```
+
+**Parameters:**
+- `--gtest_filter=*TargetOpName*` — Filter to the specific operation being developed
+- `--device_suffix=0` — GPU.0 (first GPU); use `1` for GPU.1 if testing on second device
+
+**Success criteria:**
+- All unit tests pass
+- All functional tests pass
+- No memory errors (optional: run with address sanitizer)
+
+---
+
+# Troubleshooting
+
+- **Kernel dump produces empty files**: Ensure `OV_GPU_DUMP_SOURCES_PATH` is set
+- **Tests not found for new op**: Ensure test files are created (see `gpu-op-file-structure` skill)
+- **Macro substitution errors**: Check that JitConstants in the kernel_base are correctly defined
+- **Test crashes**: Run in Debug mode; check kernel source dump for compilation errors
+- **device_suffix not working**: Verify GPU device numbering with `clinfo` (device order may vary)
+- **Runtime errors**: Check OpenVINO verbose output with `OV_VERBOSE=all` environment variable
+
+---
+
+# References
+
+- Related skills: `collect-gpu-hardware-spec`, `build-openvino`, `gpu-op-file-structure`, `gpu-kernel-device-timing`
+- OpenVINO reference implementations: `src/core/reference/include/openvino/reference/`
\ No newline at end of file
diff --git a/.github/agents-prototype/skills/add-gpu-op/step3-profiling.md b/.github/agents-prototype/skills/add-gpu-op/step3-profiling.md
new file mode 100644
index 00000000000..5d67d526559
--- /dev/null
+++ b/.github/agents-prototype/skills/add-gpu-op/step3-profiling.md
@@ -0,0 +1,213 @@
+---
+name: gpu-kernel-device-timing
+description: Measure OpenVINO GPU kernel device timing using clintercept and report metrics — reusable utility for baseline measurement and optimization verification
+---
+
+# Purpose
+
+Measure OpenCL kernel device timing using the Intel OpenCL Intercept Layer (clintercept) and produce a structured timing report. This is a pure **measurement and analysis** utility — it does not decide whether to optimize or what to optimize. The caller (e.g., `gpu-kernel-enabling`, `gpu-kernel-optimize`) interprets the results.
+
+# When to Use
+
+Use this skill whenever you need GPU kernel timing data:
+- After ref kernel passes tests → measure **Ref Baseline**
+- After opt kernel passes tests → measure **Opt Performance**
+- After oneDNN integration → measure **oneDNN path** timing
+- During optimization iterations → measure each iteration
+
+```mermaid
+flowchart TD
+ A[Kernel passes run-gpu-tests] --> B[Profile with clintercept]
+ B --> C[Collect DeviceTotalTime]
+ C --> D[Correlate with HW specs]
+ D --> E[Return timing report to caller]
+```
+
+# Procedure
+
+1. **Step 1: Ensure Release Build** — Verify Release binaries exist (see `build-openvino`)
+2. **Step 2: Run Profiling** — Collect kernel execution metrics via clintercept
+3. **Step 3: Analyze Metrics** — Extract DeviceTotalTime, Call Count, Average Time
+4. **Step 4: Correlate with Hardware** — Cross-reference with `collect-gpu-hardware-spec` data
+5. **Step 5: Produce Timing Report** — Return structured results to the caller
+
+---
+
+# Prerequisites Check
+
+Verify clintercept is available:
+
+**Windows (PowerShell):**
+```powershell
+# Check if clintercept is available
+clintercept --version 2>&1 | Select-Object -First 3
+```
+
+**Ubuntu:**
+```bash
+# Check if clintercept is available
+clintercept --version 2>&1 | head -3
+```
+
+Also verify Release build exists:
+
+**Windows (PowerShell):**
+```powershell
+Test-Path ".\build\bin\intel64\Release\ov_gpu_unit_tests.exe"
+```
+
+**Ubuntu:**
+```bash
+test -f ./build/bin/intel64/Release/ov_gpu_unit_tests && echo "OK" || echo "MISSING"
+```
+
+- **If successful:** Proceed to "Quick Start - Main Steps"
+- **If failed:** Install clintercept and/or build in Release mode
+
+---
+
+# Quick Start
+
+## Installation (Prerequisites Check failed)
+
+**Install Intel OpenCL Intercept Layer:**
+
+**Windows (PowerShell):**
+```powershell
+# Clone and build clintercept
+git clone https://github.com/intel/opencl-intercept-layer.git
+Push-Location opencl-intercept-layer
+mkdir build -Force; Push-Location build
+cmake ..
+cmake --build . --config Release
+Pop-Location; Pop-Location
+# Add to PATH or use full path
+```
+
+**Ubuntu:**
+```bash
+# Clone and build clintercept
+git clone https://github.com/intel/opencl-intercept-layer.git
+cd opencl-intercept-layer
+mkdir build && cd build
+cmake ..
+make -j$(nproc)
+# Add to PATH or use full path
+```
+
+**Build Release binaries** by running `build-openvino` with a Release configuration and tests enabled.
+
+---
+
+## Main Steps (Prerequisites Check passed)
+
+### Step 1: Basic Profiling
+
+Run clintercept with device timing enabled. Use `benchmark_app` or a dedicated performance test with sufficient iterations for reliable measurement (unit tests typically do not have enough iterations):
+
+**Windows (PowerShell):**
+```powershell
+# Device timing with benchmark_app
+clintercept -d -t -- benchmark_app -m model.xml -d GPU -niter 100
+
+# Or with a specific test (ensure sufficient iterations)
+clintercept -d -t -- .\build\bin\intel64\Release\ov_gpu_func_tests.exe --gtest_filter=*TargetOpName*
+```
+
+**Ubuntu:**
+```bash
+# Device timing with benchmark_app
+clintercept -d -t -- benchmark_app -m model.xml -d GPU -niter 100
+
+# Or with a specific test (ensure sufficient iterations)
+clintercept -d -t -- ./build/bin/intel64/Release/ov_gpu_func_tests --gtest_filter=*TargetOpName*
+```
+
+**Flags:**
+- `-d` — Device timing (GPU-side timing)
+- `-t` — Host timing (CPU-side timing)
+
+### Step 2: Analyze Key Metrics
+
+Focus on these metrics from the clintercept output:
+
+| Metric | What It Tells You |
+|---|---|
+| **DeviceTotalTime** | Total GPU execution time for the kernel |
+| **HostTotalTime** | Total CPU-side overhead (enqueue, sync) |
+| **Kernel Name** | Which kernel is being profiled |
+| **Call Count** | How many times the kernel was dispatched |
+| **Average Time** | Per-invocation GPU time |
+
+**Analysis questions:**
+1. Is `DeviceTotalTime` dominated by one kernel or spread across many?
+2. Is the kernel memory-bound (high bandwidth utilization) or compute-bound?
+3. Is there excessive host-device synchronization overhead?
+
+### Step 3: Correlate with Hardware Specs
+
+Cross-reference profiling results with `collect-gpu-hardware-spec` data:
+
+| Observation | Hardware Check | Action |
+|---|---|---|
+| High DeviceTotalTime | Check EU count | Need more parallelism? |
+| Low occupancy | Check Max work group size | Work-group too small? |
+| Memory bottleneck | Check bandwidth, cache | Use block reads, SLM? |
+| Suboptimal SIMD | Check Max sub-group size | Wrong SIMD width? |
+
+### Step 4: Produce Timing Report
+
+Return structured timing data to the caller. The caller decides what to do with it.
+
+```markdown
+## Kernel Timing Report: <OpName>
+
+| Metric | Value |
+|------------------|-----------|
+| Kernel Name | <name> |
+| DeviceTotalTime | X.XX ms |
+| HostTotalTime | X.XX ms |
+| Call Count | N |
+| Average Time | X.XX ms |
+| Hardware | <GPU name from collect-gpu-hardware-spec> |
+| Build | Release |
+| Test/App Used | <command> |
+```
+
+This report is used by:
+- `gpu-kernel-enabling` → as **Ref Baseline**
+- `gpu-kernel-optimize` → as **Opt measurement** (compared against Ref Baseline)
+- `gpu-integrate-onednn-primitive` → as **oneDNN path** timing
+
+### Step 5: Advanced Profiling (Optional)
+
+For deeper analysis:
+
+**Windows (PowerShell):**
+```powershell
+# Call logging (shows API call sequence)
+clintercept --call-logging -- .\build\bin\intel64\Release\ov_gpu_func_tests.exe --gtest_filter=*TargetOpName*
+```
+
+**Ubuntu:**
+```bash
+# Call logging (shows API call sequence)
+clintercept --call-logging -- ./build/bin/intel64/Release/ov_gpu_func_tests --gtest_filter=*TargetOpName*
+```
+
+---
+
+# Troubleshooting
+
+- **clintercept not found**: Build from source or add to PATH
+- **No GPU timing data**: Ensure `-d` flag is used and GPU drivers support profiling
+- **Profiling overhead too high**: Reduce test iterations; profile only the target kernel
+- **Results inconsistent**: Run multiple times and average; ensure no other GPU-intensive applications are running
+- **Zero DeviceTotalTime reported**: Driver may not support device timing; try updating GPU drivers
+
+---
+
+# References
+
+- Related skills: `build-openvino`, `run-gpu-tests`, `gpu-kernel-enabling`, `gpu-kernel-optimize`, `gpu-integrate-onednn-primitive`, `collect-gpu-hardware-spec`
+- Intel OpenCL Intercept Layer: https://github.com/intel/opencl-intercept-layer
diff --git a/.github/agents-prototype/skills/add-gpu-op/step3-run-tests.md b/.github/agents-prototype/skills/add-gpu-op/step3-run-tests.md
new file mode 100644
index 00000000000..0dfb55ed635
--- /dev/null
+++ b/.github/agents-prototype/skills/add-gpu-op/step3-run-tests.md
@@ -0,0 +1,155 @@
+---
+name: run-gpu-tests
+description: Execute GPU plugin tests (unit, functional) and dump kernel sources for verification — reusable utility across all GPU workflow skills
+---
+
+# Purpose
+
+Execute pre-written GPU plugin tests and dump kernel sources for inspection. This is a pure **execution and verification** utility — it does not create test code (see `write-gpu-tests` for that). Designed to be called from any GPU workflow skill that needs to run tests.
+
+# When to Use
+
+Use this skill whenever you need to **run** existing GPU tests or **dump** kernel sources:
+- After writing tests in `gpu-kernel-enabling` flow
+- After modifying code in `gpu-opset-migration` flow
+- After integrating oneDNN in `gpu-integrate-onednn-primitive` flow
+- After optimization in `gpu-kernel-optimize` flow
+
+```mermaid
+flowchart TD
+ A[Tests written / Code changed] --> B{What to verify?}
+ B -->|Correctness| C[Run Unit Tests]
+ B -->|Correctness| D[Run Functional Tests]
+ B -->|Kernel inspection| E[Dump Kernel Sources]
+ C --> F[Report Results]
+ D --> F
+ E --> F
+```
+
+# Procedure
+
+1. **Step 1: Select Mode** — Determine which verification to run (unit, functional, dump, or all)
+2. **Step 2: Execute** — Run the selected tests or dump command
+3. **Step 3: Report** — Summarize results (pass/fail count, dump file locations)
+
+---
+
+# Prerequisites Check
+
+Verify that GPU test binaries exist:
+
+**Windows (PowerShell):**
+```powershell
+# Check Debug build (for correctness testing)
+Test-Path ".\build\bin\intel64\Debug\ov_gpu_unit_tests.exe"
+```
+
+**Ubuntu:**
+```bash
+# Check Debug build (for correctness testing)
+test -f ./build/bin/intel64/Debug/ov_gpu_unit_tests && echo "OK" || echo "MISSING"
+```
+
+- **If successful:** Proceed to "Quick Start - Main Steps"
+- **If failed:** Run `build-openvino` with Debug configuration and tests enabled
+
+---
+
+# Quick Start
+
+## Installation (Prerequisites Check failed)
+
+Build the GPU plugin first by running `build-openvino` with a Debug configuration and tests enabled.
+
+---
+
+## Main Steps (Prerequisites Check passed)
+
+### Step 1: Select Mode
+
+Choose which verification to perform based on the caller's needs:
+
+| Mode | When to Use | Binary |
+|---|---|---|
+| `unit` | Verify internal GPU primitive logic | `ov_gpu_unit_tests` |
+| `functional` | Verify end-to-end Op correctness via SLT | `ov_gpu_func_tests` |
+| `dump` | Inspect compiled OpenCL kernel sources | `ov_gpu_unit_tests` + env var |
+| `all` | Full verification (dump + unit + functional) | All of the above |
+
+### Step 2: Run Unit Tests
+
+**Windows (PowerShell):**
+```powershell
+.\build\bin\intel64\Debug\ov_gpu_unit_tests.exe --gtest_filter=*<OpName>* --device_suffix=0
+```
+
+**Ubuntu:**
+```bash
+./build/bin/intel64/Debug/ov_gpu_unit_tests --gtest_filter=*<OpName>* --device_suffix=0
+```
+
+### Step 3: Run Functional Tests
+
+**Windows (PowerShell):**
+```powershell
+.\build\bin\intel64\Debug\ov_gpu_func_tests.exe --gtest_filter=*<OpName>* --device_suffix=0
+```
+
+**Ubuntu:**
+```bash
+./build/bin/intel64/Debug/ov_gpu_func_tests --gtest_filter=*<OpName>* --device_suffix=0
+```
+
+### Step 4: Dump Kernel Sources
+
+**Windows (PowerShell):**
+```powershell
+$env:OV_GPU_DUMP_SOURCES_PATH = ".\gpu_dump"
+.\build\bin\intel64\Debug\ov_gpu_unit_tests.exe --gtest_filter=*<OpName>*
+Get-ChildItem -Path .\gpu_dump -Filter "*.cl" | Sort-Object LastWriteTime -Descending | Select-Object -First 5
+```
+
+**Ubuntu:**
+```bash
+export OV_GPU_DUMP_SOURCES_PATH="./gpu_dump"
+./build/bin/intel64/Debug/ov_gpu_unit_tests --gtest_filter=*<OpName>*
+ls -lt ./gpu_dump/*.cl | head -5
+```
+
+**Dump verification checklist:**
+- [ ] Macros correctly substituted (e.g., `#define SIMD_SIZE 16`)
+- [ ] Data types match expected precision (float, half, int)
+- [ ] No undefined macros or compilation errors in dumped source
+
+### Step 5: Report Results
+
+Summarize test results for the caller:
+
+```
+## Test Results: <OpName>
+- Unit tests: X passed / Y total
+- Functional tests: X passed / Y total
+- Kernel dump: Verified (gpu_dump/<kernel_name>.cl)
+```
+
+**Parameters reference:**
+- `--gtest_filter=*<OpName>*` — Filter to the specific operation
+- `--device_suffix=0` — GPU.0 (first GPU); use `1` for GPU.1
+- `OV_GPU_DUMP_SOURCES_PATH` — Directory for kernel source dump output
+
+---
+
+# Troubleshooting
+
+- **Kernel dump produces empty files**: Ensure `OV_GPU_DUMP_SOURCES_PATH` points to a valid writable directory
+- **Tests not discovered**: Verify test files exist and are listed in `CMakeLists.txt` (see `write-gpu-tests`)
+- **device_suffix not working**: Check GPU device numbering with `clinfo`
+- **Test crashes on startup**: Run in Debug mode; check kernel dump for compilation errors
+- **Timeout during functional tests**: Some complex ops need longer; ensure sufficient system resources
+
+---
+
+# References
+
+- Related skills: `write-gpu-tests`, `gpu-kernel-enabling`, `gpu-kernel-optimize`, `gpu-integrate-onednn-primitive`, `gpu-opset-migration`, `build-openvino`
+- Test code creation: Use `write-gpu-tests` skill to create the test source files before running this skill
\ No newline at end of file
diff --git a/.github/agents-prototype/skills/add-gpu-op/step3-write-tests.md b/.github/agents-prototype/skills/add-gpu-op/step3-write-tests.md
new file mode 100644
index 00000000000..e5afff22e31
--- /dev/null
+++ b/.github/agents-prototype/skills/add-gpu-op/step3-write-tests.md
@@ -0,0 +1,219 @@
+---
+name: write-gpu-tests
+description: Create Single Layer Tests (SLT) and unit tests for OpenVINO GPU plugin operations — reusable across new op enabling, opset migration, and oneDNN integration
+---
+
+# Purpose
+
+Write functional and unit test code for OpenVINO GPU plugin operations. This skill creates the test source files that are later executed by the `run-gpu-tests` skill. It is designed to be reusable across multiple workflows: new op enabling, opset migration, and oneDNN integration.
+
+# When to Use
+
+Use this skill whenever test code needs to be **created or updated** for a GPU plugin operation:
+- During new op enabling (`gpu-kernel-enabling`) — write tests from scratch
+- During opset migration (`gpu-opset-migration`) — add test cases for new version/data types
+- During oneDNN integration (`gpu-integrate-onednn-primitive`) — add backend-specific test cases
+
+```mermaid
+flowchart TD
+ A[plan-op-implementation output] --> B[Determine test scope]
+ B --> C[Write SLT instantiation]
+ B --> D[Write unit test cases]
+ C --> E[Verify file placement]
+ D --> E
+ E --> F[run-gpu-tests to execute]
+```
+
+# Procedure
+
+1. **Step 1: Determine Test Scope** — Identify parameters, shapes, corner cases from the plan
+2. **Step 2: Write Single Layer Tests (SLT)** — Create shared functional test instantiation
+3. **Step 3: Write Unit Tests** — Create gtest cases for edge cases and layout-specific scenarios
+4. **Step 4: Verify File Placement** — Ensure files are in the correct directories
+
+---
+
+# Prerequisites Check
+
+Verify the OpenVINO GPU plugin source tree is available:
+
+**Windows (PowerShell):**
+```powershell
+Test-Path "src\plugins\intel_gpu\tests\functional\shared_tests_instances\single_layer_tests"
+```
+
+**Ubuntu:**
+```bash
+test -d src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests && echo "OK" || echo "MISSING"
+```
+
+- **If successful:** Proceed to "Quick Start - Main Steps"
+- **If failed:** Ensure you are in the OpenVINO source root directory
+
+---
+
+# Quick Start
+
+## Installation (Prerequisites Check failed)
+
+Navigate to the OpenVINO source root directory:
+```bash
+cd /path/to/openvino
+```
+
+---
+
+## Main Steps (Prerequisites Check passed)
+
+### Step 1: Determine Test Scope
+
+Review the `plan-op-implementation` output (Step 4: SLT Coverage) to identify:
+
+1. **Test parameters to sweep:**
+ - Precisions: typically `{f32, f16, i32, i64}` for data, `{i32, i64}` for indices
+ - Input shapes: small (1×1), medium (batch×channel×H×W), large stress tests
+ - Attributes: all valid combinations from the Op spec
+
+2. **Corner cases to cover:**
+ - Empty tensors (zero-length dimensions)
+ - Scalar inputs
+ - Maximum rank tensors
+ - Boundary values (INT_MAX, negative indices)
+ - Broadcasting edge cases (if applicable)
+
+3. **Reference implementation availability:**
+ - Check if `ov::reference::<op_name>` exists in `src/core/reference/include/openvino/reference/`
+ - If missing, flag it — a custom reference must be written
+
+### Step 2: Write Single Layer Tests (SLT)
+
+**Directory:** `src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/`
+**File:** `<op_name>.cpp`
+
+**Reference pattern:** Before writing, read an existing SLT file for a similar operation to follow the established pattern.
+
+| Op Type | Good Reference SLT |
+|---|---|
+| Element-wise | `eltwise.cpp` |
+| Reduction | `reduce_ops.cpp` |
+| Scatter/Gather | `scatter_nd_update.cpp` |
+| Shape manipulation | `reshape.cpp` |
+
+**SLT structure:**
+```cpp
+// 1. Include the shared test definition header
+#include "<shared_test_header>.hpp"
+
+// 2. Define the test namespace
+namespace {
+using namespace ov::test;
+
+// 3. Define parameter combinations
+const std::vector<ov::element::Type> dataPrecisions = {
+ ov::element::f32,
+ ov::element::f16,
+ ov::element::i32,
+};
+
+const std::vector<std::vector<ov::Shape>> inputShapes = {
+ {{2, 3}}, // small
+ {{4, 8, 16}}, // medium
+ {{2, 4, 8, 16}}, // 4D
+};
+
+// 4. Instantiate the test suite
+INSTANTIATE_TEST_SUITE_P(
+ smoke_<OpName>_GPU,
+ <OpName>LayerTest,
+ ::testing::Combine(
+ ::testing::ValuesIn(dataPrecisions),
+ ::testing::ValuesIn(inputShapes),
+ // ... additional parameters
+ ::testing::Values(ov::test::utils::DEVICE_GPU)
+ ),
+ <OpName>LayerTest::getTestCaseName
+);
+
+} // namespace
+```
+
+**Naming conventions:**
+- Test suite prefix: `smoke_<OpName>_GPU` for basic coverage
+- Extended tests: `extended_<OpName>_GPU` for exhaustive sweeps
+
+### Step 3: Write Unit Tests
+
+**Directory:** `src/plugins/intel_gpu/tests/unit/test_cases/`
+**File:** `<op_name>_gpu_test.cpp`
+
+Unit tests cover scenarios that SLTs may not reach:
+- Specific memory layouts (`bfyx`, `b_fs_yx_fsv16`, `b_fs_yx_fsv32`)
+- Dynamic shape behavior
+- Error handling (invalid inputs)
+- Edge cases unique to the GPU implementation
+
+**Unit test structure:**
+```cpp
+#include "test_utils.h"
+// Include primitive header
+#include "intel_gpu/primitives/<op_name>.hpp"
+
+using namespace cldnn;
+using namespace ::tests;
+
+TEST(op_name_gpu, basic_2d_f32) {
+ auto& engine = get_test_engine();
+
+ // 1. Create input memory
+ auto input = engine.allocate_memory({ data_types::f32, format::bfyx, { 1, 1, 4, 4 } });
+ set_values(input, { /* test data */ });
+
+ // 2. Build topology
+ topology topo;
+ topo.add(input_layout("input", input->get_layout()));
+ topo.add(<op_name>("output", input_info("input") /*, attributes */));
+
+ // 3. Execute and validate
+ network net(engine, topo);
+ net.set_input_data("input", input);
+ auto outputs = net.execute();
+
+ auto output_mem = outputs.at("output").get_memory();
+ cldnn::mem_lock<float> output_ptr(output_mem, get_test_stream());
+
+ // 4. Check results
+ std::vector<float> expected = { /* expected values */ };
+ for (size_t i = 0; i < expected.size(); ++i) {
+ ASSERT_NEAR(output_ptr[i], expected[i], 1e-5f);
+ }
+}
+```
+
+### Step 4: Verify File Placement
+
+Confirm test files are placed correctly per `gpu-op-file-structure`:
+
+| Test Type | Path |
+|---|---|
+| SLT (shared functional) | `src/plugins/intel_gpu/tests/functional/shared_tests_instances/single_layer_tests/<op_name>.cpp` |
+| Unit tests | `src/plugins/intel_gpu/tests/unit/test_cases/<op_name>_gpu_test.cpp` |
+
+Ensure the files are included in the appropriate `CMakeLists.txt` so they are compiled during build.
+
+---
+
+# Troubleshooting
+
+- **Shared test definition header not found**: Check if the Op has a shared test class in `src/tests/functional/shared_test_classes/include/`. If not, it must be created first.
+- **Test not discovered after build**: Verify the file is listed in the corresponding `CMakeLists.txt`
+- **Reference implementation missing**: If `ov::reference::<op_name>` does not exist, create one or use a custom evaluator in the test
+- **Parameter combination explosion**: Use `smoke_` prefix for essential combinations only; save exhaustive sweeps for `extended_` suites
+
+---
+
+# References
+
+- Related skills: `gpu-kernel-enabling`, `gpu-opset-migration`, `gpu-integrate-onednn-primitive`, `run-gpu-tests`, `gpu-op-file-structure`
+- Test execution: Use `run-gpu-tests` skill to run the tests created by this skill
+- OpenVINO shared test infrastructure: `src/tests/functional/shared_test_classes/`
+- GPU unit test utilities: `src/plugins/intel_gpu/tests/unit/test_utils/`
diff --git a/.github/agents-prototype/skills/add-gpu-op/step4-onednn-integration.md b/.github/agents-prototype/skills/add-gpu-op/step4-onednn-integration.md
new file mode 100644
index 00000000000..e0395126a32
--- /dev/null
+++ b/.github/agents-prototype/skills/add-gpu-op/step4-onednn-integration.md
@@ -0,0 +1,185 @@
+---
+name: gpu-integrate-onednn-primitive
+description: Integrate oneDNN primitive into OpenVINO GPU plugin when an existing oneDNN kernel is available for the operation
+---
+
+# Purpose
+
+Guide the implementation of a oneDNN-based primitive for the OpenVINO GPU plugin. When a requested operation already has a high-performance oneDNN primitive available, it should be leveraged instead of (or in addition to) writing a custom OpenCL kernel. oneDNN provides optimized implementations for many common deep learning operations on Intel GPUs.
+
+# When to Use
+
+Use this skill **after** creating and profiling the reference OpenCL kernel (`gpu-kernel-enabling` + `gpu-kernel-device-timing`), once you decide to integrate a oneDNN primitive for the operation. After integration, use `gpu-kernel-device-timing` to collect timings for both OpenCL and oneDNN paths.
+
+```mermaid
+flowchart TD
+ A[Op Implementation Request] --> B[Implement & Verify Reference OpenCL Kernel<br/>(gpu-kernel-enabling)]
+ B --> C[Profile Reference OpenCL Kernel<br/>(gpu-kernel-device-timing)]
+ C --> D{oneDNN primitive available<br/>& beneficial?}
+ D -->|Yes| E[Integrate oneDNN Primitive<br/>(this skill)]
+ D -->|No| F[Keep OpenCL-only Path]
+ E --> G[Add Kernel Selection & Verify<br/>(OpenCL + oneDNN)]
+ F --> G
+ G --> H[Collect Timing for Both Paths<br/>(gpu-kernel-device-timing)]
+```
+
+# Procedure
+
+1. **Step 1: Review Op Plan Strategy** — Check if oneDNN integration was recommended in the `plan-op-implementation` strategy for the target Op
+2. **Step 2: Create oneDNN Implementation** — Write the oneDNN-based implementation
+3. **Step 3: Register in Graph** — Register the oneDNN primitive in the GPU plugin graph
+4. **Step 4: Add Kernel Selection Logic** — Enable selection between OpenCL and oneDNN implementations
+5. **Step 5: Verify** — Run tests to ensure correctness
+
+---
+
+# Prerequisites Check
+
+Verify that oneDNN is available in the OpenVINO build:
+
+**Windows (PowerShell):**
+```powershell
+# Check whether bundled oneDNN artifacts are present in the build tree
+Test-Path ".\build\third-party-programs\onednn" -ErrorAction SilentlyContinue
+
+# Or check for built dnnl artifacts
+Get-ChildItem -Path .\build -Recurse -Include "dnnl*","*onednn*" -ErrorAction SilentlyContinue | Select-Object -First 5
+```
+
+**Ubuntu:**
+```bash
+# Check whether bundled oneDNN artifacts are present in the build tree
+test -d ./build/third-party-programs/onednn && echo "OK" || echo "Check build tree"
+
+# Or check if dnnl/oneDNN libraries exist
+find ./build -name "libdnnl*" -o -name "dnnl*" 2>/dev/null | head -5
+```
+
+- **If successful:** Proceed to "Quick Start - Main Steps"
+- **If failed:** Rebuild using the canonical `build-openvino` workflow and verify bundled oneDNN artifacts are generated
+
+---
+
+# Quick Start
+
+## Installation (Prerequisites Check failed)
+
+oneDNN is typically bundled as a third-party dependency in OpenVINO GPU builds. Use the `build-openvino` skill in Debug mode with tests enabled rather than relying on an ad-hoc oneDNN-specific CMake flag.
+
+---
+
+## Main Steps (Prerequisites Check passed)
+
+### Step 1: Review Op Plan Strategy
+
+Examine the `plan-op-implementation` results. Before implementing, verify that this operation was identified as a candidate for oneDNN integration.
+
+**Common oneDNN-supported operations:**
+- Convolution (`dnnl::convolution_forward`)
+- MatMul / Inner Product (`dnnl::matmul`, `dnnl::inner_product_forward`)
+- Pooling (`dnnl::pooling_forward`)
+- Batch Normalization (`dnnl::batch_normalization_forward`)
+- Eltwise (ReLU, GELU, etc.) (`dnnl::eltwise_forward`)
+- Softmax (`dnnl::softmax_forward`)
+- Reduction (`dnnl::reduction`)
+- Reorder / Reformat (`dnnl::reorder`)
+- Binary operations (`dnnl::binary`)
+
+**Check the oneDNN API reference:**
+- https://oneapi-src.github.io/oneDNN/
+- Look for the primitive in `dnnl::primitive_kind`
+
+**Existing oneDNN implementations in GPU plugin:**
+```
+src/plugins/intel_gpu/src/graph/impls/onednn/
+```
+
+Review existing implementations for patterns and conventions.
+
+### Step 2: Create oneDNN Implementation
+
+**Directory:** `src/plugins/intel_gpu/src/graph/impls/onednn/`
+**File:** `<op_name>_onednn.cpp`
+
+**Implementation pattern:**
+
+```cpp
+// Key components for a oneDNN implementation:
+
+// 1. Create oneDNN primitive descriptor
+// - Map OpenVINO tensor descriptors to oneDNN memory descriptors
+// - Configure the primitive attributes (post-ops, scales, etc.)
+
+// 2. Create primitive
+// - Instantiate the oneDNN primitive from the descriptor
+// - Handle memory format selection
+
+// 3. Execute
+// - Map GPU plugin memory to oneDNN memory objects
+// - Execute the primitive
+// - Handle output memory reorder if needed
+```
+
+**Key considerations:**
+- Map `cldnn` layout formats to oneDNN memory formats
+- Handle data type conversions (fp32, fp16, bf16, int8)
+- Support post-operation fusion when applicable
+- Ensure proper memory lifecycle management
+
+### Step 3: Register in GPU Plugin Graph
+
+Register the oneDNN implementation so the GPU plugin can discover and use it:
+
+```cpp
+// Registration pattern (simplified):
+// 1. Implement the typed_primitive_onednn_impl class
+// 2. Register the implementation factory
+// 3. Add layout and data type validation
+```
+
+### Step 4: Add Kernel Selection Logic
+
+The GPU plugin needs logic to choose between OpenCL and oneDNN implementations.
+
+**Selection criteria:**
+- Hardware support (oneDNN may only support certain GPU architectures)
+- Data type availability (oneDNN may support int8 quantization that OpenCL ref doesn't)
+- Layout compatibility (oneDNN may prefer specific blocked layouts)
+- Performance characteristics (oneDNN is often faster for standard ops)
+
+**File to modify:** Kernel selector or implementation factory registration.
+
+### Step 5: Functional Verification
+
+If oneDNN-specific test cases are needed (e.g., backend selection, int8 quantization paths), invoke `write-gpu-tests` to add them first.
+
+Then invoke `run-gpu-tests` skill to verify the oneDNN integration:
+- Run unit tests and functional tests filtered to the target op
+- Verify both OpenCL and oneDNN paths produce correct results
+
+**Verification checklist:**
+- [ ] All existing tests still pass (no regression)
+- [ ] oneDNN path is selected when expected
+- [ ] Results match the reference OpenCL kernel within acceptable tolerance
+- [ ] Performance is equal or better than OpenCL reference (verify via `gpu-kernel-device-timing`)
+
+---
+
+# Troubleshooting
+
+- **oneDNN primitive not found**: Verify the op is supported in the oneDNN version bundled with OpenVINO
+- **Memory format mismatch**: Ensure proper mapping between `cldnn` layouts and `dnnl::memory::format_tag`
+- **Accuracy regression**: Check data type handling, especially for fp16/bf16 operations
+- **oneDNN path not selected**: Verify the implementation factory registration and selection priority
+- **Build errors**: Verify the canonical `build-openvino` workflow completed successfully and that bundled dnnl/oneDNN artifacts were generated in the build tree
+- **Runtime errors**: Check oneDNN verbose output with `ONEDNN_VERBOSE=1` environment variable
+
+---
+
+# References
+
+- Related skills: `gpu-kernel-enabling`, `gpu-kernel-device-timing`, `run-gpu-tests`, `write-gpu-tests`, `gpu-op-file-structure`
+- Canonical build workflow: `build-openvino`
+- oneDNN API reference: https://oneapi-src.github.io/oneDNN/
+- Existing oneDNN implementations: `src/plugins/intel_gpu/src/graph/impls/onednn/`
+- oneDNN GPU support: https://oneapi-src.github.io/oneDNN/dev_guide_understanding_memory_formats.html
diff --git a/.github/agents-prototype/skills/add-gpu-op/step5-optimize.md b/.github/agents-prototype/skills/add-gpu-op/step5-optimize.md
new file mode 100644
index 00000000000..b79dd482b31
--- /dev/null
+++ b/.github/agents-prototype/skills/add-gpu-op/step5-optimize.md
@@ -0,0 +1,254 @@
+---
+name: gpu-kernel-optimize
+description: Hardware-aware optimization techniques for Intel GPU OpenCL kernels including sub-groups, memory layout, LWS tuning, and register pressure
+---
+
+# Purpose
+
+Apply hardware-aware optimizations to OpenCL kernels for Intel GPUs. This skill covers sub-group size selection, memory layout with block reads, local work size (LWS) tuning, and register pressure management — all based on hardware data from `collect-gpu-hardware-spec`.
+
+# When to Use
+
+Use this skill as **Step 5 (mandatory)** of the `intel-gpu-kernel` workflow to create an optimized kernel and produce a Performance Comparison Report. The optimizations here are guided by profiling data from `gpu-kernel-device-timing` and hardware specifications from `collect-gpu-hardware-spec`.
+
+```mermaid
+flowchart TD
+ A[Profiling Shows Bottleneck] --> B[Review HW Specs]
+ B --> C{Bottleneck Type?}
+ C -->|SIMD Utilization| D[Sub-group Size Tuning]
+ C -->|Memory Bandwidth| E[Block Reads & Layout]
+ C -->|Occupancy| F[LWS Tuning]
+ C -->|Register Spilling| G[Register Pressure Mgmt]
+ D --> H[Create Optimized Kernel]
+ E --> H
+ F --> H
+ G --> H
+ H --> I[Re-profile to Verify]
+```
+
+# Procedure
+
+1. **Step 1: Review Hardware Baseline** — Ensure `collect-gpu-hardware-spec` data is available
+2. **Step 2: Identify Bottleneck** — Use profiling data to determine optimization target
+3. **Step 3: Apply Optimization** — Choose and implement the appropriate technique
+4. **Step 4: Create Optimized Kernel** — Write `<op_name>_opt.cl` with hardware-specific tuning
+5. **Step 5: Re-profile** — Verify performance improvement
+
+---
+
+# Prerequisites Check
+
+Verify you have hardware analysis data and profiling results:
+
+**Windows (PowerShell):**
+```powershell
+# Verify clinfo is available for hardware data
+clinfo | Select-String "Device Name"
+
+# Verify Release build exists for profiling
+Test-Path ".\build\bin\intel64\Release\ov_gpu_unit_tests.exe"
+```
+
+**Ubuntu:**
+```bash
+# Verify clinfo is available for hardware data
+clinfo | grep "Device Name"
+
+# Verify Release build exists for profiling
+test -f ./build/bin/intel64/Release/ov_gpu_unit_tests && echo "OK" || echo "MISSING"
+```
+
+- **If successful:** Proceed to "Quick Start - Main Steps"
+- **If failed:** Run `collect-gpu-hardware-spec`, then run `build-openvino` with a Release configuration and tests enabled
+
+---
+
+# Quick Start
+
+## Installation (Prerequisites Check failed)
+
+1. Run `collect-gpu-hardware-spec` skill to collect hardware specs
+2. Run `build-openvino` with a Release configuration and tests enabled
+3. Run `gpu-kernel-device-timing` skill to identify bottlenecks
+
+---
+
+## Main Steps (Prerequisites Check passed)
+
+### Step 1: Prepare Profiling Test Case
+
+Before applying any optimization, prepare a dedicated test case for performance measurement. Unit tests typically do not have enough iterations for reliable profiling.
+
+**Recommended approach:**
+- Use `benchmark_app` with a model that exercises the target kernel
+- Or create a dedicated performance test with sufficient iterations (e.g., 100+ runs)
+- Record baseline DeviceTotalTime using `gpu-kernel-device-timing` skill
+
+### Step 2–3: Identify Bottleneck & Apply Optimization
+
+### A. Dynamic Sub-group Size Selection
+
+Sub-group size directly affects SIMD width and performance.
+
+**Selection rules based on `Max sub-group size` from clinfo:**
+
+| Max Sub-group Size | Recommended SIMD | Notes |
+|---|---|---|
+| 16 or 32 | 16 | Use 16 as default for all architectures to keep codebase simple and portable |
+| 8 | 8 | Rare; fallback only for legacy hardware |
+
+**Implementation:**
+```c
+// In OpenCL kernel — set sub-group size based on hardware
+__attribute__((intel_reqd_sub_group_size(SIMD_SIZE)))
+__kernel void my_kernel(...) {
+ // SIMD_SIZE is defined via JitConstants based on clinfo data
+ ...
+}
+```
+
+**In kernel selector (JitConstants):**
+```cpp
+// Define SIMD_SIZE based on hardware detection
+jit.AddConstant(MakeJitConstant("SIMD_SIZE", GetSimdSize(params)));
+```
+
+### B. Memory Layout & Block Reads (fsv16)
+
+Maximize memory bandwidth using Intel sub-group block reads.
+
+**Rules:**
+- Use `intel_sub_group_block_read` — reads `4 bytes × SIMD_SIZE` in one operation
+- Requires pointers aligned to at least 16 bytes
+- Align to 128 bytes (cache line) when possible for optimal prefetching
+
+**Implementation:**
+```c
+// Block read pattern — much faster than scalar global memory access
+uint raw = intel_sub_group_block_read((__global uint*)(input + offset));
+float value = as_float(raw);
+
+// For fp16 data:
+ushort raw_h = intel_sub_group_block_read_us((__global ushort*)(input + offset));
+half value_h = as_half(raw_h);
+```
+
+**Alignment requirements:**
+
+| Minimum Alignment | Optimal Alignment |
+|---|---|
+| 16 bytes | 128 bytes (cache line) |
+
+### C. Local Work Size (LWS) Tuning
+
+Optimize work-group size for maximum GPU occupancy.
+
+**Rules:**
+1. LWS must be a multiple of `SIMD_SIZE`
+2. `Ideal LWS = min(Max work group size, SLM_Constraint)`
+3. General preference: LWS of 256 works well across most Intel GPU architectures
+
+**Implementation in kernel selector:**
+```cpp
+// Set LWS based on hardware
+CommonDispatchData dispatchData;
+dispatchData.gws = { global_x, global_y, global_z };
+dispatchData.lws = { lws_x, 1, 1 }; // lws_x = multiple of SIMD_SIZE
+```
+
+**SLM constraint calculation:**
+```
+Max LWS from SLM = SLM_size / per_workitem_SLM_usage
+Actual LWS = min(Max_work_group_size, Max_LWS_from_SLM)
+Actual LWS = round_down_to_multiple(Actual_LWS, SIMD_SIZE)
+```
+
+### D. Register Pressure Management
+
+Manage register usage to avoid spilling, especially on smaller GPUs.
+
+**Warning signs:**
+- Kernel has many local variables
+- Complex control flow with deep nesting
+- Multiple large arrays in private memory
+
+**Strategies:**
+
+| Strategy | When to Apply | Impact |
+|---|---|---|
+| Use `half` (fp16) precision | `cl_khr_fp16` supported, acceptable accuracy | Halves register usage |
+| Reduce loop unrolling | High register pressure | Fewer registers, slightly slower |
+| Split large kernels | Many variables in single kernel | Better register allocation |
+| Use SLM instead of registers | Data reuse across work-items | Trades register for SLM |
+
+**Implementation — fp16 precision:**
+```c
+// Use half precision to reduce register pressure
+#ifdef cl_khr_fp16
+#pragma OPENCL EXTENSION cl_khr_fp16 : enable
+// Use half instead of float where acceptable
+half value = convert_half(input_float);
+#endif
+```
+
+### Step 4: Create Optimized Kernel
+
+After applying optimizations, create the optimized kernel file:
+
+**File:** `src/plugins/intel_gpu/src/graph/impls/ocl_v2/<op_name>_opt.cl`
+
+The optimized kernel should:
+- Include all hardware-specific optimizations identified above
+- Be conditionally selected in the kernel selector based on hardware capabilities
+- Coexist with the reference kernel (`<op_name>_ref.cl`) as a fallback
+
+**Kernel selector update:**
+```cpp
+// In kernel selector — choose optimized kernel when hardware supports it
+if (SupportsOptimizedKernel(params)) {
+ implementations.push_back(std::make_unique<OpNameKernelOpt>());
+}
+implementations.push_back(std::make_unique<OpNameKernelRef>()); // Always fallback
+```
+
+### Step 5: Verify & Re-profile
+
+After creating the optimized kernel:
+
+1. **Verify correctness:** Invoke `run-gpu-tests` skill to run unit and functional tests, ensuring the optimized kernel produces correct results.
+
+2. **Measure performance:** Invoke `gpu-kernel-device-timing` skill to collect Opt kernel timing.
+
+3. **Produce Performance Comparison Report:**
+
+```markdown
+## Performance Comparison Report: <OpName>
+
+| Kernel Variant | DeviceTotalTime | Speedup vs Ref |
+|----------------------|-----------------|----------------|
+| Ref (`<op>_ref.cl`) | X.XX ms | 1.00× (baseline) |
+| Opt (`<op>_opt.cl`) | Y.YY ms | X.XX / Y.YY = N.NN× |
+| oneDNN (if applicable)| Z.ZZ ms | X.XX / Z.ZZ = N.NN× |
+
+- Test shape: [batch, channels, height, width]
+- Hardware: Intel <GPU Name> (from collect-gpu-hardware-spec)
+- Optimizations applied: <list applied techniques>
+```
+
+---
+
+# Troubleshooting
+
+- **No performance improvement**: Bottleneck may be elsewhere (host-side, memory transfer); re-analyze profiling data
+- **Kernel compilation fails with sub-group**: Verify `SIMD_SIZE` matches hardware support from `clinfo`
+- **Block read crashes**: Check pointer alignment — must be aligned to at least 16 bytes
+- **Register spilling warnings**: Reduce variable count, use `half` precision, or split kernel
+- **LWS rejected by driver**: Ensure LWS divides GWS evenly and does not exceed `Max work group size`
+
+---
+
+# References
+
+- Related skills: `collect-gpu-hardware-spec`, `gpu-kernel-device-timing`, `run-gpu-tests`, `gpu-kernel-enabling`, `gpu-op-file-structure`
+- Intel GPU optimization guide: https://www.intel.com/content/www/us/en/developer/articles/guide/opencl-developers-guide.html
+- Sub-group functions: https://registry.khronos.org/OpenCL/extensions/intel/cl_intel_subgroups.html
diff --git a/.github/agents-prototype/skills/analyze-and-convert/SKILL.md b/.github/agents-prototype/skills/analyze-and-convert/SKILL.md
new file mode 100644
index 00000000000..379b7af13c0
--- /dev/null
+++ b/.github/agents-prototype/skills/analyze-and-convert/SKILL.md
@@ -0,0 +1,22 @@
+---
+name: analyze-and-convert
+description: Analyze a HuggingFace model and attempt OpenVINO conversion — probe properties, run strategy matrix, classify failures, and produce a structured routing report.
+---
+
+# Skill: Analyze and Convert
+
+## When to use
+When you have a model ID (or local path) and need to determine whether it converts
+to OpenVINO IR, identify why it fails, and emit routing signals for the next agent
+in the pipeline.
+
+## Steps
+
+Execute in strict order — each step produces files consumed by the next.
+
+| Step | File | Purpose |
+|---|---|---|
+| 1 | [probe-model.md](probe-model.md) | Gather model profile (architecture, task, op types) without downloading weights |
+| 2 | [try-conversion.md](try-conversion.md) | Run conversion strategy matrix (optimum-cli / ovc / convert_model), capture all outputs |
+| 3 | [classify-failure.md](classify-failure.md) | Map errors to taxonomy, extract `missing_op` / `shape_inference` / `accuracy` signals (skip on full success) |
+| 4 | [build-report.md](build-report.md) | Assemble structured report, emit `<!-- agent-result -->` marker for orchestrator |
diff --git a/.github/agents-prototype/skills/analyze-and-convert/build-report.md b/.github/agents-prototype/skills/analyze-and-convert/build-report.md
new file mode 100644
index 00000000000..051a1037086
--- /dev/null
+++ b/.github/agents-prototype/skills/analyze-and-convert/build-report.md
@@ -0,0 +1,75 @@
+---
+name: build-report
+description: Combine all gathered artifacts into a structured conversion_report.md and a machine-readable agent-complete marker. Posts the report to the GitHub issue and writes the manifest entry.
+---
+
+# Skill: Build Report
+
+**Trigger:** Final step of the `analyze-and-convert` workflow. Always runs —
+regardless of whether conversion succeeded or failed.
+
+Inputs: `model_profile.json`, `conversion_attempts.json`, `routing_signals.json`,
+`error_excerpts.json` (all produced by previous skills).
+
+---
+
+## Step 1 — Load all artifacts
+
+Run `build_report.py` to load artifacts and compute status:
+
+```bash
+python build_report.py
+```
+
+Script: [build_report.py](./build_report.py)
+
+---
+
+## Step 2 — Write conversion_report.md
+
+Script: [build_report.py](./build_report.py) — generates `conversion_report.md` with:
+
+- Model profile table
+- Conversion attempts summary
+- Successful strategy details (if applicable)
+- Failure details and error excerpts (if applicable)
+- Routing signals summary
+- Recommended next step and agent routing
+
+---
+
+## Step 3 — Post to GitHub Issue (if gh CLI available)
+
+Script: [build_report.py](./build_report.py) — posts `conversion_report.md` as a PR comment using `gh pr comment` if available.
+
+---
+
+## Step 4 — Record Result
+
+Script: [build_report.py](./build_report.py) — writes `analyze_and_convert_result.json` with:
+
+- Agent name and status (success/partial/failed)
+- Model ID and entry type
+- Error classification and target agent routing
+
+---
+
+## Step 5 — Write agent-complete Marker
+
+Script: [build_report.py](./build_report.py) — prints standard `<!-- agent-complete -->` marker (HTML comment) with:
+
+- `agent`: "analyze-and-convert"
+- `status`: "success" | "partial" | "failed"
+- `next_agent`: target agent for routing (wwb, optimum-intel, etc.)
+- `error_class`: error classification (none, oom_suspected, custom_ops, etc.)
+- `next_context`: filtered signals for next agent
+- `model_id`: original model identifier
+
+---
+
+## Output
+
+| File | Contents |
+|------|----------|
+| `conversion_report.md` | Full human-readable report — saved to agent-results/ |
+| `agent-complete` marker (stdout) | Machine-readable routing block for `dispatcher.yml` |
diff --git a/.github/agents-prototype/skills/analyze-and-convert/classify-failure.md b/.github/agents-prototype/skills/analyze-and-convert/classify-failure.md
new file mode 100644
index 00000000000..a287bb09d97
--- /dev/null
+++ b/.github/agents-prototype/skills/analyze-and-convert/classify-failure.md
@@ -0,0 +1,294 @@
+---
+name: classify-failure
+description: Classify each failed conversion attempt into the 9-class error taxonomy and extract routing signals for the orchestrator. Maps tracebacks to root causes, identifies specific components, and produces a machine-readable signal block.
+---
+
+# Skill: Classify Failure
+
+**Trigger:** Called after `try-conversion` when no strategy succeeded, or after
+a successful conversion that fails inference. Reads `conversion_attempts.json`
+and `model_profile.json`.
+
+---
+
+## Error Taxonomy
+
+Map every failure traceback to exactly one class:
+
+| Class | Key signatures | First specialist |
+|-------|---------------|-----------------|
+| `optimum_unsupported_arch` | `KeyError` from `TasksManager`, `model_type` not registered | Optimum-Intel |
+| `optimum_export_bug` | Exception inside `optimum/exporters/`, wrongly-shaped dummy inputs, `TypeError` in model config | Optimum-Intel |
+| `missing_model_dependency` | `ModuleNotFoundError`, `ImportError: requires package`, `pip install` hint in error | Optimum-Intel |
+| `missing_conversion_rule` | `NotImplemented` in PyTorch FE, `aten::*` op not covered, `ConversionError: No rule` | OV Orchestrator (FE Agent) |
+| `frontend_error` | Exception inside `openvino/frontend/`, segfault during tracing, IR parse error | OV Orchestrator (FE Agent) |
+| `ir_validation_error` | Shape inference failure, `ngraph::validate_and_infer_types`, invalid IR structure | OV Orchestrator |
+| `inference_runtime_error` | Exception from OV runtime, plugin error, `ov::Exception` during infer | OV Orchestrator |
+| `genai_unsupported` | `ValueError` from `openvino_genai`, missing chat template, pipeline construction error | GenAI |
+| `tokenizer_error` | Exception from `openvino_tokenizers`, tokenizer conversion failure, SentencePiece error | Tokenizers |
+| `unknown_arch_transformers_too_old` | `model_type` absent from installed transformers but visible on HF Hub | Optimum-Intel (transformers upgrade first) |
+| `unknown` | None of the above match | Optimum-Intel (fallback) |
+
+---
+
+## Step 1 — Load Artifacts
+
+```python
+import json, re
+
+with open("conversion_attempts.json") as f:
+ attempts = json.load(f)
+
+with open("model_profile.json") as f:
+ profile = json.load(f)
+
+# Collect all error text from failed attempts
+all_errors = []
+for a in attempts:
+ if not a["success"]:
+ combined = (a.get("stderr", "") + "\n" + a.get("stdout", "")).strip()
+ all_errors.append({"id": a["id"], "text": combined})
+```
+
+---
+
+## Step 2 — Pattern Matching
+
+```python
+def classify_error(text: str) -> str:
+ t = text.lower()
+
+ # Order matters — most specific first
+ if re.search(r"modulenotfounderror|importerror.*requires.*package|no module named", t):
+ return "missing_model_dependency"
+
+ if re.search(r"keyerror.*taskmanager|model_type.*not.*support|no configuration class", t):
+ # Distinguish: is model_type missing from transformers or from optimum?
+ if re.search(r"no.*class.*for.*model_type|transformers.*doesn.t.*know", t):
+ return "unknown_arch_transformers_too_old"
+ return "optimum_unsupported_arch"
+
+ if re.search(r"optimum[/\\]exporters|dummy_inputs|onnx_config|ModelPatcher|"
+ r"from_pretrained.*export|openvino_config", t):
+ return "optimum_export_bug"
+
+ if re.search(r"notimplemented.*aten::|no rule.*op|conversion.*failed.*aten|"
+ r"pytorch_frontend|pt_frontend|torchscript.*error", t):
+ return "missing_conversion_rule"
+
+ if re.search(r"openvino[/\\]frontend|ir.*parse|frontend.*error|"
+ r"segmentation fault|core dumped", t):
+ return "frontend_error"
+
+ if re.search(r"validate_and_infer_types|ngraph.*shape|ir.*invalid|"
+ r"shape inference failed|opset.*mismatch", t):
+ return "ir_validation_error"
+
+ if re.search(r"ov::exception|infer.*request|plugin.*error|"
+ r"openvino.*runtime.*error|inference engine", t):
+ return "inference_runtime_error"
+
+ if re.search(r"openvino_genai|chat.*template.*missing|pipeline.*construct", t):
+ return "genai_unsupported"
+
+ if re.search(r"openvino_tokenizers|sentencepiece|tokenizer.*convert|"
+ r"tiktoken.*error|fast.*tokenizer", t):
+ return "tokenizer_error"
+
+ return "unknown"
+
+
+# Classify each failed attempt
+for err in all_errors:
+ err["error_class"] = classify_error(err["text"])
+ # Extract first meaningful traceback line
+ lines = err["text"].splitlines()
+ tb_lines = [l for l in lines if
+ "Error" in l or "Exception" in l or "raise " in l]
+ err["key_line"] = tb_lines[0].strip() if tb_lines else lines[-1].strip() if lines else ""
+
+# Dominant class = class of the last (most sophisticated) attempt
+dominant_class = all_errors[-1]["error_class"] if all_errors else "unknown"
+print(f"Dominant error class: {dominant_class}")
+```
+
+---
+
+## Step 2.5 — Search Git History for Similar Fixes
+
+Before generating routing signals, search the repository's git log for recent commits that
+solved the same class of problem. This gives the downstream coding agent a prior-art hint,
+preventing repeated workarounds for problems that already have a canonical fix.
+
+```python
+import subprocess
+
+def search_prior_art(error_class: str, op_name: str) -> list:
+ """Return up to 10 recent commit one-liners relevant to this error class."""
+ term_map = {
+ "missing_conversion_rule": [op_name, "add op translator", "add converter", "frontend: add"],
+ "accuracy_regression": [op_name, "fp16 overflow", "precision fix", "accuracy", "fp16"],
+ "frontend_error": [op_name, "frontend: fix", "normalize", "conversion fix"],
+ "inference_runtime_error": [op_name, "cpu: fix", "plugin fix", "inference"],
+ "ir_validation_error": [op_name, "shape inference", "type prop", "core: fix"],
+ }
+ terms = term_map.get(error_class, [op_name])
+ seen, results = set(), []
+ for term in terms[:4]:
+ try:
+ out = subprocess.check_output(
+ ["git", "log", "--oneline", "-15", f"--grep={term}"],
+ text=True, stderr=subprocess.DEVNULL,
+ )
+ for line in out.strip().splitlines():
+ if line and line not in seen:
+ seen.add(line)
+ results.append({"term": term, "commit": line})
+ except (subprocess.CalledProcessError, FileNotFoundError):
+ pass
+ return results[:10]
+
+op_name = profile.get("missing_ops", [""])[0] if profile.get("missing_ops") else ""
+prior_art = search_prior_art(dominant_class, op_name)
+
+with open("prior_art.json", "w") as f:
+ json.dump({"error_class": dominant_class, "op": op_name, "commits": prior_art}, f, indent=2)
+
+if prior_art:
+ print("Prior art found:")
+ for entry in prior_art:
+ print(f" [{entry['term']}] {entry['commit']}")
+else:
+ print("No prior art found in git history — proceeding without hints.")
+```
+
+The resulting `prior_art.json` is included in the routing report and passed to the downstream
+coding agent as context. The agent should use it to confirm the canonical fix pattern rather
+than implementing from scratch.
+```
+
+---
+
+## Step 3 — Extract Routing Signals
+
+```python
+def extract_signals(attempts, profile, dominant_class):
+ signals = {
+ "error_class": dominant_class,
+ "requires_optimum_new_arch": False,
+ "requires_transformers_upgrade": False,
+ "transformers_override": "",
+ "requires_tokenizer_check": False,
+ "trust_remote_code_required": profile["trust_remote_code_required"],
+ "is_vlm": profile["is_vlm"],
+ "custom_ops_suspected": False,
+ "oom_suspected": False,
+ "target_agent": "", # filled below
+ }
+
+ all_text = " ".join(
+ a.get("stderr", "") + a.get("stdout", "") for a in attempts
+ ).lower()
+
+ # Optimum arch signals
+ if dominant_class in ("optimum_unsupported_arch", "unknown_arch_transformers_too_old"):
+ signals["requires_optimum_new_arch"] = True
+
+ if dominant_class == "unknown_arch_transformers_too_old":
+ signals["requires_transformers_upgrade"] = True
+ signals["transformers_override"] = (
+ "git+https://github.com/huggingface/transformers.git"
+ )
+
+ # Custom ops / recurrent patterns in config
+ ssm_keys = [k for k in profile.get("special_config_keys", [])
+ if any(w in k.lower() for w in
+ ["ssm", "mamba", "rwkv", "recurrent", "conv", "delta"])]
+ if ssm_keys:
+ signals["custom_ops_suspected"] = True
+
+ # OOM signals
+ if re.search(r"out of memory|oom|killed|memory error|cannot allocate", all_text):
+ signals["oom_suspected"] = True
+
+ # VLM implies tokenizer check after export
+ if profile["is_vlm"]:
+ signals["requires_tokenizer_check"] = True
+
+ # Determine target agent
+ routing = {
+ "optimum_unsupported_arch": "optimum-intel",
+ "optimum_export_bug": "optimum-intel",
+ "missing_model_dependency": "optimum-intel",
+ "unknown_arch_transformers_too_old": "optimum-intel",
+ "unknown": "optimum-intel",
+ "missing_conversion_rule": "enable-operator",
+ "frontend_error": "enable-operator",
+ "ir_validation_error": "enable-operator",
+ "inference_runtime_error": "enable-operator",
+ "genai_unsupported": "openvino-genai",
+ "tokenizer_error": "openvino-tokenizers",
+ }
+ signals["target_agent"] = routing.get(dominant_class, "optimum-intel")
+
+ return signals
+
+
+signals = extract_signals(attempts, profile, dominant_class)
+print("Routing signals:", json.dumps(signals, indent=2))
+
+with open("routing_signals.json", "w") as f:
+ json.dump(signals, f, indent=2)
+```
+
+---
+
+## Step 4 — Extract the Key Error Excerpt
+
+For each failed attempt, extract the most diagnostic ~20 lines to include in
+the report — the traceback tail plus context lines before the final exception.
+
+```python
+def extract_excerpt(text: str, max_lines: int = 20) -> str:
+ lines = text.splitlines()
+ # Find last traceback block
+ tb_start = max(
+ (i for i, l in enumerate(lines) if "Traceback (most recent call last)" in l),
+ default=0
+ )
+ excerpt = lines[tb_start:]
+ return "\n".join(excerpt[-max_lines:])
+
+
+excerpts = {}
+for err in all_errors:
+ excerpts[err["id"]] = extract_excerpt(err["text"])
+
+with open("error_excerpts.json", "w") as f:
+ json.dump(excerpts, f, indent=2)
+
+print(f"Excerpts saved for {len(excerpts)} failed attempt(s).")
+```
+
+---
+
+## Output
+
+| File | Contents |
+|------|----------|
+| `routing_signals.json` | Machine-readable signals for orchestrator routing |
+| `error_excerpts.json` | Key traceback excerpts per attempt |
+| `prior_art.json` | Recent git commits that fixed similar problems (empty list if none found) |
+
+Key signal fields consumed by orchestrator:
+
+| Signal | Meaning |
+|--------|---------|
+| `error_class` | 11-value taxonomy class |
+| `target_agent` | Recommended first specialist |
+| `requires_optimum_new_arch` | Optimum-Intel must add full model support |
+| `requires_transformers_upgrade` | Transformers version is the root cause |
+| `transformers_override` | Pip install string for git-HEAD transformers |
+| `custom_ops_suspected` | SSM/recurrent ops detected — likely needs `_ov_ops.py` |
+| `is_vlm` | Vision-language model — extra routing needed |
+| `oom_suspected` | OOM hit — suggest int4 or sharded export |
diff --git a/.github/agents-prototype/skills/analyze-and-convert/probe-model.md b/.github/agents-prototype/skills/analyze-and-convert/probe-model.md
new file mode 100644
index 00000000000..dbeee918e6d
--- /dev/null
+++ b/.github/agents-prototype/skills/analyze-and-convert/probe-model.md
@@ -0,0 +1,200 @@
+---
+name: probe-model
+description: Probe a HuggingFace model to collect its full profile — architecture class, parameter count, special requirements, tokenizer type, and known issues — before attempting conversion.
+---
+
+# Skill: Probe Model
+
+**Trigger:** Always the first step in the `analyze-and-convert` workflow.
+Produces `model_profile.json` and `probe_report.md`, consumed by all subsequent skills.
+
+---
+
+## Step 1 — Fetch HuggingFace Metadata
+
+```python
+import json, requests
+
+MODEL_ID = "<model_id>"
+HF_API = "https://huggingface.co/api/models"
+
+# Model card / metadata
+resp = requests.get(f"{HF_API}/{MODEL_ID}", timeout=30)
+meta = resp.json() if resp.ok else {}
+
+print("pipeline_tag :", meta.get("pipeline_tag"))
+print("library_name :", meta.get("library_name"))
+print("tags :", meta.get("tags", []))
+print("card_data :", json.dumps(meta.get("cardData", {}), indent=2))
+```
+
+## Step 2 — Load and Inspect Config
+
+```python
+from transformers import AutoConfig
+
+cfg = AutoConfig.from_pretrained(MODEL_ID, trust_remote_code=False)
+cfg_dict = cfg.to_dict()
+
+print("model_type :", cfg.model_type)
+print("architectures :", cfg.architectures)
+print("hidden_size :", getattr(cfg, "hidden_size", "N/A"))
+print("num_hidden_layers :", getattr(cfg, "num_hidden_layers", "N/A"))
+print("num_attention_heads :", getattr(cfg, "num_attention_heads", "N/A"))
+print("num_key_value_heads :", getattr(cfg, "num_key_value_heads", "N/A"))
+print("vocab_size :", getattr(cfg, "vocab_size", "N/A"))
+print("max_position_embeds :", getattr(cfg, "max_position_embeddings", "N/A"))
+
+# Detect special architecture markers
+special_keys = [k for k in cfg_dict if any(kw in k.lower() for kw in [
+ "layer_type", "ssm", "mamba", "rwkv", "moe", "expert", "conv",
+ "recurrent", "delta", "vision", "image", "video", "mm_", "vlm",
+ "audio", "cross_attn", "sliding", "hybrid", "flash", "rope",
+ "alibi", "custom_code",
+])]
+for k in special_keys:
+ print(f" {k}: {cfg_dict[k]}")
+```
+
+## Step 3 — Estimate Parameter Count
+
+```python
+from transformers import AutoConfig
+
+# Rough estimation from config (no weights download needed)
+def estimate_params(cfg):
+ h = getattr(cfg, "hidden_size", 0)
+ layers = getattr(cfg, "num_hidden_layers", 0)
+ vocab = getattr(cfg, "vocab_size", 0)
+ intermediate = getattr(cfg, "intermediate_size", h * 4)
+ heads = getattr(cfg, "num_attention_heads", 1)
+ kv_heads = getattr(cfg, "num_key_value_heads", heads)
+
+ # attn (Q + K + V + O)
+ attn = h * h + (kv_heads * (h // heads)) * 2 * h + h * h
+ # ffn (gate + up + down for LLaMA-style, or 2-linear for BERT-style)
+ ffn = h * intermediate * 3 if hasattr(cfg, "mlp_bias") else h * intermediate * 2
+ # embeddings
+ embed = vocab * h * 2 # input + output (tied)
+ per_layer = attn + ffn
+ total = layers * per_layer + embed
+ return total
+
+cfg = AutoConfig.from_pretrained(MODEL_ID, trust_remote_code=False)
+est = estimate_params(cfg)
+print(f"Estimated params: ~{est/1e9:.1f}B")
+```
+
+## Step 4 — Check trust_remote_code Requirement
+
+```python
+# Try loading without trust_remote_code first
+try:
+ from transformers import AutoConfig
+ AutoConfig.from_pretrained(MODEL_ID, trust_remote_code=False)
+ trust_remote_code_required = False
+except Exception as e:
+ if "trust_remote_code" in str(e) or "custom code" in str(e).lower():
+ trust_remote_code_required = True
+ else:
+ trust_remote_code_required = False # different error
+print("trust_remote_code required:", trust_remote_code_required)
+```
+
+## Step 5 — Inspect Tokenizer Config
+
+```python
+from transformers import AutoTokenizer
+import json
+
+try:
+ tok = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
+ print("tokenizer_class :", type(tok).__name__)
+ print("is_fast :", tok.is_fast)
+ print("vocab_size :", tok.vocab_size)
+ print("chat_template :", "present" if tok.chat_template else "absent")
+except Exception as e:
+ print(f"Tokenizer load error: {e}")
+```
+
+## Step 6 — Detect Multimodal / VLM Signals
+
+```python
+from transformers import AutoConfig
+
+cfg = AutoConfig.from_pretrained(MODEL_ID, trust_remote_code=True)
+
+vlm_signals = {
+ "vision_config": hasattr(cfg, "vision_config"),
+ "image_token_id": hasattr(cfg, "image_token_id"),
+ "video_token_id": hasattr(cfg, "video_token_id"),
+ "mm_projector": hasattr(cfg, "mm_projector_type"),
+ "audio_config": hasattr(cfg, "audio_config"),
+}
+is_vlm = any(vlm_signals.values())
+print("VLM signals:", vlm_signals)
+print("Is VLM:", is_vlm)
+```
+
+## Step 7 — Check optimum-intel Support
+
+```python
+from optimum.exporters.tasks import TasksManager
+
+model_type = cfg.model_type
+try:
+ supported_tasks = TasksManager.get_supported_tasks_for_model_type(
+ model_type, "openvino"
+ )
+ print(f"optimum-intel knows model_type='{model_type}': YES")
+ print("Supported tasks:", supported_tasks)
+ optimum_supported = True
+except KeyError:
+ print(f"optimum-intel does NOT know model_type='{model_type}'")
+ optimum_supported = False
+```
+
+## Step 8 — Write model_profile.json
+
+```python
+import json
+
+profile = {
+ "model_id": MODEL_ID,
+ "model_type": cfg.model_type,
+ "architectures": cfg.architectures,
+ "pipeline_tag": meta.get("pipeline_tag"),
+ "library_name": meta.get("library_name"),
+ "estimated_params_b": round(est / 1e9, 1),
+ "hidden_size": getattr(cfg, "hidden_size", None),
+ "num_layers": getattr(cfg, "num_hidden_layers", None),
+ "vocab_size": getattr(cfg, "vocab_size", None),
+ "trust_remote_code_required": trust_remote_code_required,
+ "is_vlm": is_vlm,
+ "vlm_signals": vlm_signals,
+ "optimum_supported": optimum_supported,
+ "special_config_keys": special_keys,
+ "hf_tags": meta.get("tags", []),
+}
+
+with open("model_profile.json", "w") as f:
+ json.dump(profile, f, indent=2)
+
+print("Written: model_profile.json")
+```
+
+## Output
+
+| File | Contents |
+|------|----------|
+| `model_profile.json` | Structured model profile consumed by subsequent skills |
+
+Key fields used downstream:
+
+| Field | Consumed by |
+|-------|-------------|
+| `optimum_supported` | `try-conversion` — decides which export path to use |
+| `trust_remote_code_required` | `try-conversion` — adds flag if needed |
+| `is_vlm` | `classify-failure` — routes to GenAI/VLM specialists |
+| `estimated_params_b` | `build-report` — included in diagnostics for orchestrator |
+| `special_config_keys` | `classify-failure` — identifies SSM/MoE/recurrent patterns |
diff --git a/.github/agents-prototype/skills/analyze-and-convert/try-conversion.md b/.github/agents-prototype/skills/analyze-and-convert/try-conversion.md
new file mode 100644
index 00000000000..36486b96d8e
--- /dev/null
+++ b/.github/agents-prototype/skills/analyze-and-convert/try-conversion.md
@@ -0,0 +1,281 @@
+---
+name: try-conversion
+description: Attempt model export to OpenVINO IR using a systematic strategy matrix. Tries multiple weight formats, optimum-intel versions, and flag combinations. Records every attempt with full output.
+---
+
+# Skill: Try Conversion
+
+**Trigger:** Called after `probe-model` produces `model_profile.json`.
+Uses the profile to select and execute the right strategy matrix.
+
+---
+
+## Prerequisites
+
+```bash
+# Isolated venv per conversion session
+python -m venv venv-convert
+source venv-convert/bin/activate # Linux/macOS
+# or: venv-convert\Scripts\activate # Windows
+
+pip install -q openvino optimum[openvino] huggingface_hub
+```
+
+Load profile:
+```python
+import json
+with open("model_profile.json") as f:
+ profile = json.load(f)
+
+MODEL_ID = profile["model_id"]
+TRUST_RC = profile["trust_remote_code_required"]
+IS_VLM = profile["is_vlm"]
+OPTIMUM_SUPPORTED = profile["optimum_supported"]
+```
+
+---
+
+## Step 1 — Determine Task
+
+```python
+# Resolve pipeline_tag → optimum-cli export task
+from transformers import AutoConfig
+
+PIPELINE_TAG_MAP = {
+ "text-generation": "text-generation-with-past",
+ "text2text-generation": "text2text-generation-with-past",
+ "image-text-to-text": "image-text-to-text",
+ "text-classification": "text-classification",
+ "token-classification": "token-classification",
+ "question-answering": "question-answering",
+ "feature-extraction": "feature-extraction",
+ "fill-mask": "fill-mask",
+ "text-to-image": "text-to-image",
+ "image-to-text": "image-to-text",
+ "automatic-speech-recognition": "automatic-speech-recognition",
+ "audio-classification": "audio-classification",
+ "zero-shot-image-classification": "zero-shot-image-classification",
+}
+try:
+ cfg = AutoConfig.from_pretrained(MODEL_ID, trust_remote_code=True)
+ pipeline_tag = getattr(cfg, "pipeline_tag", None)
+ if pipeline_tag is None:
+ model_type = getattr(cfg, "model_type", "")
+ task = "text2text-generation-with-past" if model_type in ("t5", "mt5", "bart", "mbart") else "text-generation-with-past"
+ else:
+ task = PIPELINE_TAG_MAP.get(pipeline_tag, pipeline_tag)
+except Exception:
+ task = "text-generation-with-past"
+print(f"Resolved task: {task}")
+```
+
+---
+
+## Step 2 — Build Strategy Matrix
+
+Each strategy is a dict of `optimum-cli` flags to try.
+Ordered from fastest/cheapest to most permissive.
+
+```python
+strategies = []
+
+# Base flags shared by all strategies
+base = {
+ "--model": MODEL_ID,
+ "--task": task,
+ "--output": "ov_model",
+}
+if TRUST_RC:
+ base["--trust-remote-code"] = ""
+
+# Strategy A: fp16, stable optimum-intel
+strategies.append({
+ "id": "A-fp16-stable",
+ "weight_format": "fp16",
+ "optimum_version": "stable", # current installed
+ "extra_flags": [],
+ "description": "fp16, stable optimum-intel",
+})
+
+# Strategy B: int8 symmetric, stable (lighter on memory)
+strategies.append({
+ "id": "B-int8-stable",
+ "weight_format": "int8",
+ "optimum_version": "stable",
+ "extra_flags": [],
+ "description": "int8, stable optimum-intel",
+})
+
+# Strategy C: fp16, optimum-intel git-HEAD
+strategies.append({
+ "id": "C-fp16-gitHEAD",
+ "weight_format": "fp16",
+ "optimum_version": "git+https://github.com/huggingface/optimum-intel.git",
+ "extra_flags": [],
+ "description": "fp16, optimum-intel git-HEAD",
+})
+
+# Strategy D: int4 AWQ (if model is large — > 7B)
+if profile.get("estimated_params_b", 0) > 7:
+ strategies.append({
+ "id": "D-int4-awq-gitHEAD",
+ "weight_format": "int4",
+ "optimum_version": "git+https://github.com/huggingface/optimum-intel.git",
+ "extra_flags": ["--ratio", "1.0", "--group-size", "128"],
+ "description": "int4 AWQ, optimum-intel git-HEAD (large model)",
+ })
+
+# Strategy E: transformers override (if git-HEAD also fails, try pinning to latest pre-release)
+strategies.append({
+ "id": "E-fp16-transformers-pre",
+ "weight_format": "fp16",
+ "optimum_version": "git+https://github.com/huggingface/optimum-intel.git",
+ "extra_flags": [],
+ "description": "fp16, git-HEAD + transformers pre-release",
+ "transformers_override": "git+https://github.com/huggingface/transformers.git",
+})
+```
+
+---
+
+## Step 3 — Run Each Strategy
+
+```python
+import os, subprocess, sys, time, shutil, json
+
+attempts = []
+
+for s in strategies:
+ print(f"\n{'='*60}")
+ print(f"Strategy {s['id']}: {s['description']}")
+ print(f"{'='*60}")
+
+ # Fresh output dir per attempt
+ out_dir = f"ov_model_{s['id']}"
+ if os.path.exists(out_dir):
+ shutil.rmtree(out_dir)
+
+ # Install required optimum-intel version if different
+ if s["optimum_version"] != "stable":
+ subprocess.run(
+ [sys.executable, "-m", "pip", "install", "-q", s["optimum_version"]],
+ check=False
+ )
+
+ if s.get("transformers_override"):
+ subprocess.run(
+ [sys.executable, "-m", "pip", "install", "-q", s["transformers_override"]],
+ check=False
+ )
+
+ # Build command
+ cmd = ["optimum-cli", "export", "openvino",
+ "--model", MODEL_ID,
+ "--task", task,
+ "--weight-format", s["weight_format"],
+ "--output", out_dir]
+
+ if TRUST_RC:
+ cmd.append("--trust-remote-code")
+
+ cmd.extend(s.get("extra_flags", []))
+
+ # Run with full output capture
+ t0 = time.time()
+ proc = subprocess.run(cmd, capture_output=True, text=True)
+ elapsed = round(time.time() - t0, 1)
+
+ attempt = {
+ "id": s["id"],
+ "description": s["description"],
+ "command": " ".join(cmd),
+ "returncode": proc.returncode,
+ "elapsed_s": elapsed,
+ "stdout": proc.stdout[-8000:], # cap to last 8 KB
+ "stderr": proc.stderr[-8000:],
+ "success": False,
+ "ir_files": [],
+ }
+
+ if proc.returncode == 0:
+ # Verify IR files were actually produced
+ ir_files = [f for f in os.listdir(out_dir)
+ if f.endswith(".xml") or f.endswith(".bin")]
+ if ir_files:
+ attempt["success"] = True
+ attempt["ir_files"] = ir_files
+ attempt["ir_dir"] = out_dir
+ print(f" SUCCESS in {elapsed}s — IR files: {ir_files}")
+ else:
+ attempt["stderr"] += "\n[No IR files found in output dir despite exit 0]"
+ print(f" EXIT 0 but no IR files produced.")
+ else:
+ print(f" FAILED (rc={proc.returncode}) in {elapsed}s")
+ print(f" Last error: {(proc.stderr or proc.stdout)[-500:]}")
+
+ attempts.append(attempt)
+
+ # Stop on first success
+ if attempt["success"]:
+ print(f"\nFirst successful strategy: {s['id']}")
+ break
+
+# Persist results
+with open("conversion_attempts.json", "w") as f:
+ json.dump(attempts, f, indent=2)
+
+print(f"\nAttempts recorded: {len(attempts)}")
+print(f"Successful: {sum(1 for a in attempts if a['success'])}")
+```
+
+---
+
+## Step 4 — Quick Inference Sanity Check (on success)
+
+Only runs when at least one strategy succeeded.
+
+```python
+import json
+
+with open("conversion_attempts.json") as f:
+ attempts = json.load(f)
+
+winning = next((a for a in attempts if a["success"]), None)
+if not winning:
+ print("No successful conversion — skipping inference check.")
+else:
+ ir_dir = winning["ir_dir"]
+ print(f"Running inference check on: {ir_dir}")
+ try:
+ from optimum.intel import OVModelForCausalLM
+ from transformers import AutoTokenizer
+
+ tok = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=TRUST_RC)
+ model = OVModelForCausalLM.from_pretrained(ir_dir, trust_remote_code=TRUST_RC)
+
+ inputs = tok("Hello, world!", return_tensors="pt")
+ out = model.generate(**inputs, max_new_tokens=10)
+ generated = tok.decode(out[0], skip_special_tokens=True)
+ print(f"Inference OK: '{generated}'")
+ winning["inference_ok"] = True
+ winning["inference_sample"] = generated
+ except Exception as e:
+ print(f"Inference check failed: {e}")
+ winning["inference_ok"] = False
+ winning["inference_error"] = str(e)
+
+ with open("conversion_attempts.json", "w") as f:
+ json.dump(attempts, f, indent=2)
+```
+
+---
+
+## Output
+
+| File | Contents |
+|------|----------|
+| `conversion_attempts.json` | All strategy attempts with commands, full stdout/stderr, success flag, IR file list |
+| `ov_model_<strategy_id>/` | IR files from the first successful strategy (if any) |
+
+If **no strategy succeeded**, `conversion_attempts.json` contains the complete
+failure evidence for `classify-failure` to analyse.
diff --git a/.github/agents-prototype/skills/conversion-issues/SKILL.md b/.github/agents-prototype/skills/conversion-issues/SKILL.md
new file mode 100644
index 00000000000..658f4c0e7c9
--- /dev/null
+++ b/.github/agents-prototype/skills/conversion-issues/SKILL.md
@@ -0,0 +1,31 @@
+---
+name: conversion-issues
+description: Investigate and fix model conversion issues in OpenVINO Frontends (ONNX, PyTorch) — triage, debugging, accuracy comparison, and pre-submission verification.
+---
+
+# Agent Skill: Investigate and Fix Frontend Conversion Issues
+
+## Goal
+Diagnose and fix issues where models fail to convert to OpenVINO IR or produce incorrect inference results through an OpenVINO frontend.
+
+## Framework-Specific Workflows
+
+Each frontend has its own detailed investigation workflow. Read the one matching the target framework:
+
+| Frontend | Skill file | What it covers |
+|---|---|---|
+| **ONNX** | [onnx.md](onnx.md) | Triage (unsupported op / conversion bug / shape-type / opset gap), ORT baseline comparison, translator debugging, `.prototxt` test models, C++ GTest, pre-submission checklist |
+| **PyTorch** | [pytorch.md](pytorch.md) | Triage (unsupported op / tracing mode / inplace / normalize-step), TorchScript vs torch.export identification, layer test debugging, pre-submission checklist |
+
+## Related Skills (adding new ops)
+
+| Frontend | Skill file | When to use |
+|---|---|---|
+| ONNX | [add-fe-op/onnx.md](../add-fe-op/onnx.md) | Implementing a new ONNX op translator from scratch |
+| PyTorch | [add-fe-op/pytorch.md](../add-fe-op/pytorch.md) | Implementing a new PyTorch op translator from scratch |
+
+## Notes
+
+- Always verify the model works with the framework's reference runtime (ONNX Runtime / PyTorch) before investigating OpenVINO code.
+- Prefer minimal, root-cause fixes over broad refactors.
+- Every fix needs a test and must pass the full frontend test suite.
diff --git a/.github/agents-prototype/skills/conversion-issues/onnx.md b/.github/agents-prototype/skills/conversion-issues/onnx.md
new file mode 100644
index 00000000000..ecc536bfba7
--- /dev/null
+++ b/.github/agents-prototype/skills/conversion-issues/onnx.md
@@ -0,0 +1,416 @@
+# Skill: Investigate and Fix ONNX Model Conversion Issues in OpenVINO
+
+---
+
+## 1. Triage — Classify the Failure
+
+Before diving into code, determine which category the issue falls into:
+
+| Category | Symptoms |
+|---|---|
+| **Unsupported Op** | Error contains `"Not supported ONNX op"`, `ONNXFrameworkNode`, or `NotSupportedONNXNode`. The ONNX op has no translator registered. |
+| **Op Conversion Bug** | Model converts but inference accuracy is wrong (large numerical diff), or an assertion like `CHECK_VALID_NODE` fires during conversion for a valid model. |
+| **Shape/Type Mismatch** | Runtime errors such as `"Inconsistent element type"`, `"Shape mismatch"`, or partial-shape propagation failures. |
+| **Opset Version Gap** | Error mentions an opset version, or the op was introduced/changed in a newer ONNX opset that OpenVINO hasn't implemented yet. |
+| **External Data / Protobuf** | Errors about missing external weight files or protobuf parsing failures. |
+| **Subgraph / Control Flow** | Errors inside `If`, `Loop`, `Scan` ops that carry sub-graphs. |
+
+### Quick diagnostic commands
+
+```bash
+# Python: attempt conversion and print the error
+python3 -c "
+from openvino import Core
+core = Core()
+try:
+ model = core.read_model('model.onnx')
+ print('Conversion OK, outputs:', [o.any_name for o in model.outputs])
+except Exception as e:
+ print('ERROR:', e)
+"
+
+# Or using convert_model:
+python3 -c "
+from openvino import convert_model
+model = convert_model('model.onnx')
+print([o.any_name for o in model.outputs])
+"
+
+# Inspect ONNX model metadata:
+python3 -c "
+import onnx
+m = onnx.load('model.onnx')
+print('Opset imports:', [(o.domain or 'ai.onnx', o.version) for o in m.opset_import])
+ops = set(n.op_type for n in m.graph.node)
+print('Unique ops:', sorted(ops))
+"
+```
+
+---
+
+## 2. Key Source Locations
+
+All paths are relative to the repository root.
+
+### ONNX Frontend Core
+
+| Path | Description |
+|---|---|
+| `src/frontends/onnx/frontend/src/op/` | **Per-op translators** — one `.cpp` file per ONNX operator. This is where most fixes go. |
+| `src/frontends/onnx/frontend/src/op/com.microsoft/` | Translators for `com.microsoft` domain ops. |
+| `src/frontends/onnx/frontend/src/op/org.openvinotoolkit/` | Translators for custom OpenVINO-specific ops. |
+| `src/frontends/onnx/frontend/src/ops_bridge.cpp` | **Operator registry** — maps `(domain, op_name, opset_version)` → translator function. |
+| `src/frontends/onnx/frontend/src/core/operator_set.hpp` | Defines `ONNX_OP` / `ONNX_OP_M` macros and `Operator` type alias. |
+| `src/frontends/onnx/frontend/src/version_range.hpp` | `VersionRange`, `OPSET_RANGE`, `OPSET_SINCE`, `OPSET_IN` helpers. |
+| `src/frontends/onnx/frontend/src/translate_session.cpp` | Main conversion loop. |
+| `src/frontends/onnx/frontend/src/frontend.cpp` | Entry point for `FrontEnd::convert()`, `load()`, `convert_partially()`. |
+| `src/frontends/onnx/frontend/src/exceptions.hpp` | `CHECK_VALID_NODE` macro and `OnnxNodeValidationFailure` exception. |
+| `src/frontends/onnx/frontend/src/core/node.hpp` | `ov::frontend::onnx::Node` — context object each translator receives. |
+| `src/frontends/onnx/frontend/src/utils/common.hpp` | Shared helpers (`is_input_valid`, `handle_opset6_binary_op`). **Always check here first.** |
+
+### Cross-Frontend Shared Libraries
+
+| Path | Description |
+|---|---|
+| `src/frontends/common_translators/include/common_translators.hpp` | **Reusable translators** shared across ONNX/PyTorch/TF frontends. |
+| `src/frontends/common_translators/src/op/` | Implementation of common translators. |
+| `src/frontends/common/include/openvino/frontend/complex_type_mark.hpp` | `ComplexTypeMark` — Mark node for complex number type propagation. |
+| `src/frontends/common/include/openvino/frontend/sequence_mark.hpp` | `SequenceMark` — Mark node for sequence/list type propagation. |
+| `src/frontends/common_translators/include/sequence_concat_replacer.hpp` | Normalize-step transformation example. |
+
+### ONNX Frontend Tests
+
+| Path | Description |
+|---|---|
+| `src/frontends/onnx/tests/onnx_import.in.cpp` | Main C++ import/inference tests (templated per backend). |
+| `src/frontends/onnx/tests/onnx_import_com_microsoft.in.cpp` | Tests for `com.microsoft` domain. |
+| `src/frontends/onnx/tests/onnx_import_controlflow.in.cpp` | Tests for ops with sub-graphs (`If`, `Loop`, `Scan`). |
+| `src/frontends/onnx/tests/onnx_import_convpool.in.cpp` | Convolution and pooling op tests. |
+| `src/frontends/onnx/tests/models/` | `.prototxt` test model definitions. |
+
+### Build Targets
+
+| Target | What it builds |
+|---|---|
+| `openvino_onnx_frontend` | The ONNX frontend shared library. |
+| `ov_onnx_frontend_tests` | C++ unit/import tests. |
+
+---
+
+## 3. Investigation Workflow
+
+### Step 0: Check if the model works with ONNX Runtime (CPU provider)
+
+```python
+import numpy as np
+import onnxruntime as ort
+import onnx
+
+model = onnx.load("model.onnx")
+opset_versions = [(o.domain or "ai.onnx", o.version) for o in model.opset_import]
+print(f"Opset imports: {opset_versions}")
+
+try:
+ sess = ort.InferenceSession("model.onnx", providers=["CPUExecutionProvider"])
+ inputs = {}
+ for inp in sess.get_inputs():
+ shape = [d if isinstance(d, int) else 1 for d in inp.shape]
+ inputs[inp.name] = np.random.randn(*shape).astype(np.float32)
+ result = sess.run(None, inputs)
+ print(f"ORT inference OK, {len(result)} outputs")
+except Exception as e:
+ print(f"ORT inference FAILED: {e}")
+```
+
+**Decision based on ORT result:**
+
+| ORT Result | Model Age | Action |
+|---|---|---|
+| **ORT fails** | Old model (opset ≤ 9) | Ask the user to consider not supporting this model. |
+| **ORT fails** | Newer model (opset ≥ 13) | The model may be corrupted. Ask user to verify with `onnx.checker.check_model()`. |
+| **ORT succeeds** | Any | Valid model — the issue is in OpenVINO's ONNX frontend. |
+
+### Step 1: Reproduce the failure
+
+```bash
+python3 -c "
+from openvino import Core
+import numpy as np
+core = Core()
+model = core.read_model('model.onnx')
+compiled = core.compile_model(model, 'CPU')
+result = compiled(np.zeros((1, 3, 224, 224), dtype=np.float32))
+print('Output shapes:', {k: v.shape for k, v in result.items()})
+"
+```
+
+### Step 2: Identify the failing op
+
+```bash
+python3 -c "
+import onnx
+m = onnx.load('model.onnx')
+for n in m.graph.node:
+ print(f'{n.op_type} (domain={n.domain or \"ai.onnx\"})')
+" | sort | uniq -c | sort -rn
+```
+
+If the error names the op, skip to Step 3. Otherwise use partial conversion:
+
+```bash
+python3 -c "
+from openvino.frontend import FrontEndManager
+from openvino import serialize
+fem = FrontEndManager()
+fe = fem.load_by_framework('onnx')
+model = fe.load('model.onnx')
+ov_model = fe.convert_partially(model)
+serialize(ov_model, '/tmp/partial.xml')
+"
+grep -i 'framework\|not.supported' /tmp/partial.xml
+```
+
+### Step 3: Check if the op has a translator
+
+```bash
+# Example: looking for "Resize"
+grep -rn 'ONNX_OP.*"Resize"' src/frontends/onnx/frontend/src/op/
+```
+
+- No result → **unsupported op** → see [add-fe-op/onnx.md](../add-fe-op/onnx.md)
+- Found → **existing translator** → go to Section 5 (Fixing an Existing Op)
+
+Check the registered opset range:
+
+```bash
+grep -n 'ONNX_OP' src/frontends/onnx/frontend/src/op/resize.cpp
+```
+
+### Step 4: Examine the translator code
+
+```bash
+cat src/frontends/onnx/frontend/src/op/<op_name>.cpp
+```
+
+Cross-reference with the [ONNX operator spec](https://onnx.ai/onnx/operators/) to check:
+- Are all attributes handled with correct defaults per the ONNX spec?
+- Are optional inputs guarded with `common::is_input_valid(node, index)`?
+- Are edge cases covered (empty tensors, scalar inputs, negative indices)?
+- Does the opset version introduce new attributes or behavior changes?
+
+### Step 5: Check existing tests
+
+```bash
+grep -rn '<op_name>' src/frontends/onnx/tests/onnx_import*.in.cpp
+grep -rn '<op_name>' src/frontends/onnx/tests/models/*.prototxt | head -20
+```
+
+---
+
+## 4. Adding a New Op Translator
+
+For full implementation details, see [add-fe-op/onnx.md](../add-fe-op/onnx.md).
+
+---
+
+## 5. Fixing an Existing Op Translator
+
+### Common fix patterns
+
+#### A. Missing attribute or default value
+
+```cpp
+// BEFORE (crashes if attribute missing):
+const auto axis = node.get_attribute_value<int64_t>("axis");
+
+// AFTER (provide default per ONNX spec):
+const auto axis = node.get_attribute_value<int64_t>("axis", 0);
+```
+
+#### B. Unhandled optional input
+
+```cpp
+#include "utils/common.hpp"
+
+const auto inputs = node.get_ov_inputs();
+if (common::is_input_valid(node, 2)) {
+ const auto& bias = inputs[2];
+ result = std::make_shared<v1::Add>(result, bias);
+}
+```
+
+#### C. Opset version upgrade (new attributes/behavior)
+
+Add a new opset namespace and register it:
+
+```cpp
+namespace opset_18 {
+ov::OutputVector op_name(const ov::frontend::onnx::Node& node) {
+ // Handle new opset-18 attributes/behavior
+}
+ONNX_OP("OpName", OPSET_SINCE(18), ai_onnx::opset_18::op_name);
+} // namespace opset_18
+```
+
+Update the old registration's upper bound:
+
+```cpp
+// Change OPSET_SINCE(11) to OPSET_RANGE(11, 17):
+ONNX_OP("OpName", OPSET_RANGE(11, 17), ai_onnx::opset_11::op_name);
+```
+
+#### D. Shape/Type mismatch
+
+Ensure the translator handles dynamic dimensions, different element types, broadcasting rules per ONNX spec, and scalar vs 1-D tensor differences.
+
+#### E. Numerical accuracy
+
+If inference works but results are wrong:
+1. Isolate the failing op using `onnx.utils.extract_model()`.
+2. Compare per-op outputs between ONNX Runtime and OpenVINO.
+3. Check if OV op semantics differ from ONNX (padding conventions, rounding modes, epsilon placement).
+
+#### F. Multi-op patterns — normalize-step transformations
+
+When a fix requires matching and replacing a pattern of multiple ops:
+1. Write an `ov::pass::MatcherPass` transformation.
+2. Register it in `FrontEnd::normalize()` (in `frontend.cpp`) via the `pass::Manager`.
+3. For cross-frontend transformations, place it in `src/frontends/common_translators/`.
+
+---
+
+## 6. Testing the Fix
+
+```bash
+# Build and run all ONNX frontend tests
+cmake --build build --target ov_onnx_frontend_tests -j$(nproc)
+cd build && ctest -R "ov_onnx_frontend_tests" --output-on-failure -j$(nproc)
+
+# Run a specific test by name pattern
+ctest -R "onnx_model_<test_name>" -V
+```
+
+### Validate with Python comparison
+
+```python
+import numpy as np
+import onnxruntime as ort
+from openvino import Core
+
+sess = ort.InferenceSession("model.onnx")
+ort_inputs = {"input": np.random.randn(1, 3, 224, 224).astype(np.float32)}
+ort_out = sess.run(None, ort_inputs)
+
+core = Core()
+model = core.read_model("model.onnx")
+compiled = core.compile_model(model, "CPU")
+ov_out = compiled(ort_inputs)
+
+for i, (ref, ov_val) in enumerate(zip(ort_out, ov_out.values())):
+ max_diff = np.abs(ref - ov_val).max()
+ print(f"Output {i}: max_diff={max_diff:.6e}, allclose={np.allclose(ref, ov_val, atol=1e-5, rtol=1e-5)}")
+```
+
+---
+
+## 7. Debugging Techniques
+
+### Enable ONNX frontend verbose logging
+
+```bash
+export OV_LOG_LEVEL=DEBUG
+python3 -c "from openvino import Core; Core().read_model('model.onnx')"
+```
+
+### Inspect the model graph post-conversion
+
+```python
+from openvino import Core, serialize
+
+core = Core()
+model = core.read_model("model.onnx")
+for op in model.get_ordered_ops():
+ print(f"{op.get_type_name()} '{op.get_friendly_name()}' "
+ f"inputs={[str(i.get_partial_shape()) for i in op.inputs()]} "
+ f"outputs={[str(o.get_partial_shape()) for o in op.outputs()]}")
+serialize(model, "/tmp/model.xml", "/tmp/model.bin")
+```
+
+### Use partial conversion to find unconverted ops
+
+```python
+from openvino.frontend import FrontEndManager
+
+fem = FrontEndManager()
+fe = fem.load_by_framework("onnx")
+input_model = fe.load("model.onnx")
+partial_model = fe.convert_partially(input_model)
+
+for op in partial_model.get_ordered_ops():
+ if "FrameworkNode" in op.get_type_name():
+ attrs = op.get_attrs()
+ print(f"UNCONVERTED: {attrs.get('ONNX_META_type', '?')} domain={attrs.get('ONNX_META_domain', '')}")
+```
+
+### Extract a minimal failing subgraph
+
+```python
+import onnx
+
+model = onnx.load("model.onnx")
+model = onnx.shape_inference.infer_shapes(model)
+onnx.utils.extract_model("model.onnx", "submodel.onnx",
+ input_names=["input_tensor_name"],
+ output_names=["problematic_op_output_name"])
+```
+
+### GDB debugging for C++ translator issues
+
+```bash
+cmake --preset debug
+cmake --build build --target ov_onnx_frontend_tests -j$(nproc)
+gdb --args ./build/bin/ov_onnx_frontend_tests --gtest_filter="*onnx_model_test_name*"
+# (gdb) break resize.cpp:65
+# (gdb) run
+```
+
+---
+
+## 8. Checklist Before Submitting a Fix
+
+- [ ] **Root cause identified** — the specific ONNX spec requirement that was violated or missing.
+- [ ] **Minimal code change** — only translator file(s) and test(s) are modified.
+- [ ] **Test model added** — `.prototxt` in `src/frontends/onnx/tests/models/` exercising the fix.
+- [ ] **C++ test added** — in the appropriate `onnx_import*.in.cpp` file.
+- [ ] **Build succeeds** — `cmake --build build --target openvino_onnx_frontend ov_onnx_frontend_tests` completes.
+- [ ] **All ONNX tests pass** — `ctest -R ov_onnx_frontend_tests` shows no regressions.
+- [ ] **clang-format applied** — `cmake --build build --target clang_format_fix_all` run.
+- [ ] **Supported ops doc** — verify `src/frontends/onnx/docs/supported_ops.md` reflects new op.
+- [ ] **Opset range correct** — `ONNX_OP` covers the right version range per ONNX changelog.
+- [ ] **Edge cases** — dynamic shapes, optional inputs, unusual dtypes, scalars handled.
+
+---
+
+## 9. Common Pitfalls
+
+| Pitfall | Explanation |
+|---|---|
+| **Forgetting optional inputs** | Use `common::is_input_valid(node, index)` for all optional input checks. |
+| **Wrong opset version range** | Use `OPSET_RANGE(1, 10)` + `OPSET_SINCE(11)` if spec changed behavior in opset 11. |
+| **Attribute type mismatch** | Using the wrong `get_attribute_value<T>()` silently returns a default. |
+| **Broadcasting assumptions** | OV's Numpy-style broadcasting may differ from ONNX in edge cases. |
+| **Not handling empty tensors** | Some ops may receive 0-element tensors. Ensure no division by size. |
+| **Modifying the wrong opset function** | When fixing for opset 18, create a new function — don't modify the opset 11 one. |
+| **Missing `#include`** | Each OpenVINO op needs its own include (e.g., `#include "openvino/op/add.hpp"`). |
+| **Not checking common_translators** | Check `src/frontends/common_translators/` before writing a new translator. |
+| **Not using Mark operations** | For complex, sequence, or quantized types, use `ComplexTypeMark`/`SequenceMark`. |
+
+---
+
+## 10. Reference Links
+
+- [ONNX Operator Specifications](https://onnx.ai/onnx/operators/)
+- [ONNX Operator Changelog](https://github.com/onnx/onnx/blob/main/docs/Changelog.md)
+- [OpenVINO Available Operations](https://docs.openvino.ai/latest/openvino_docs_ops_opset.html)
+- [OpenVINO ONNX Frontend README](src/frontends/onnx/README.md)
+- [OpenVINO ONNX Supported Ops](src/frontends/onnx/docs/supported_ops.md)
diff --git a/.github/agents-prototype/skills/conversion-issues/pytorch.md b/.github/agents-prototype/skills/conversion-issues/pytorch.md
new file mode 100644
index 00000000000..b3ed213ce5d
--- /dev/null
+++ b/.github/agents-prototype/skills/conversion-issues/pytorch.md
@@ -0,0 +1,359 @@
+# Skill: Investigate and Fix PyTorch Model Conversion Issues in OpenVINO
+
+---
+
+## 1. Triage — Classify the Failure
+
+Before diving into code, determine which category the issue falls into:
+
+| Category | Symptoms |
+|---|---|
+| **Unsupported Op** | Error contains `"No translator found for"`, `PtFrameworkNode` remains in the converted graph, or a `torch.export` op is missing from `get_supported_ops_fx()`. |
+| **Op Conversion Bug** | Model converts but inference accuracy is wrong (large numerical diff vs PyTorch), or `PYTORCH_OP_CONVERSION_CHECK` fires for a valid model. |
+| **Shape/Type Mismatch** | Errors like `"Inconsistent element type"`, `"Shape mismatch"`, or partial-shape propagation failures after conversion. |
+| **Tracing Mode Issue** | Model works with TorchScript but fails with `torch.export` (or vice versa). Op name mappings differ between `get_supported_ops_ts()` and `get_supported_ops_fx()`. |
+| **Inplace Op** | Inplace variant (`aten::add_`, `aten.mul_.Tensor`) is missing or doesn't correctly wrap with `inplace_op<>`. |
+| **Normalize-Step Failure** | Conversion succeeds but a post-conversion transformation in `FrontEnd::normalize()` crashes or produces wrong results. |
+| **Complex / Sequence Type** | Errors related to `ComplexTypeMark` or `SequenceMark` — the Mark operation was not resolved during normalize. |
+
+### Quick diagnostic commands
+
+```bash
+# Attempt conversion and print the error
+python3 -c "
+from openvino import convert_model
+import torch
+
+model = ... # instantiate or load the model
+example_input = torch.randn(1, 3, 224, 224)
+try:
+ ov_model = convert_model(model, example_input=example_input)
+ print('Conversion OK, outputs:', [o.any_name for o in ov_model.outputs])
+except Exception as e:
+ print('ERROR:', e)
+"
+
+# Inspect FX graph ops (torch.export path):
+python3 -c "
+import torch
+from torch.export import export
+model = ...
+em = export(model, (torch.randn(1, 3, 224, 224),))
+for node in em.graph.nodes:
+ if node.op == 'call_function':
+ print(f'{node.target.__name__}')
+" | sort | uniq -c | sort -rn
+```
+
+---
+
+## 2. Key Source Locations
+
+All paths are relative to the repository root.
+
+### PyTorch Frontend Core
+
+| Path | Description |
+|---|---|
+| `src/frontends/pytorch/src/op/` | **Per-op translators** — one `.cpp` file per PyTorch operation. This is where most fixes go. |
+| `src/frontends/pytorch/src/op_table.cpp` | **Operator registry** — `get_supported_ops_ts()` (TorchScript) and `get_supported_ops_fx()` (torch.export/FX). |
+| `src/frontends/pytorch/src/translate_session.cpp` | Main conversion loop. |
+| `src/frontends/pytorch/src/frontend.cpp` | Entry point for `FrontEnd::convert()`, `convert_partially()`, and `normalize()`. |
+| `src/frontends/pytorch/src/utils.hpp` | **Shared helpers** (`num_inputs_check`, `make_optional_bias`, `get_shape_rank`, `normalize_axis`, `numel`, `convert_dtype`, `concat_list_construct`). **Always check here first.** |
+| `src/frontends/pytorch/include/openvino/frontend/pytorch/node_context.hpp` | `NodeContext` class — `get_input()`, `const_input<T>()`, `mark_node()`, `input_is_none()`. |
+| `src/frontends/pytorch/src/pt_framework_node.hpp` | `PtFrameworkNode` — placeholder for unconverted ops. |
+| `src/frontends/pytorch/src/transforms/` | **Normalize-step transformations** — graph passes that run after initial translation. |
+
+### Cross-Frontend Shared Libraries
+
+| Path | Description |
+|---|---|
+| `src/frontends/common_translators/include/common_translators.hpp` | **Reusable translators** shared across frontends. |
+| `src/frontends/common/include/openvino/frontend/complex_type_mark.hpp` | `ComplexTypeMark` — Mark node for complex number type propagation. |
+| `src/frontends/common/include/openvino/frontend/sequence_mark.hpp` | `SequenceMark` — Mark node for sequence/list type propagation. |
+
+### Tests
+
+| Path | Description |
+|---|---|
+| `tests/layer_tests/pytorch_tests/` | **Python layer tests** — one `test_<op>.py` file per operation. Primary test suite. |
+| `tests/layer_tests/pytorch_tests/pytorch_layer_test_class.py` | `PytorchLayerTest` base class. |
+| `tests/model_hub_tests/pytorch/` | Model-level tests for HuggingFace Transformers, TorchVision, etc. |
+
+### Build Targets
+
+| Target | What it builds |
+|---|---|
+| `openvino_pytorch_frontend` | The PyTorch frontend shared library. |
+
+---
+
+## 3. Investigation Workflow
+
+### Step 0: Reproduce the failure and identify the conversion path
+
+| Path | How to identify | Op name format |
+|---|---|---|
+| **TorchScript** (default) | `torch.jit.script()` or `torch.jit.trace()` | `aten::add`, `aten::conv2d` |
+| **torch.export** | `PYTORCH_TRACING_MODE=EXPORT` | `aten.add.Tensor`, `aten.conv2d.default` |
+
+```bash
+# Reproduce with TorchScript (default):
+python3 -c "
+from openvino import convert_model
+import torch
+model = ...
+ov_model = convert_model(model, example_input=torch.randn(1, 3, 224, 224))
+"
+
+# Reproduce with torch.export:
+PYTORCH_TRACING_MODE=EXPORT python3 -c "
+from openvino import convert_model
+import torch
+model = ...
+ov_model = convert_model(model, example_input=torch.randn(1, 3, 224, 224))
+"
+```
+
+### Step 1: Identify the failing op
+
+From the error message, extract the op name (e.g., `aten::grid_sampler` or `aten.grid_sampler_2d.default`).
+
+```bash
+# For TorchScript — list ops in the scripted graph:
+python3 -c "
+import torch
+model = ...
+scripted = torch.jit.script(model)
+for node in scripted.inlined_graph.nodes():
+ print(node.kind())
+" | sort | uniq -c | sort -rn
+```
+
+### Step 2: Check if the op has a translator
+
+```bash
+# TorchScript ops — search in get_supported_ops_ts():
+grep -n '"aten::<op_name>"' src/frontends/pytorch/src/op_table.cpp
+
+# FX/Export ops — search in get_supported_ops_fx():
+grep -n '"aten.<op_name>' src/frontends/pytorch/src/op_table.cpp
+
+# Search for the translator implementation:
+grep -rn 'translate_<op_name>' src/frontends/pytorch/src/op/
+```
+
+- No translator → see [add-fe-op/pytorch.md](../add-fe-op/pytorch.md)
+- Found → go to Section 5 (Fixing an Existing Op)
+
+### Step 3: Examine the translator code
+
+```bash
+cat src/frontends/pytorch/src/op/<op_name>.cpp
+```
+
+Cross-reference with [PyTorch docs](https://pytorch.org/docs/stable/) to check:
+- Are all inputs handled (including optional ones via `input_is_none()`)?
+- Is `num_inputs_check()` called to validate input count?
+- Does the translator call `context.mark_node()` on every created node?
+
+### Step 4: Check existing tests
+
+```bash
+ls tests/layer_tests/pytorch_tests/test_<op_name>.py
+grep -rn '<op_name>' tests/layer_tests/pytorch_tests/ --include="*.py" | head -20
+```
+
+---
+
+## 4. Adding a New Op Translator
+
+For full implementation details, see [add-fe-op/pytorch.md](../add-fe-op/pytorch.md).
+
+---
+
+## 5. Fixing an Existing Op Translator
+
+### Common fix patterns
+
+#### A. Missing or wrong input handling
+
+```cpp
+// BEFORE (crashes if input is None):
+auto bias = context.get_input(2);
+
+// AFTER (check for None inputs):
+if (!context.input_is_none(2)) {
+ auto bias = context.get_input(2);
+ result = context.mark_node(std::make_shared<v1::Add>(result, bias));
+}
+```
+
+#### B. Missing FX/Export variant
+
+1. Find the FX op name:
+```bash
+python3 -c "
+import torch
+from torch.export import export
+em = export(model, (torch.randn(1, 3, 224, 224),))
+for node in em.graph.nodes:
+ if node.op == 'call_function':
+ print(node.target.__name__)
+"
+```
+
+2. Add the FX mapping in `get_supported_ops_fx()` in `op_table.cpp`:
+```cpp
+{"aten.op_name.default", op::translate_op_name},
+```
+
+#### C. Inplace op missing
+
+```cpp
+// In get_supported_ops_ts():
+{"aten::relu_", op::inplace_op<op::translate_1to1_match_1_inputs<opset10::Relu>>},
+// In get_supported_ops_fx():
+{"aten.relu_.default", op::inplace_op<op::translate_1to1_match_1_inputs<opset10::Relu>>},
+```
+
+#### D. Shape/Type mismatch
+
+- Use `align_eltwise_input_types` or `translate_1to1_match_2_inputs_align_types<>` for type alignment.
+- Use `apply_dtype()` when the op needs a specific output dtype.
+
+#### E. Numerical accuracy
+
+```python
+import torch, numpy as np
+from openvino import convert_model, Core
+
+model = ...
+example = torch.randn(1, 3, 224, 224)
+with torch.no_grad():
+ pt_out = model(example)
+
+ov_model = convert_model(model, example_input=example)
+ov_out = Core().compile_model(ov_model, "CPU")(example.numpy())
+
+ref = pt_out.detach().numpy()
+abs_diff = np.abs(ref - list(ov_out.values())[0])
+print(f"max_diff={abs_diff.max():.6e}, allclose={np.allclose(ref, list(ov_out.values())[0], atol=1e-5)}")
+```
+
+**Common accuracy root causes:**
+
+| Cause | Fix |
+|---|---|
+| **Padding convention** | Check ceil_mode, auto-pad, floor/ceil rounding mode differences |
+| **Epsilon placement** | Verify epsilon inside/outside sqrt matches PyTorch behavior |
+| **Type promotion** | PyTorch may upcast to float64 implicitly; OV stays float32 |
+| **Reduction axis** | Check 0-indexed vs negative indexing, keepdims defaults |
+
+#### F. Normalize-step transformation issues
+
+Transformations live in `src/frontends/pytorch/src/transforms/`. Temporarily disable passes to identify which one misbehaves.
+
+---
+
+## 6. Testing
+
+```bash
+# Run tests for a specific op:
+TEST_DEVICE=CPU TEST_PRECISION=FP32 python3 -m pytest tests/layer_tests/pytorch_tests/test_<op_name>.py -v -k "precommit"
+
+# Run with torch.export mode:
+TEST_DEVICE=CPU TEST_PRECISION=FP32 PYTORCH_TRACING_MODE=EXPORT python3 -m pytest tests/layer_tests/pytorch_tests/test_<op_name>.py -v -k "precommit_torch_export"
+```
+
+---
+
+## 7. Debugging Techniques
+
+### Enable frontend verbose logging
+
+```bash
+export OV_LOG_LEVEL=DEBUG
+python3 -c "from openvino import convert_model; import torch; convert_model(model, example_input=torch.randn(1,3,224,224))"
+```
+
+### Inspect the converted graph
+
+```python
+from openvino import convert_model, serialize
+import torch
+
+model = ...
+ov_model = convert_model(model, example_input=torch.randn(1, 3, 224, 224))
+for op in ov_model.get_ordered_ops():
+ print(f"{op.get_type_name()} '{op.get_friendly_name()}'")
+serialize(ov_model, "/tmp/model.xml", "/tmp/model.bin")
+```
+
+### Use partial conversion to find unconverted ops
+
+```python
+from openvino.frontend import FrontEndManager
+import torch
+
+fem = FrontEndManager()
+fe = fem.load_by_framework("pytorch")
+scripted = torch.jit.script(model)
+from openvino.frontend.pytorch.ts_decoder import TorchScriptPythonDecoder
+decoder = TorchScriptPythonDecoder(scripted)
+input_model = fe.load(decoder)
+partial_model = fe.convert_partially(input_model)
+
+for op in partial_model.get_ordered_ops():
+ if "PtFrameworkNode" in op.get_type_name():
+ print(f"UNCONVERTED: {op.get_friendly_name()}")
+```
+
+### GDB debugging
+
+```bash
+cmake -DCMAKE_BUILD_TYPE=Debug ...
+cmake --build build --target openvino_pytorch_frontend -j$(nproc)
+gdb --args python3 -m pytest tests/layer_tests/pytorch_tests/test_where.py -v -k "test_where[zeros-bool]" -s
+# (gdb) break where.cpp:25
+# (gdb) run
+```
+
+---
+
+## 8. Checklist Before Submitting a Fix
+
+- [ ] **Root cause identified** — the specific PyTorch op behavior that was violated or missing.
+- [ ] **Minimal code change** — only translator, op_table, and test files are modified.
+- [ ] **Python layer test added/updated** — in `tests/layer_tests/pytorch_tests/test_<op>.py`.
+- [ ] **Both tracing modes covered** — TorchScript and FX/Export mappings present where applicable.
+- [ ] **Inplace variant handled** — registered with `inplace_op<>`.
+- [ ] **`mark_node()` called** — on every OpenVINO node created in the translator.
+- [ ] **Build succeeds** — `cmake --build build --target openvino_pytorch_frontend` completes.
+- [ ] **Layer tests pass** — both TorchScript and Export modes.
+- [ ] **clang-format applied** — formatting changes committed.
+
+---
+
+## 9. Common Pitfalls
+
+| Pitfall | Explanation |
+|---|---|
+| **Forgetting `mark_node()`** | Every `std::make_shared<...>()` in a translator must be wrapped in `context.mark_node()`. |
+| **Not checking `input_is_none()`** | Optional inputs may be None. Always guard with `context.input_is_none(index)` first. |
+| **TorchScript vs FX name mismatch** | TorchScript uses `aten::op_name`, FX uses `aten.op_name.overload`. Forgetting the FX mapping causes silent `PtFrameworkNode` under `torch.export`. |
+| **Missing inplace wrapper** | Inplace ops need `op::inplace_op<base_translator>`. |
+| **Wrong `const_input<T>()` type** | Produces silent wrong values. Check the PyTorch schema for the exact parameter type. |
+| **Not using `num_inputs_check()`** | Skipping this leads to hard-to-debug out-of-bounds crashes. |
+| **Not checking `common_translators`** | Check `src/frontends/common_translators/` before writing a new translator. |
+| **Dynamic shape assumptions** | Translators must not assume static dimensions. |
+| **Missing pytest marks** | New layer tests need `@pytest.mark.precommit` and `@pytest.mark.precommit_torch_export` for CI. |
+
+---
+
+## 10. Reference Links
+
+- [PyTorch Operator Documentation](https://pytorch.org/docs/stable/torch.html)
+- [torch.export Reference](https://pytorch.org/docs/stable/export.html)
+- [OpenVINO Available Operations](https://docs.openvino.ai/latest/openvino_docs_ops_opset.html)
+- [OpenVINO PyTorch Frontend README](src/frontends/pytorch/README.md)
diff --git a/.github/agents-prototype/skills/new-arch-validation-checklist.md b/.github/agents-prototype/skills/new-arch-validation-checklist.md
new file mode 100644
index 00000000000..0c6d8bf06fd
--- /dev/null
+++ b/.github/agents-prototype/skills/new-arch-validation-checklist.md
@@ -0,0 +1,74 @@
+# New Architecture Validation Checklist
+
+This checklist is for validating enablement of models that introduce architecturally
+novel patterns. Run through every category before submitting a patch or opening a PR.
+
+## How to Use
+
+For each section, mark each item as `PASS`, `FAIL`, or `N/A`.
+
+A PR must have **no FAIL items** before it can be merged.
+
+---
+
+## 1. FP16 / BF16 Precision
+
+- [ ] **Integer indexing paths** — position IDs, sequence indices, attention mask indices are
+ kept in `int32` or `int64` throughout; no cast to FP16/BF16 on index tensors.
+- [ ] **Scale factors** — any scalar multiplier absorbed into a weight matrix via
+ `MatMulMultiplyFusion` has `|scalar| ≤ 1.0` OR the weight dtype is FP32. If `|scalar| > 1.0`
+ AND weight dtype is FP16/BF16 — the fusion must be skipped for that instance.
+- [ ] **Constant tables** — cached trig tables (`cos_cached`, `sin_cached`), embedding lookup
+ tables, and other large constant tensors are stored at the precision required by the op spec,
+ not silently downcast during constant folding.
+- [ ] **Reference comparison** — model inference result with `FP32` and `FP16` differ by no
+ more than the expected numerical tolerance (≤ 1% max absolute difference on representative
+ inputs, or per model card specification).
+
+## 2. Shared KV Cache
+
+- [ ] **ReadValue fan-out** — for every `ReadValue` node that is part of a KV cache:
+ `readvalue->get_output_target_inputs(0).size() == 1`. If `> 1`, the state is shared and
+ any fusion or folding pass that assumes 1-to-1 state ownership MUST be skipped.
+- [ ] **Assign pairing** — each `ReadValue` has exactly one corresponding `Assign` that writes
+ to the same state variable. If `> 1` Assigns write to the same state — this is a model
+ defect; file a bug before proceeding.
+- [ ] **StatefulSDPAFusion guard** — the `StatefulSDPAFusion` pass is guarded against shared KV
+ cache; a shared `ReadValue` causes `return false` from the callback, not a fusion.
+- [ ] **NPUW fold idempotency** — any weight-folding pass that touches state-connected nodes
+ is tagged (e.g. `FoldedTag`) after the first application and skipped on re-application.
+
+## 3. Novel Tensor Types
+
+- [ ] **ONNX SequenceMark invariant** — every op that produces a sequence output wraps it in
+ `ov::frontend::SequenceMark` at the point of creation in the translator.
+ No downstream transformation receives a bare sequence node without `SequenceMark`.
+- [ ] **Mark operations** — `ComplexTypeMark`, `SequenceMark`, and similar wrappers are used
+ for all special tensor types; the normalize-step transformation resolves them before
+ plugin execution.
+- [ ] **per_layer_inputs** — genuinely novel tensor types that cannot be expressed via existing
+ OV ops are registered as `per_layer_inputs` in NPUW partition metadata; they are NOT handled
+ by adding special cases to the main inference path.
+
+## 4. IR Correctness
+
+- [ ] **Op spec compliance** — every new op's output shapes and types match the published op spec
+ in `docs/articles_en/documentation/openvino-ir-format/operation-sets/`.
+- [ ] **No `PtFrameworkNode` in converted graph** — the final OV IR contains no unresolved
+ framework nodes (ONNX: no `ONNXFrameworkNode`; PyTorch: no `PtFrameworkNode`).
+- [ ] **clang-format** — all changed `.hpp` / `.cpp` files pass `clang-format` with
+ `src/.clang-format` config.
+- [ ] **clang-tidy** — no new warnings or errors introduced in changed files.
+
+## 5. Test Coverage
+
+- [ ] **Positive test** — a test that exercises the exact new op/transformation and verifies
+ the expected output node appears in the resulting graph.
+- [ ] **Negative test** — a test that exercises a non-matching input graph and verifies the
+ transformation does NOT fire (graph unchanged).
+- [ ] **Nightly coverage** — new op translators have at least one test marked for nightly/regression
+ mode, not only `@pytest.mark.precommit`.
+- [ ] **Accuracy regression test** — if the fix addresses an accuracy issue, a test that
+ directly reproduces the failing scenario is included in the patch.
+- [ ] **No disabled tests** — no tests are skipped or disabled without a documented reason
+ (`pytest.mark.skip(reason=...)` or `GTEST_SKIP()` with a GitHub issue reference).
diff --git a/.github/agents-prototype/skills/python-bootstrap/SKILL.md b/.github/agents-prototype/skills/python-bootstrap/SKILL.md
new file mode 100644
index 00000000000..a833065dbb9
--- /dev/null
+++ b/.github/agents-prototype/skills/python-bootstrap/SKILL.md
@@ -0,0 +1,67 @@
+---
+name: python-bootstrap
+description: Install Python dependencies before running verification or test steps. Choose the correct path depending on whether the agent builds OpenVINO from source or not.
+---
+
+# Skill: Python Package Bootstrap
+
+Install packages **only when they are actually needed** for a step. Do not
+pre-install everything upfront.
+
+---
+
+## Path A — No source build (core-opspec, transformation, frontend, npu)
+
+Use this path when the agent **does not** compile OpenVINO from source.
+The `openvino` release wheel provides the runtime needed for tests and
+conversion checks.
+
+```bash
+pip install openvino optimum-intel torch \
+ --extra-index-url https://download.pytorch.org/whl/cpu
+```
+
+For frontend agents that also need ONNX or TensorFlow:
+```bash
+pip install onnx onnxruntime
+pip install tensorflow # only if testing TF frontend
+```
+
+---
+
+## Path B — Source build (cpu, gpu)
+
+Use this path when the agent **builds OpenVINO from source**.
+
+> **Do NOT `pip install openvino`** when a source build is present in the
+> same environment. Installing the release wheel alongside a dev build creates
+> two `openvino` packages that shadow each other, producing confusing import
+> errors and incorrect test results.
+
+Install only the packages that are **not** produced by the OV build:
+
+```bash
+pip install torch \
+ --extra-index-url https://download.pytorch.org/whl/cpu
+pip install optimum-intel pytest
+# Do NOT add 'openvino' here — use the build output instead
+```
+
+After building OpenVINO, add the build's Python bindings to the path:
+
+```bash
+# Point Python at the locally built openvino package
+export PYTHONPATH="<build_dir>/src/bindings/python:$PYTHONPATH"
+# or install the wheel produced by the build
+pip install <build_dir>/wheels/openvino-*.whl
+```
+
+---
+
+## General rules
+
+- Install packages **on demand** per step, not all at once.
+- If a package install fails, note it in `agent-results/<agent>/session.md`
+ and continue — do not abort the entire pipeline over a missing optional dep.
+- Never install from untrusted or unofficial indexes beyond the PyTorch
+ CPU wheel server listed above.
diff --git a/.github/agents-prototype/skills/submit-draft-pr/SKILL.md b/.github/agents-prototype/skills/submit-draft-pr/SKILL.md
new file mode 100644
index 00000000000..1921cdd0715
--- /dev/null
+++ b/.github/agents-prototype/skills/submit-draft-pr/SKILL.md
@@ -0,0 +1,162 @@
+---
+name: submit-draft-pr
+description: Optionally create a draft PR to the upstream repo from a local source directory. Used by coding agents when a local source path is available in the context file.
+---
+
+# Skill: Submit Draft PR
+
+> **Optional.** Attempt this only when all of the following are true:
+> - Your context file provides a local source path (e.g. `OpenVINO source code: /path/to/openvino`)
+> - That path is accessible and is a git repository
+> - `gh` CLI is available and authenticated (`gh auth status`)
+>
+> If any condition is not met — **skip silently** and log one line. Do not fail.
+
+---
+
+## When to invoke
+
+After completing your main implementation work and writing results to
+`agent-results/<agent>/`, call this skill to open a **draft PR** from your
+changes to the upstream repo.
+
+This is *in addition to* — never instead of — generating patch files and
+writing results to `agent-results/`.
+
+---
+
+## Steps
+
+### 1. Verify prerequisites
+
+```bash
+# Is gh available and authenticated?
+gh auth status || { echo "[draft-pr] gh not available — skipping"; exit 0; }
+
+# Is the source path a git repo?
+[ -d "${SOURCE_PATH}/.git" ] || { echo "[draft-pr] ${SOURCE_PATH} is not a git repo — skipping"; exit 0; }
+```
+
+### 2. Choose a branch name
+
+Use a descriptive kebab-case branch name derived from the work done:
+
+```
+agent/add-<op-name>-op # core op or FE op
+agent/add-<pass-name>-transformation
+agent/<model-id>-export # optimum-intel / tokenizers
+agent/<component>-<short-desc> # general
+```
+
+### 3. Check for an existing PR
+
+Before creating a new PR, check whether one already exists from the same branch to avoid duplicates:
+
+```bash
+BRANCH="agent/<descriptive-name>"
+EXISTING=$(gh pr list \
+ --repo openvinotoolkit/openvino \
+ --head "$(gh api user -q .login):$BRANCH" \
+ --json url -q '.[0].url' 2>/dev/null)
+if [ -n "$EXISTING" ]; then
+ echo "[draft-pr] PR already exists: $EXISTING — skipping creation"
+ exit 0
+fi
+```
+
+If a PR exists, log the URL and stop — do **not** open a second one.
+
+### 4. Compose the PR body
+
+Every agent-generated PR **must** open with the following notice block (exact
+wording, first lines of the body before any other content):
+
+```markdown
+> [!IMPORTANT]
+> **This PR was generated by a Copilot coding agent and requires human review.**
+> A maintainer must inspect the changes, run the relevant tests locally, and
+> convert this draft to "Ready for review" only after verifying correctness.
+> Do **not** merge without human sign-off.
+```
+
+After the notice, follow the upstream `pull_request_template.md` structure:
+
+```markdown
+> [!IMPORTANT]
+> **This PR was generated by a Copilot coding agent and requires human review.**
+> A maintainer must inspect the changes, run the relevant tests locally, and
+> convert this draft to "Ready for review" only after verifying correctness.
+> Do **not** merge without human sign-off.
+
+### Details:
+ - <what was changed and why>
+ - Agent: <agent-name>
+ - Model tested: <model-id or N/A>
+ - Operator: <op-name or N/A>
+
+### Tickets:
+ - <linked issue URL or N/A>
+
+### AI Assistance:
+ - AI assistance used: yes
+ - Generated by GitHub Copilot agent (`<agent-name>`). Human validation required:
+ build verification, unit/functional tests, and inference sanity check.
+```
+
+Write this body to `agent-results/<agent>/pr_body.md` before calling `gh pr create`.
+
+### 5. Create branch, commit, and open draft PR
+
+```bash
+cd <source_path>
+BRANCH="fix/<descriptive-name>"
+git checkout -b "$BRANCH"
+git add -A
+git commit -m "<one-line description>"
+gh repo fork openvinotoolkit/openvino --clone=false 2>/dev/null || true
+git remote add fork "$(gh repo view "$(gh api user -q .login)/openvino" --json sshUrl -q .sshUrl)" 2>/dev/null || true
+git push fork "$BRANCH"
+gh pr create --draft \
+ --repo openvinotoolkit/openvino \
+ --head "$(gh api user -q .login):$BRANCH" \
+ --title "<one-line description>" \
+ --body-file agent-results/<agent>/pr_body.md
+```
+
+### 6. Log the result
+
+After the script runs, record the outcome in `agent-results/<agent>/session.md`:
+
+```
+[draft-pr] PR opened: <pr_url>
+```
+
+or
+
+```
+[draft-pr] Skipped: <reason>
+```
+
+---
+
+## Per-repo upstream table
+
+| Agent | Upstream repo |
+|---|---|
+| transformation, core-opspec, pytorch-fe, cpu, gpu, npu | `openvinotoolkit/openvino` |
+| optimum-intel | `huggingface/optimum-intel` |
+| openvino-tokenizers | `openvinotoolkit/openvino_tokenizers` |
+| openvino-genai | `openvinotoolkit/openvino.genai` |
+
+Pass `--upstream <value>` only when auto-detection from the git remote is likely
+to fail (e.g. the local clone uses an internal mirror URL).
+
+---
+
+## Important constraints
+
+- Always create PRs as **drafts** — never ready-for-review.
+- PR target is the **upstream** repo, not the fork.
+- Do not push to `main`/`master` of any repo.
+- If `git push --force-with-lease` fails (e.g. diverged history), skip and log — do not `--force`.
+- Do not block the agent's completion on PR success — log the failure and continue.
diff --git a/.github/agents-prototype/skills/verify-conversion/SKILL.md b/.github/agents-prototype/skills/verify-conversion/SKILL.md
new file mode 100644
index 00000000000..52e7d37f753
--- /dev/null
+++ b/.github/agents-prototype/skills/verify-conversion/SKILL.md
@@ -0,0 +1,216 @@
+---
+name: verify-conversion
+description: E2E gate — verifies that applied patches produce a working, numerically sane end-to-end inference through the OpenVINO plugin. Handles HuggingFace/optimum-intel, native OV conversion (ovc/convert_model), and ONNX. Used by orchestrators as the mandatory gate before any PR is published.
+---
+
+# Skill: Verify Conversion (E2E Gate)
+
+> **This skill is a hard gate before PR publication.**
+> A PR must **not** be opened until both steps below pass:
+> 1. The model converts without error.
+> 2. A real end-to-end inference through the OV plugin layer produces numerically
+> sane output (no NaN/Inf, non-empty, correct shape).
+>
+> Conversion success alone is not sufficient — plugin-level issues (wrong kernel
+> output, silent data corruption, incorrect type/shape inference at runtime) are
+> only caught by an actual inference run.
+
+This is **not** a full strategy matrix run — use `try-conversion.md` skill for that.
+
+Goal: one conversion, one inference run, numerical sanity check, structured result.
+
+---
+
+## Step 1 — Determine conversion path
+
+Read `agent-results/pipeline_state.json` (or context file) to identify:
+
+| Signal | Conversion path |
+|---|---|
+| `model_id` starts with `org/name` (HuggingFace ID) AND `optimum_supported=true` | **Path A** — `optimum-cli` |
+| `model_id` is a local path with `.onnx` file | **Path B** — OV native (`ovc` / `convert_model`) |
+| `model_id` is a local PyTorch model or `.pt` / `.pth` file | **Path B** — OV native (`convert_model`) |
+| `model_id` is a local TF SavedModel or `.pb` file | **Path B** — OV native (`ovc`) |
+| Unclear | Try Path A first, fall back to Path B on failure |
+
+---
+
+## Path A — HuggingFace model via optimum-intel
+
+### Auto-detect task
+
+```python
+from transformers import AutoConfig
+
+PIPELINE_TAG_MAP = {
+ "text-generation": "text-generation-with-past",
+ "text2text-generation": "text2text-generation-with-past",
+ "image-text-to-text": "image-text-to-text",
+ "text-classification": "text-classification",
+ "token-classification": "token-classification",
+ "question-answering": "question-answering",
+ "feature-extraction": "feature-extraction",
+ "fill-mask": "fill-mask",
+ "text-to-image": "text-to-image",
+ "image-to-text": "image-to-text",
+ "automatic-speech-recognition": "automatic-speech-recognition",
+ "audio-classification": "audio-classification",
+}
+try:
+ cfg = AutoConfig.from_pretrained(MODEL_ID, trust_remote_code=True)
+ pipeline_tag = getattr(cfg, "pipeline_tag", None)
+ model_type = getattr(cfg, "model_type", "")
+ if pipeline_tag:
+ task = PIPELINE_TAG_MAP.get(pipeline_tag, pipeline_tag)
+ elif model_type in ("t5", "mt5", "bart", "mbart"):
+ task = "text2text-generation-with-past"
+ else:
+ task = "text-generation-with-past"
+except Exception:
+ task = "text-generation-with-past"
+print(f"[verify] Resolved task: {task}")
+```
+
+### Export
+
+```bash
+optimum-cli export openvino \
+ --model "$MODEL_ID" \
+ --task "$TASK" \
+ --weight-format fp16 \
+ ov_verify_check/
+```
+
+If export fails with a timeout or OOM, retry with `--weight-format int4`.
+
+### Quick inference check
+
+```python
+from optimum.intel import OVModelForCausalLM
+from transformers import AutoTokenizer
+
+tok = AutoTokenizer.from_pretrained("ov_verify_check/", trust_remote_code=True)
+model = OVModelForCausalLM.from_pretrained("ov_verify_check/", trust_remote_code=True)
+inputs = tok("Hello", return_tensors="pt")
+out = model.generate(**inputs, max_new_tokens=5)
+print("[verify] Inference OK:", tok.decode(out[0]))
+```
+
+For non-causal models (classification, ASR, etc.), adapt the class and inputs accordingly.
+
+---
+
+## Path B — Native OV conversion (`ovc` / `convert_model`)
+
+### ONNX model
+
+```python
+import openvino as ov
+import numpy as np
+core = ov.Core()
+model = core.read_model("path/to/model.onnx")
+compiled = core.compile_model(model, "CPU")
+# Run one inference pass
+infer = compiled.create_infer_request()
+for inp in compiled.inputs:
+ shape = [d if d > 0 else 1 for d in inp.partial_shape.get_min_shape()]
+ infer.set_tensor(inp, ov.Tensor(np.zeros(shape, dtype=inp.element_type.to_dtype())))
+infer.infer()
+print("[verify] ONNX compile + inference OK")
+```
+
+### PyTorch model
+
+```python
+import torch, openvino as ov
+
+# Load your torch model
+# torch_model = ...
+
+example_input = torch.zeros(1, 3, 224, 224) # adjust shape
+ov_model = ov.convert_model(torch_model, example_input=example_input)
+compiled = ov.Core().compile_model(ov_model, "CPU")
+result = list(compiled({0: example_input.numpy()}).values())[0]
+print("[verify] PyTorch convert + inference OK, output shape:", result.shape)
+```
+
+### TF / generic via ovc
+
+```bash
+ovc path/to/saved_model --output_model ov_verify_check/model.xml
+python3 -c "
+import openvino as ov, numpy as np
+core = ov.Core()
+m = core.read_model('ov_verify_check/model.xml')
+cmp = core.compile_model(m, 'CPU')
+infer = cmp.create_infer_request()
+for inp in cmp.inputs:
+ shape = [d if d > 0 else 1 for d in inp.partial_shape.get_min_shape()]
+ infer.set_tensor(inp, ov.Tensor(np.zeros(shape, dtype=inp.element_type.to_dtype())))
+infer.infer()
+print('[verify] ovc + compile + inference OK')
+"
+```
+
+---
+
+## Step 3 — E2E Numerical Sanity Check
+
+After inference completes, validate output quality through the plugin layer:
+
+```python
+import numpy as np
+
+def check_output_sanity(outputs: dict, label: str) -> tuple[bool, str]:
+ """Returns (passed, reason). Checks all output tensors."""
+ for name, arr in outputs.items():
+ arr = np.asarray(arr)
+ if arr.size == 0:
+ return False, f"{label}: output '{name}' is empty (size=0)"
+ if np.isnan(arr).any():
+ return False, f"{label}: output '{name}' contains NaN"
+ if np.isinf(arr).any():
+ return False, f"{label}: output '{name}' contains Inf"
+ return True, "OK"
+
+# For HF/optimum path — check that generated tokens are non-empty
+def check_lm_output(out_ids, tokenizer, label: str) -> tuple[bool, str]:
+ if out_ids is None or out_ids.shape[-1] == 0:
+ return False, f"{label}: generated token sequence is empty"
+ decoded = tokenizer.decode(out_ids[0], skip_special_tokens=True)
+ if not decoded.strip():
+ return False, f"{label}: decoded output is blank"
+ return True, f"generated: '{decoded[:80]}'"
+```
+
+Apply the appropriate check based on conversion path:
+- **Path A (HF/optimum)**: use `check_lm_output` on the generated token ids
+- **Path B (native OV)**: use `check_output_sanity` on the infer request output tensors
+
+If the sanity check fails, set `e2e_passed = false` with the reason — do **not**
+silently swallow the failure.
+
+---
+
+## Result reporting
+
+Write the outcome to `agent-results/<agent>/verify_result.json`:
+
+```json
+{
+ "verify_passed": true,
+ "e2e_passed": true,
+ "conversion_path": "optimum-cli | ovc | convert_model",
+ "task": "<task or null>",
+ "e2e_detail": "<short description of what was run and what output was checked>",
+ "error": null
+}
+```
+
+`verify_passed` is `true` only when **both** conversion and E2E inference pass.
+
+On failure, set `"verify_passed": false`, `"e2e_passed": false` (if inference
+failed), and populate `"error"` with the specific failure reason.
+
+Do **not** abort the pipeline — the orchestrator decides whether to retry or
+escalate.
diff --git a/.github/agents-prototype/transformation.agent.md b/.github/agents-prototype/transformation.agent.md
new file mode 100644
index 00000000000..f352e0cc733
--- /dev/null
+++ b/.github/agents-prototype/transformation.agent.md
@@ -0,0 +1,254 @@
+---
+name: Transformation Agent
+description: Tier-2 OpenVINO graph transformation specialist. Implements pattern-based graph fusion transformations and custom graph rewrite rules in OpenVINO Core (src/common/transformations/). Invoked after Core OpSpec publishes the op spec — the transformation is what makes the new op composable with the rest of the graph optimization pipeline.
+model: claude-sonnet-4.6
+---
+# Transformation Agent
+
+## Role
+
+Tier-2 OpenVINO graph transformation specialist. Implements **pattern-based graph
+fusion transformations** and custom graph rewrite rules in OpenVINO Core
+(`src/common/transformations/`).
+
+Invoked after Core OpSpec publishes the op spec — the transformation is what makes
+the new op composable with the rest of the graph optimization pipeline.
+
+## Output
+
+Write all logs, results, and patches to `agent-results/transformation/`.
+
+## Called by
+
+- **OpenVINO Orchestrator** (Step 4 parallel gate — after Core OpSpec posts
+ `op_spec_ready=true`)
+- **OpenVINO Orchestrator** (Step 0 shortcut — when a `patch_type=transformation`
+ git patch is found in the issue comments)
+
+---
+
+## Environment
+
+| Item | Notes |
+|---|---|
+| **OpenVINO repository** | Current working directory — run from the `openvinotoolkit/openvino` repository root |
+| **Skills** | `.github/agents-prototype/skills/` — relative to the repository root |
+
+### Python Package Bootstrap
+
+Follow **[`skills/python-bootstrap/SKILL.md`](skills/python-bootstrap/SKILL.md) — Path A** (no source build).
+
+---
+
+## Skills
+
+This agent follows the **[`skills/add-fusion-transformation/SKILL.md`](skills/add-fusion-transformation/SKILL.md)** workflow.
+SKILL.md lists all step files with their purpose and execution order.
+
+| Skill file | Purpose |
+|---|---|
+| `.github/agents-prototype/skills/debug-matcher-pass/SKILL.md` | **Debug only** — diagnose why a MatcherPass is not firing: pattern not matched, callback never triggers, opset version mismatch. Load this skill when a transformation silently produces no effect. |
+
+## Code Quality
+
+Before writing any code, read [`.github/copilot-instructions.md`](.github/copilot-instructions.md)
+and apply its conventions. Key points for this agent:
+- `MatcherPass` / `FunctionPass` classes in `ov::pass` namespace, `OPENVINO_RTTI` macro required
+- Filenames: `snake_case`; class names: `CamelCase`
+- Run `clang-format -i <file>` (config: `src/.clang-format`) before committing
+- Every new pass must have positive, negative, and type-propagation unit tests in
+ `src/common/transformations/tests/`
+
+---
+
+## Execution Model
+
+### Step 0: Bootstrap Manifest
+
+Read the op spec from Core OpSpec Agent output:
+
+```
+python .github/scripts/meat/read_op_spec.py
+```
+
+The script reads `agent-results/core-opspec/core_opspec_result.json` and prints the op spec path.
+If a `patch_type=transformation` patch is available in `agent-results/`, apply it with `git apply`
+and verify it compiles before proceeding.
+
+Follow `skills/add-fusion-transformation/SKILL.md` → step1-analysis:
+
+1. Read the op spec to understand the target op and its graph context.
+2. Identify the **sub-graph pattern** to fuse/rewrite:
+ - Which OV ops participate? What are the constant vs runtime inputs?
+ - What is the target fused op (from Core OpSpec)?
+3. Classify the transformation type:
+
+| Type | Use when | Base class |
+|---|---|---|
+| `MatcherPass` | Local pattern matching (fixed topology) | `ov::pass::MatcherPass` |
+| `FunctionPass` | Whole-graph analysis or multi-pattern rewriting | `ov::pass::FunctionPass` |
+| `BackwardGraphRewrite` | Needs consumer-first traversal | `ov::pass::BackwardGraphRewrite` |
+| `GraphRewrite` | Forward traversal over all nodes | `ov::pass::GraphRewrite` |
+
+4. Output `transformation_analysis.md`:
+ - Sub-graph pattern (ASCII diagram or node list)
+ - Transformation type decision + rationale
+ - Constant-folding constraints
+
+### Step 2: Implement the Transformation
+
+Follow `skills/add-fusion-transformation/SKILL.md` → step2-implementation.
+
+File layout:
+```
+src/common/transformations/include/transformations/<domain>/<pass_name>.hpp
+src/common/transformations/src/<domain>/<pass_name>.cpp
+```
+
+Read the closest existing transformation source as your template (identified in
+step1-analysis). Key implementation rules:
+- Use `MATCHER_SCOPE(ClassName)` at the start of the constructor
+- Use `pattern::wrap_type<Op>({...})` and `pattern::consumers_count(N)` for guards
+- Call `ov::copy_runtime_info({old_nodes...}, new_node)` before replacement
+- Call `fused->set_friendly_name(root->get_friendly_name())`
+- Call `ov::replace_node(old_root, new_node)` as the last step — never delete nodes manually
+- Return `true` from callback on successful replacement
+- Preserve output element type
+
+### Step 3: Register in Pass Pipeline
+
+Find the registration location from `transformation_analysis.md` (output of step1-analysis).
+
+For **common_optimizations** (general, all backends):
+Insert `ADD_MATCHER(manager, <PassName>)` in `src/common/transformations/src/transformations/common_optimizations/common_optimizations.cpp`.
+
+For **CPU-exclusive** fusion:
+Insert `manager.register_pass<ov::pass::<PassName>>();` in `src/plugins/intel_cpu/src/graph_optimizer.cpp`.
+
+Add the new `.cpp` to `LIBRARY_SRC` in `src/common/transformations/CMakeLists.txt`.
+The CMake build picks up all files in `LIBRARY_SRC` — no new `add_library` call needed.
+
+### Step 4: Write Tests
+
+Location: `src/common/transformations/tests/<domain>/`
+
+Required test cases:
+1. **Positive** — pattern matches → replacement occurs
+2. **Negative** — pattern does NOT match (e.g., non-constant weight) → graph unchanged
+3. **Type-propagation** — output shape/type correct after fusion
+
+Read the closest existing transformation test as your template. See
+`skills/add-fusion-transformation/workflow.md` → Step 6 for the test structure conventions.
+
+### Step 5: Record Patch
+
+Run the cross-platform patch generation script:
+
+```
+python .github/scripts/meat/generate_patch.py --component transformation --op <op_name>
+```
+
+The patch is saved to `agent-results/transformation/` for the OV Orchestrator to collect.
+
+---
+
+## Output Contract
+
+| Output field | Type | Description |
+|---|---|---|
+| `fix_applied` | `true` \| `false` | Whether a transformation fix was successfully applied |
+| `status` | `success` \| `failed` | Whether the transformation was implemented successfully |
+| `branch` | string | Fix branch name |
+| `patch_file` | path | Path to the `git format-patch` output |
+| `pass_name` | string | C++ class name of the new pass (e.g. `FuseGatedDeltaNetRecurrent`) |
+| `pass_type` | string | One of: `MatcherPass`, `FunctionPass`, `BackwardGraphRewrite`, `GraphRewrite` |
+| `pipeline_registration` | string | File and line where the pass is registered |
+| `test_results` | string | Unit test outcome (pass/fail count) |
+| `accuracy_ok` | `true` \| `false` | Post-transformation accuracy validation result |
+| `agent_report` | Markdown file | Write the agent report directly to `agent-results/transformation/agent_report.md` |
+
+---
+
+## Constraints
+
+- Reports only to OV Orchestrator — does not call other agents directly.
+- Must provide test results when successful.
+- Write all results to `agent-results/transformation/`; do not post to GitHub issues or create PRs unless invoked standalone.
+
+---
+
+## PR Creation
+
+**`pr_mode: delegated_to_orchestrator`** (invoked by Enable Operator Agent): do **not** create a
+PR. Write patches to the result JSON only. The orchestrator creates one central draft PR in Phase 7.
+
+**Standalone invocation** (no `pr_mode` set): follow the [`submit-draft-pr`](skills/submit-draft-pr/SKILL.md)
+skill — it handles branch naming, existing-PR deduplication, fork creation, and `gh pr create`.
+Skip silently if `gh` is unavailable, not authenticated, or the command fails.
+
+---
+
+## Root Cause vs. Workaround
+
+Before implementing any fix, apply this decision gate:
+
+**When a transformation fails to match** (returns false / callback never fires):
+1. Ask: "Is the input graph in the canonical form this transformation expects?"
+2. If NOT — trace backward to find which **producer** is not emitting canonical output.
+3. Fix the producer — not the transformation's matching logic.
+
+**Workaround anti-pattern** (do NOT do this):
+- Adding extra branches to a transformation's callback to handle non-canonical inputs
+- Example: `if (isa<SequenceInsert>(input)) { /* special case */ }` in a consumer transformation
+
+**Root-cause fix** (preferred):
+- Make the producer emit the correct output type/wrapper at its point of creation
+- This is almost always a 1–3 line change vs. a 20+ line workaround
+- It keeps all future consumers correct without modification
+
+If you are unsure which approach is correct, write your analysis in
+`agent-results/transformation/questions.md` and report `status=blocked_needs_review`
+before submitting a patch.
+
+---
+
+## Shared Node / Idempotency Guard
+
+Before finalizing any match pattern, check for shared nodes:
+
+- Verify `node->get_output_target_inputs(0).size() == 1` for every node you plan to remove
+ or replace. If >1: the node is shared — fusing it may corrupt other consumers.
+- For stateful patterns (`ReadValue`, `Assign`, state): verify the 1-to-1 state-to-consumer
+ assumption still holds. Models with shared KV cache (Gemma3n, Gemma4 families) violate this.
+- Guard: `if (node->get_output_target_inputs(0).size() != 1) return false;`
+
+---
+
+## Diagnostic Checklist: MatMulMultiplyFusion Overflow Guard
+
+When implementing or reviewing a `MatMul + Multiply(×scalar)` fusion that absorbs the
+scalar into the weight matrix, apply this check before fusion:
+
+1. Is `|scalar| > 1` AND is the weight dtype `f16` or `bf16`?
+2. If both — **skip the fusion for this instance**.
+
+**Why:** Absorbing a large scalar changes operation order:
+- Original: `MatMul(large_input, weights) → small_output × scalar` (safe — magnitude reduced first)
+- Fused: `MatMul(large_input, weights × scalar)` — intermediate values can overflow FP16 (max ≈ 65504)
+
+Add a guard in the fusion callback:
+- Check the constant value of the scalar input
+- If `abs(scalar) > 1.0 && (weight_element_type == f16 || weight_element_type == bf16)` → return false
+
+Reference: PR #35689 (Gemma4-26B-A4B-it-int4 accuracy regression from MatMulMultiplyFusion).
+
+## Constraints
+
+- Only touches `src/common/transformations/` (general) or the specific plugin path
+ if the transformation is backend-exclusive — never both in the same PR.
+- Does not implement the core op itself — that is Core OpSpec Agent's responsibility.
+ If op headers are missing, signal `missing_op_spec=true` to the orchestrator.
+- Always produces a negative test confirming the pass does not fire on non-matching graphs.
+- Transformations must be deterministic and preserve model correctness.
+- Every produced patch must update the manifest before returning.
+
diff --git a/.github/agents-prototype/verify-implementation.agent.md b/.github/agents-prototype/verify-implementation.agent.md
new file mode 100644
index 00000000000..dd05911b94c
--- /dev/null
+++ b/.github/agents-prototype/verify-implementation.agent.md
@@ -0,0 +1,349 @@
+---
+name: Verify Implementation Agent
+description: Build and test verification gate. Called by Enable Operator Agent after all coding agents complete. Builds changed OpenVINO components, runs their unit tests, and performs a quick inference sanity check if an IR model is available. Returns pass/fail with details before the E2E conversion gate.
+model: claude-sonnet-4.6
+---
+# Verify Implementation Agent
+
+## Role
+
+Post-coding verification gate. Ensures that every change produced by the coding
+agents (FE, Core OpSpec, Transformation, CPU, GPU) actually compiles, passes unit
+tests, and does not crash at inference time.
+
+This agent does **not** add new code. It only builds, runs existing tests, and reports.
+
+## Output
+
+Write all results to `agent-results/verify-implementation/`.
+
+## Called by
+
+- **Enable Operator Agent** (Phase 5 — after all parallel agents and FE Final Pass complete,
+ before the E2E Verification Gate)
+
+---
+
+## Environment
+
+| Item | Notes |
+|---|---|
+| **OpenVINO repository** | Current working directory — run from the `openvinotoolkit/openvino` repository root |
+| **Build directory** | Use the existing `build/` directory — do **not** reconfigure CMake |
+
+---
+
+## Execution Model
+
+### Step 1: Identify Changed Components
+
+Read all sub-agent result files to determine which build targets to check:
+
+```python
+import json, os, glob
+
+result_files = glob.glob("agent-results/*/.*_result.json") + \
+ glob.glob("agent-results/**/*_result.json", recursive=True)
+
+changed_components = set()
+patch_files = []
+
+for path in result_files:
+ try:
+ with open(path) as f:
+ data = json.load(f)
+ patches = data.get("patch_paths", []) or ([data["patch_path"]] if data.get("patch_path") else [])
+ patch_files.extend(patches)
+ except (json.JSONDecodeError, KeyError, FileNotFoundError):
+ continue
+
+# Map patch file paths to CMake build targets
+target_map = {
+ "src/frontends/pytorch": "openvino_pytorch_frontend",
+ "src/frontends/onnx": "openvino_onnx_frontend",
+ "src/frontends/tensorflow": "openvino_tensorflow_frontend",
+ "src/common/transformations": "ov_transformations",
+ "src/core": "openvino",
+ "src/plugins/intel_cpu": "openvino_intel_cpu_plugin",
+ "src/plugins/intel_gpu": "openvino_intel_gpu_plugin",
+}
+
+test_target_map = {
+ "src/frontends/pytorch": ("ov_pytorch_frontend_tests", "ov_pytorch_frontend_tests"),
+ "src/frontends/onnx": ("ov_onnx_frontend_tests", "ov_onnx_frontend_tests"),
+ "src/frontends/tensorflow": ("ov_tensorflow_frontend_tests", "ov_tensorflow_frontend_tests"),
+ "src/common/transformations": ("ov_transformations_tests", "ov_transformations_tests"),
+ "src/core": ("ov_core_unit_tests", "ov_core_unit_tests"),
+ "src/plugins/intel_cpu": ("ov_cpu_func_tests", "ov_cpu_func_tests"),
+}
+
+for patch in patch_files:
+ for prefix, target in target_map.items():
+ if prefix in str(patch):
+ changed_components.add(prefix)
+
+print("Changed components:", sorted(changed_components))
+```
+
+If no patch files are found, default to checking all components that have
+`agent-results/<component>/*_result.json` with `status=success`.
+
+Log:
+```
+[VERIFY] Changed components: frontend/pytorch, common/transformations
+```
+
+### Step 2: Build Changed Targets
+
+For each changed component, run a focused build. Use the existing `build/` directory.
+
+```python
+import subprocess, sys
+
+build_dir = "build"
+build_results = {}
+
+for prefix in changed_components:
+ target = target_map.get(prefix)
+ if not target:
+ continue
+
+ print(f"[VERIFY] Building {target}...")
+ result = subprocess.run(
+ [sys.executable, "-m", "cmake", "--build", build_dir, "--target", target],
+ capture_output=True, text=True,
+ )
+ # cmake --build is not invoked via python -m; use direct call:
+ result = subprocess.run(
+ ["cmake", "--build", build_dir, "--target", target],
+ capture_output=True, text=True,
+ )
+ build_results[prefix] = {
+ "target": target,
+ "returncode": result.returncode,
+ "ok": result.returncode == 0,
+ "stderr_tail": result.stderr.strip().splitlines()[-20:] if result.stderr else [],
+ }
+ status = "OK" if result.returncode == 0 else "FAILED"
+ print(f"[VERIFY] Build {target}: {status}")
+```
+
+A build failure is a **hard stop** — do not proceed to unit tests. Write the failure to
+`agent-results/verify-implementation/build_results.json` and report `status=failed` to the orchestrator.
+
+### Step 3: Run Unit Tests
+
+For each successfully built component, run its unit tests:
+
+```python
+import subprocess
+
+ctest_results = {}
+
+for prefix in changed_components:
+ if not build_results.get(prefix, {}).get("ok"):
+ continue
+
+ test_target_name = test_target_map.get(prefix)
+ if not test_target_name:
+ continue
+
+ build_target, ctest_pattern = test_target_name
+ print(f"[VERIFY] Running tests: {ctest_pattern}...")
+
+ result = subprocess.run(
+ ["ctest", "--test-dir", build_dir, "-R", ctest_pattern,
+ "--output-on-failure", "--timeout", "300"],
+ capture_output=True, text=True,
+ )
+ passed = result.returncode == 0
+ # Extract summary line (e.g. "100% tests passed, 0 tests failed out of 42")
+ summary = next(
+ (l for l in result.stdout.splitlines() if "tests passed" in l or "tests failed" in l),
+ result.stdout.strip().splitlines()[-1] if result.stdout else "no output"
+ )
+ ctest_results[prefix] = {
+ "returncode": result.returncode,
+ "ok": passed,
+ "summary": summary,
+ }
+ status = "PASS" if passed else "FAIL"
+ print(f"[VERIFY] Tests {ctest_pattern}: {status} — {summary}")
+```
+
+**Tests must be "aggressive"** — do not accept a passing run that skips the new
+functionality. Verify that test names covering the newly changed op or pass are
+actually executed. If you see `No tests were found` for a newly added test file,
+that is a failure — the test was not registered.
+
+### Step 4: Inference Sanity Check
+
+If `agent-results/analyze-and-convert/ov_model_*/openvino_model.xml` exists, run a quick
+inference through the locally built OpenVINO to catch segfaults and memory issues:
+
+```python
+import glob, pathlib
+
+ir_candidates = sorted(glob.glob(
+ "agent-results/analyze-and-convert/ov_model_*/openvino_model.xml"
+))
+
+inference_result = {"skipped": True, "reason": "No IR model available"}
+
+if ir_candidates:
+ ir_path = ir_candidates[0]
+ print(f"[VERIFY] Running inference sanity check on {ir_path}...")
+ result = subprocess.run(
+ ["python", ".github/scripts/meat/quick_inference_check.py", "--ir", ir_path],
+ capture_output=True, text=True, timeout=120,
+ )
+ inference_result = {
+ "skipped": False,
+ "ir_path": ir_path,
+ "returncode": result.returncode,
+ "ok": result.returncode == 0,
+ "output": result.stdout.strip().splitlines()[-10:],
+ "stderr_tail": result.stderr.strip().splitlines()[-10:] if result.stderr else [],
+ }
+ status = "PASS" if result.returncode == 0 else "FAIL"
+ print(f"[VERIFY] Inference check: {status}")
+else:
+ print("[VERIFY] No IR model found — skipping inference check")
+```
+
+The inference check catches:
+- Segfaults from incorrect pointer arithmetic in new CPU/GPU kernels
+- Out-of-bounds memory access (reports non-zero exit or signal)
+- Wrong output shape or NaN/Inf tensors (checked in `quick_inference_check.py`)
+
+A failed inference check is a hard stop even if unit tests pass.
+
+### Step 5: Write Report and Return
+
+```python
+import json, datetime
+
+overall_ok = (
+ all(r["ok"] for r in build_results.values()) and
+ all(r["ok"] for r in ctest_results.values()) and
+ (inference_result.get("skipped") or inference_result.get("ok", False))
+)
+
+report = {
+ "status": "success" if overall_ok else "failed",
+ "timestamp": datetime.datetime.utcnow().isoformat() + "Z",
+ "changed_components": sorted(changed_components),
+ "build_results": build_results,
+ "test_results": ctest_results,
+ "inference_result": inference_result,
+}
+
+os.makedirs("agent-results/verify-implementation", exist_ok=True)
+with open("agent-results/verify-implementation/verify_result.json", "w") as f:
+ json.dump(report, f, indent=2)
+
+print(f"[VERIFY] Overall: {'PASS' if overall_ok else 'FAIL'}")
+print(json.dumps(report, indent=2))
+```
+
+Log:
+```
+[VERIFY] build=ok tests=ok inference=ok → overall=PASS
+```
+
+---
+
+## Output Contract
+
+| Output field | Type | Description |
+|---|---|---|
+| `status` | `success` \| `failed` | Overall verification result |
+| `changed_components` | list | Components that were verified |
+| `build_results` | object | Per-component build outcome |
+| `test_results` | object | Per-component test outcome with summary |
+| `inference_result` | object | Inference sanity check result (or `skipped: true`) |
+
+Output file: `agent-results/verify-implementation/verify_result.json`
+
+---
+
+## Failure Handling
+
+| Failure type | Action |
+|---|---|
+| Build fails | Report `status=failed`, include compiler error tail. **Do not run tests.** |
+| Unit tests fail | Report `status=failed`, include ctest summary. **Do not run inference check.** |
+| Test not found (0 tests executed) | Report `status=failed` — test was not registered correctly. |
+| Inference segfault / non-zero exit | Report `status=failed` — this is a kernel or memory bug. |
+| NaN/Inf in inference output | Report `status=failed` — this is a precision or initialization bug. |
+| IR model not available | Report inference as `skipped` (not failed) — no IR to test against. |
+
+---
+
+## E2E Gate Mode (`mode: e2e_gate`)
+
+When called with `mode: e2e_gate`, run Steps 1–5 (standard build + test verification) first,
+then continue with these additional steps.
+
+### Step 6: E2E Conversion Verification
+
+Follow the **[`skills/verify-conversion/SKILL.md`](skills/verify-conversion/SKILL.md)** skill.
+
+The skill:
+1. Auto-detects the correct conversion path (optimum-intel for HuggingFace models,
+ `ovc`/`convert_model` for local ONNX/PyTorch/TF).
+2. Runs one E2E inference through the OV plugin layer.
+3. Validates output sanity: no NaN/Inf, non-empty tensors, non-blank LM output.
+
+Writes `agent-results/verify-implementation/e2e_verify.json`.
+
+A failed E2E conversion is a **hard stop** — do not proceed to the checklist.
+
+### Step 7: New-Architecture Validation Checklist
+
+Follow the **[`skills/new-arch-validation-checklist.md`](skills/new-arch-validation-checklist.md)** skill.
+
+For each item, examine changed files (from `agent-results/*/files_created`) and mark
+`PASS`, `FAIL`, or `N/A`. Log the result per category.
+
+Writes `agent-results/verify-implementation/checklist_result.json`.
+
+### Step 8: Sub-Agent Test Result Scan
+
+```
+python .github/scripts/meat/check_subagent_results.py
+```
+
+The script scans all sub-agent result JSONs for `status=failed` or failing `test_results`.
+Exits with code 1 and prints details if any failure is found.
+
+### E2E Gate Output
+
+Write combined result to `agent-results/verify-implementation/e2e_result.json`:
+```json
+{
+ "status": "success|failed",
+ "build_and_tests": "<path to verify_result.json>",
+ "e2e_verify": {"ok": true, "path": "e2e_verify.json"},
+ "checklist": {"pass": 12, "fail": 0, "na": 3},
+ "subagent_tests": "pass|fail"
+}
+```
+
+| Condition | `e2e_result.status` |
+|---|---|
+| Build + tests + E2E + checklist + sub-agent scan all pass | `success` |
+| Build or unit tests fail | `failed` (from Step 2/3; Steps 6–8 are not run) |
+| E2E conversion fails | `failed` |
+| Checklist has any `FAIL` | `failed` |
+| Sub-agent scan exits non-zero | `failed` |
+
+---
+
+## Constraints
+
+- Does **not** modify any source code.
+- Does **not** create PRs or branches.
+- Reports only to Enable Operator Agent (OV Orchestrator).
+- If `build/` does not exist or CMake was not configured, report `status=failed` with reason
+ `"build directory not found"` — do not attempt to configure CMake.
diff --git a/.github/prompts/add-core-op.prompt.md b/.github/prompts/add-core-op.prompt.md
new file mode 100644
index 00000000000..89532442285
--- /dev/null
+++ b/.github/prompts/add-core-op.prompt.md
@@ -0,0 +1,6 @@
+---
+mode: agent
+description: Add a new operation to the OpenVINO Core opset — class definition, shape inference, registration, reference kernel, and documentation.
+---
+
+#file:../agents/skills/add-core-op/SKILL.md
diff --git a/.github/prompts/add-cpu-op.prompt.md b/.github/prompts/add-cpu-op.prompt.md
new file mode 100644
index 00000000000..954ee40ac2a
--- /dev/null
+++ b/.github/prompts/add-cpu-op.prompt.md
@@ -0,0 +1,6 @@
+---
+mode: agent
+description: Add a new operation to the OpenVINO CPU plugin — ISA-aware kernel (AVX2/AVX-512/AMX), oneDNN-backed paths, and functional tests.
+---
+
+#file:../agents/skills/add-cpu-op/SKILL.md
diff --git a/.github/prompts/add-fe-op.prompt.md b/.github/prompts/add-fe-op.prompt.md
new file mode 100644
index 00000000000..25688ca30d3
--- /dev/null
+++ b/.github/prompts/add-fe-op.prompt.md
@@ -0,0 +1,6 @@
+---
+mode: agent
+description: Add a new operation to the OpenVINO Frontend — translate a framework op (ONNX/PyTorch/TF) into an OpenVINO graph node.
+---
+
+#file:../agents/skills/add-fe-op/SKILL.md
diff --git a/.github/prompts/add-fusion-transformation.prompt.md b/.github/prompts/add-fusion-transformation.prompt.md
new file mode 100644
index 00000000000..2693cfdd390
--- /dev/null
+++ b/.github/prompts/add-fusion-transformation.prompt.md
@@ -0,0 +1,6 @@
+---
+mode: agent
+description: Add a graph fusion transformation to OpenVINO Core transformations pipeline — MatcherPass/FunctionPass, registration, and tests.
+---
+
+#file:../agents/skills/add-fusion-transformation/SKILL.md
diff --git a/.github/prompts/add-gpu-op.prompt.md b/.github/prompts/add-gpu-op.prompt.md
new file mode 100644
index 00000000000..1efe4fef70d
--- /dev/null
+++ b/.github/prompts/add-gpu-op.prompt.md
@@ -0,0 +1,6 @@
+---
+mode: agent
+description: Add a new operation to the OpenVINO GPU plugin — OpenCL kernel design, oneDNN-backed paths, sub-group / LWS tuning, and tests.
+---
+
+#file:../agents/skills/add-gpu-op/SKILL.md
diff --git a/.github/prompts/analyze-and-convert.prompt.md b/.github/prompts/analyze-and-convert.prompt.md
new file mode 100644
index 00000000000..2dd8306bfea
--- /dev/null
+++ b/.github/prompts/analyze-and-convert.prompt.md
@@ -0,0 +1,6 @@
+---
+mode: agent
+description: Analyze a model and attempt conversion to OpenVINO IR — probe properties, try conversion strategies, classify failures, and produce a structured report.
+---
+
+#file:../agents/skills/analyze-and-convert/SKILL.md
diff --git a/.github/prompts/conversion-issues.prompt.md b/.github/prompts/conversion-issues.prompt.md
new file mode 100644
index 00000000000..3428138f012
--- /dev/null
+++ b/.github/prompts/conversion-issues.prompt.md
@@ -0,0 +1,6 @@
+---
+mode: agent
+description: Diagnose and fix model conversion issues — auto-detect failure type (unsupported op, shape inference, dtype mismatch) and route to the correct fix strategy.
+---
+
+#file:../agents/skills/conversion-issues/SKILL.md
diff --git a/.github/prompts/new-arch-validation-checklist.prompt.md b/.github/prompts/new-arch-validation-checklist.prompt.md
new file mode 100644
index 00000000000..777fa156cbb
--- /dev/null
+++ b/.github/prompts/new-arch-validation-checklist.prompt.md
@@ -0,0 +1,15 @@
+---
+mode: ask
+description: Run the new-architecture validation checklist on the current patch or changed files. Use after implementing a new op or fixing an accuracy regression before submitting a PR.
+---
+
+Run the **new-architecture validation checklist** defined in
+`.github/agents-prototype/skills/new-arch-validation-checklist.md`.
+
+1. Read the checklist file now.
+2. For each item in the checklist, examine the current changes (`git diff HEAD` or the files
+ listed in `agent-results/*/files_created`) and determine whether the item is `PASS`,
+ `FAIL`, or `N/A`.
+3. Report results in a markdown table with columns: `Category`, `Item`, `Status`, `Notes`.
+4. For any `FAIL` item, provide a specific fix recommendation tied to the exact changed code.
+5. Summarise: how many PASS / FAIL / N/A, and whether the patch is ready to submit.
diff --git a/.github/prompts/python-bootstrap.prompt.md b/.github/prompts/python-bootstrap.prompt.md
new file mode 100644
index 00000000000..9be2b667fe2
--- /dev/null
+++ b/.github/prompts/python-bootstrap.prompt.md
@@ -0,0 +1,6 @@
+---
+mode: agent
+description: Bootstrap Python environment for OpenVINO development. Path A for release packages, Path B for source builds.
+---
+
+#file:../agents/skills/python-bootstrap/SKILL.md
diff --git a/.github/prompts/submit-draft-pr.prompt.md b/.github/prompts/submit-draft-pr.prompt.md
new file mode 100644
index 00000000000..4ec314e71d8
--- /dev/null
+++ b/.github/prompts/submit-draft-pr.prompt.md
@@ -0,0 +1,6 @@
+---
+mode: agent
+description: Create a draft pull request with existing-PR deduplication. Centralized PR creation skill for all OpenVINO agents.
+---
+
+#file:../agents/skills/submit-draft-pr/SKILL.md
diff --git a/.github/prompts/verify-conversion.prompt.md b/.github/prompts/verify-conversion.prompt.md
new file mode 100644
index 00000000000..223f6fe744f
--- /dev/null
+++ b/.github/prompts/verify-conversion.prompt.md
@@ -0,0 +1,6 @@
+---
+mode: agent
+description: E2E verification gate — convert a model and run inference to verify numerically sane output through the OV plugin layer.
+---
+
+#file:../agents/skills/verify-conversion/SKILL.md
diff --git a/.github/scripts/meat/README.md b/.github/scripts/meat/README.md
new file mode 100644
index 00000000000..b511e3b4291
--- /dev/null
+++ b/.github/scripts/meat/README.md
@@ -0,0 +1,268 @@
+# Agent scripts — local runner
+
+Scripts for running the OpenVINO coding agents from `.github/agents-prototype/` on your
+local machine using the [GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started).
+
+---
+
+> [!WARNING]
+> **Autonomous / unattended mode**
+>
+> These scripts invoke GitHub Copilot with `--no-ask-user` and `--autopilot`.
+> The agent will **read, create, and modify files** in this repository
+> **without asking for confirmation**.
+>
+> - Always run on a **clean branch** with no uncommitted work.
+> - Review `agent-results/` after the run.
+> - Apply generated patches with `git apply` and inspect them before committing.
+> - **Do NOT blindly commit agent-generated changes.**
+
+> [!TIP]
+> **Consider running the agent inside an isolated sandbox.**
+>
+> Autopilot mode gives the agent unrestricted access to your filesystem, shell,
+> and network. Sandboxing limits the blast radius of unexpected agent behaviour
+> (runaway file writes, unintended network calls, accidental credential exposure).
+>
+> Possible options (not an exhaustive list):
+> - **Qwen Code sandbox** — sandboxing feature of the Qwen Code CLI that restricts
+> filesystem and network access during agent runs (macOS Seatbelt or Docker/Podman):
+> https://qwenlm.github.io/qwen-code-docs/en/users/features/sandbox/
+> - **gh-aw-firewall** — network firewall for agentic workflows that restricts
+> outbound HTTP/HTTPS to an allowlist of domains via a Squid proxy inside Docker:
+> https://github.com/github/gh-aw-firewall
+> - **agent-sandbox** (Kubernetes SIGs) — Kubernetes CRD and controller for managing
+> isolated, stateful singleton workloads, ideal for AI agent runtimes:
+> https://github.com/kubernetes-sigs/agent-sandbox
+> - **sandbox-runtime** (Anthropic) — lightweight OS-level sandboxing tool (no
+> container required) that enforces filesystem and network restrictions using native
+> OS primitives (macOS Seatbelt / Linux bubblewrap):
+> https://github.com/anthropic-experimental/sandbox-runtime
+
+---
+
+## Quick Start — Local
+
+### 1. Install prerequisites
+
+Run from the repo root:
+
+```bash
+# Linux — must be run as root to install system packages (gh, copilot CLI)
+sudo python .github/scripts/meat/install_copilot_env.py
+
+# macOS / Windows — no sudo needed
+python .github/scripts/meat/install_copilot_env.py
+```
+
+This checks and installs:
+- Python 3.10+
+- `gh` (GitHub CLI)
+- `copilot` CLI
+- Copilot authentication (opens browser login if needed)
+
+### 2. Write a context file
+
+Create a plain text (or Markdown) file describing the problem.
+One operator or one model per file.
+
+**Operator enablement:**
+
+```markdown
+Operator: aten::erfinv
+Model: Qwen/Qwen3-0.6B
+Error: No conversion rule for aten::erfinv
+
+erfinv computes the element-wise inverse error function.
+PyTorch docs: https://pytorch.org/docs/stable/generated/torch.erfinv.html
+
+The op appears in the attention normalization path.
+Single tensor in, single tensor out. dtype: float32/float16.
+```
+
+Both `Operator:` and `Model:` are important — the agents need a model to
+reproduce and test the fix.
+
+### 3. Run
+
+**Full operator enablement pipeline** (FE → Core OpSpec → Transformation/CPU/GPU/NPU):
+
+```bash
+python .github/scripts/meat/enable_operator.py my_op.md
+```
+
+**Run a single specialist agent:**
+
+```bash
+# Triage — export + classify failure
+python .github/scripts/meat/run_agent.py deployer my_context.md
+python .github/scripts/meat/run_agent.py analyze-and-convert my_context.md
+
+# OpenVINO core pipeline
+python .github/scripts/meat/run_agent.py frontend my_context.md
+python .github/scripts/meat/run_agent.py core-opspec my_context.md
+python .github/scripts/meat/run_agent.py transformation my_context.md
+python .github/scripts/meat/run_agent.py cpu my_context.md
+python .github/scripts/meat/run_agent.py gpu my_context.md
+
+# List all available agents
+python .github/scripts/meat/run_agent.py --list
+```
+
+All output goes to `agent-results/<agent-name>/` in the working directory:
+- `session.md` — full agent session transcript
+- `patches/` — generated `.patch` files ready to apply
+- `pipeline_state.json` — shared state read/written by all agents
+
+### 4. Apply patches
+
+```bash
+# Check first
+git apply --check agent-results/enable-operator/patches/openvino/*.patch
+
+# Apply
+git apply agent-results/enable-operator/patches/openvino/*.patch
+
+# If whitespace issues
+git apply --whitespace=fix agent-results/enable-operator/patches/openvino/*.patch
+```
+
+---
+
+## Agent pipeline map
+
+```
+enable_operator.py
+ │ (delegates to run_agent.py enable-operator)
+ │
+ ├─ run_agent.py frontend ← missing_conversion_rule / frontend_error
+ ├─ run_agent.py core-opspec ← FE escalates (no existing OV op)
+ │ └─ (parallel)
+ │ ├─ run_agent.py transformation
+ │ ├─ run_agent.py cpu
+ │ └─ run_agent.py gpu
+ │
+run_agent.py deployer ← first-attempt export + classify
+run_agent.py analyze-and-convert ← deep probe + strategy matrix + routing signals
+```
+
+---
+
+## Tips & Tricks — Writing Effective Context
+
+The quality of the context file directly affects how well the agents perform.
+
+### Do
+
+- **Include the exact error message or traceback.** Agents parse these to make
+ routing decisions. A partial traceback is better than none.
+- **Name the operator explicitly** (`aten::erfinv`, not "some math function").
+- **Link to documentation** (PyTorch op docs, paper, HF model card).
+- **Mention the model ID** — agents use it to reproduce and test the fix.
+- **State what you already tried** — saves the agent from repeating failed approaches.
+
+### Don't
+
+- Don't paste entire 10 000-line logs. Trim to the relevant section.
+- Don't ask for multiple unrelated things in one context file. One operator
+ or one model per run.
+- Don't include instructions about how agents should work — they already have
+ their own instructions. Focus on the *problem*, not the *process*.
+
+### Example: good context for a frontend issue
+
+```markdown
+Model: Qwen/Qwen3-0.6B
+Operator: aten::erfinv
+Task: text-generation
+
+Export fails with:
+ RuntimeError: No conversion rule found for aten::erfinv
+ at openvino/frontend/pytorch/ts_decoder.py:287
+
+erfinv computes the element-wise inverse error function.
+PyTorch docs: https://pytorch.org/docs/stable/generated/torch.erfinv.html
+
+The op appears in the attention normalization path. Single tensor in, single
+tensor out. dtype: float32/float16.
+```
+
+### Example: good context for a Core OpSpec escalation
+
+```markdown
+Model: Qwen/Qwen3-0.6B
+Operator: aten::erfinv
+
+FE agent escalated — no existing OV op covers erfinv semantics.
+Escalation payload:
+ op_name: aten::erfinv
+ op_semantics: element-wise inverse error function, float tensor in/out
+ suggested_ov_decomposition: null
+```
+
+---
+
+## Authentication
+
+The `copilot` CLI requires a GitHub account with an active Copilot subscription.
+
+`install_copilot_env.py` handles login automatically. To authenticate manually:
+
+```bash
+copilot login
+```
+
+Or set an environment variable with a Personal Access Token (scopes: `read:user`, `copilot`):
+
+```bash
+# Linux / macOS
+export COPILOT_GITHUB_TOKEN=ghp_<your-token>
+
+# Windows PowerShell
+$env:COPILOT_GITHUB_TOKEN = 'ghp_<your-token>'
+```
+
+---
+
+## Using skills from VS Code Chat
+
+Individual skills are also available as **slash commands** directly in the
+VS Code Copilot Chat panel — no terminal or CLI required.
+
+Each skill maps to a `.prompt.md` file in [`.github/prompts/`](../prompts/).
+VS Code discovers these automatically and exposes them as `/skill-name`.
+
+| Command | What it does |
+|---|---|
+| `/add-core-op` | Add a new op to the OpenVINO Core opset |
+| `/add-fe-op` | Translate a framework op in a Frontend (ONNX/PyTorch/TF) |
+| `/add-fusion-transformation` | Write a `MatcherPass`/`FunctionPass` fusion pass |
+| `/add-cpu-op` | Implement a CPU plugin kernel (AVX2/AVX-512/AMX/oneDNN) |
+| `/add-gpu-op` | Implement a GPU plugin OpenCL kernel |
+| `/analyze-and-convert` | Probe a model and classify conversion failures |
+| `/conversion-issues` | Diagnose and fix conversion errors |
+| `/verify-conversion` | E2E gate — convert + run inference + sanity check |
+| `/python-bootstrap` | Set up the Python environment (release or source build) |
+| `/submit-draft-pr` | Create a draft PR with duplicate-PR guard |
+
+**How to use:**
+
+1. Open VS Code Copilot Chat (`Ctrl+Alt+I`).
+2. Switch to **Agent** mode (dropdown next to the model selector).
+3. Type `/` and select the skill from the autocomplete list.
+4. Add your context after the command, e.g.:
+
+```
+/add-fe-op Model: Qwen/Qwen3-0.6B Operator: aten::erfinv
+```
+
+The skill instructions are loaded automatically — the agent follows the
+step-by-step workflow defined in the corresponding skill file.
+
+---
+
+## See also
+
+- Agent definitions: [`.github/agents-prototype/`](../agents-prototype/)
+- Skill prompts: [`.github/prompts/`](../prompts/)
+- Copilot CLI reference: https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference
diff --git a/.github/scripts/meat/build_report.py b/.github/scripts/meat/build_report.py
new file mode 100644
index 00000000000..18e6578eb00
--- /dev/null
+++ b/.github/scripts/meat/build_report.py
@@ -0,0 +1,298 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+#!/usr/bin/env python3
+"""Build-report step for the analyze-and-convert agent.
+
+Loads all artifacts produced by previous skills and:
+ 1. Generates conversion_report.md (human-readable)
+ 2. Posts the report as a PR/issue comment via gh CLI (if available)
+ 3. Writes analyze_and_convert_result.json (machine-readable)
+ 4. Prints the <!-- agent-complete --> marker on stdout
+
+Usage:
+ python .github/scripts/meat/build_report.py
+
+Expected input files (all in the current working directory):
+ model_profile.json
+ conversion_attempts.json
+ routing_signals.json
+ error_excerpts.json
+
+Output files:
+ agent-results/analyze-and-convert/conversion_report.md
+ agent-results/analyze-and-convert/analyze_and_convert_result.json
+"""
+
+import json
+import os
+import pathlib
+import subprocess
+import sys
+import textwrap
+
+# ---------------------------------------------------------------------------
+# Paths
+# ---------------------------------------------------------------------------
+
+RESULTS_DIR = pathlib.Path("agent-results") / "analyze-and-convert"
+
+INPUTS = {
+ "profile": pathlib.Path("model_profile.json"),
+ "attempts": pathlib.Path("conversion_attempts.json"),
+ "signals": pathlib.Path("routing_signals.json"),
+ "excerpts": pathlib.Path("error_excerpts.json"),
+}
+
+REPORT_PATH = RESULTS_DIR / "conversion_report.md"
+RESULT_JSON = RESULTS_DIR / "analyze_and_convert_result.json"
+
+
+# ---------------------------------------------------------------------------
+# Step 1 — Load artifacts
+# ---------------------------------------------------------------------------
+
+def load_json(path: pathlib.Path, default):
+ if path.exists():
+ try:
+ return json.loads(path.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ print(f"[build_report] WARNING: could not parse {path}: {exc}", file=sys.stderr)
+ else:
+ print(f"[build_report] WARNING: {path} not found — using default", file=sys.stderr)
+ return default
+
+
+profile = load_json(INPUTS["profile"], {})
+attempts = load_json(INPUTS["attempts"], [])
+signals = load_json(INPUTS["signals"], {})
+excerpts = load_json(INPUTS["excerpts"], {})
+
+model_id = profile.get("model_id", "unknown")
+error_class = signals.get("error_class", "unknown")
+target_agent = signals.get("target_agent", "optimum-intel")
+
+# Determine overall status
+successful = [a for a in attempts if a.get("success")]
+if not successful:
+ status = "failed"
+else:
+ winning = successful[-1]
+ if winning.get("inference_ok") is True:
+ status = "success"
+ elif "inference_ok" in winning:
+ # Exported OK but inference check failed
+ status = "partial"
+ else:
+ status = "success"
+
+
+# ---------------------------------------------------------------------------
+# Step 2 — Write conversion_report.md
+# ---------------------------------------------------------------------------
+
+def md_table(headers: list, rows: list) -> str:
+ sep = " | ".join("---" for _ in headers)
+ header_row = " | ".join(headers)
+ lines = [f"| {header_row} |", f"| {sep} |"]
+ for row in rows:
+ lines.append("| " + " | ".join(str(c) for c in row) + " |")
+ return "\n".join(lines)
+
+
+def build_report() -> str:
+ lines = []
+
+ lines.append(f"# Conversion Report: `{model_id}`\n")
+ lines.append(f"**Overall status:** `{status}` \n")
+ lines.append(f"**Error class:** `{error_class}` \n")
+ lines.append(f"**Recommended next agent:** `{target_agent}`\n")
+
+ # --- Model profile ---
+ lines.append("\n## Model Profile\n")
+ if profile:
+ profile_rows = [
+ [k, str(v)]
+ for k, v in profile.items()
+ if k != "special_config_keys"
+ ]
+ lines.append(md_table(["Key", "Value"], profile_rows))
+ special_keys = profile.get("special_config_keys", [])
+ if special_keys:
+ lines.append(f"\n**Special config keys:** {', '.join(special_keys)}")
+ else:
+ lines.append("_No profile data available._")
+
+ # --- Conversion attempts ---
+ lines.append("\n\n## Conversion Attempts\n")
+ if attempts:
+ attempt_rows = [
+ [
+ a.get("id", "?"),
+ "✅" if a.get("success") else "❌",
+ a.get("description", ""),
+ a.get("weight_format", ""),
+ a.get("optimum_version", ""),
+ ]
+ for a in attempts
+ ]
+ lines.append(md_table(
+ ["ID", "Result", "Description", "Weight Format", "Optimum Version"],
+ attempt_rows,
+ ))
+ else:
+ lines.append("_No conversion attempts recorded._")
+
+ # --- Successful strategy ---
+ if successful:
+ lines.append("\n\n## Successful Strategy\n")
+ s = successful[-1]
+ lines.append(f"Strategy **{s.get('id')}** succeeded.\n")
+ extra = {k: v for k, v in s.items()
+ if k not in ("id", "success", "description", "weight_format",
+ "optimum_version", "stdout", "stderr")}
+ if extra:
+ lines.append(md_table(["Flag", "Value"], list(extra.items())))
+
+ # --- Failure details ---
+ if not successful:
+ lines.append("\n\n## Failure Details\n")
+ for a in attempts:
+ if not a.get("success"):
+ lines.append(f"### Attempt `{a.get('id', '?')}`\n")
+ excerpt = excerpts.get(a.get("id", ""), "")
+ if excerpt:
+ lines.append("```")
+ lines.append(textwrap.indent(excerpt, " "))
+ lines.append("```\n")
+ else:
+ lines.append("_No error excerpt available._\n")
+
+ # --- Routing signals ---
+ lines.append("\n## Routing Signals\n")
+ if signals:
+ signal_rows = [[k, str(v)] for k, v in signals.items()]
+ lines.append(md_table(["Signal", "Value"], signal_rows))
+ else:
+ lines.append("_No routing signals available._")
+
+ # --- Recommended next step ---
+ lines.append("\n\n## Recommended Next Step\n")
+ _next_step_map = {
+ "optimum-intel": "Open a follow-up issue against **Optimum-Intel**.",
+ "enable-operator": "Dispatch to **OV Orchestrator** (`enable-operator` agent).",
+ "openvino-genai": "Dispatch to **GenAI** team for pipeline support.",
+ "openvino-tokenizers": "Dispatch to **Tokenizers** team for tokenizer conversion fix.",
+ }
+ lines.append(_next_step_map.get(target_agent, f"Route to `{target_agent}`."))
+
+ return "\n".join(lines) + "\n"
+
+
+RESULTS_DIR.mkdir(parents=True, exist_ok=True)
+report_text = build_report()
+REPORT_PATH.write_text(report_text, encoding="utf-8")
+print(f"[build_report] Wrote {REPORT_PATH}")
+
+
+# ---------------------------------------------------------------------------
+# Step 3 — Post to GitHub PR/Issue (best-effort)
+# ---------------------------------------------------------------------------
+
+def post_to_github(report_path: pathlib.Path) -> None:
+ pr_number = os.environ.get("PR_NUMBER", "")
+ issue_number = os.environ.get("ISSUE_NUMBER", "")
+ if not (pr_number or issue_number):
+ print("[build_report] No PR_NUMBER or ISSUE_NUMBER set — skipping gh comment")
+ return
+
+ try:
+ result = subprocess.run(
+ ["gh", "--version"],
+ capture_output=True,
+ check=False,
+ )
+ if result.returncode != 0:
+ raise FileNotFoundError
+ except FileNotFoundError:
+ print("[build_report] gh CLI not available — skipping comment post")
+ return
+
+ body = report_path.read_text(encoding="utf-8")
+ if pr_number:
+ cmd = ["gh", "pr", "comment", pr_number, "--body", body]
+ else:
+ cmd = ["gh", "issue", "comment", issue_number, "--body", body]
+
+ result = subprocess.run(cmd, capture_output=True, text=True, check=False)
+ if result.returncode == 0:
+ print("[build_report] Posted report to GitHub")
+ else:
+ print(f"[build_report] gh comment failed: {result.stderr.strip()}", file=sys.stderr)
+
+
+post_to_github(REPORT_PATH)
+
+
+# ---------------------------------------------------------------------------
+# Step 4 — Write analyze_and_convert_result.json
+# ---------------------------------------------------------------------------
+
+result_data = {
+ "agent": "analyze-and-convert",
+ "status": status,
+ "model_id": model_id,
+ "entry_type": profile.get("pipeline_tag", "unknown"),
+ "error_class": error_class,
+ "target_agent": target_agent,
+ "routing_signals": {
+ k: signals[k]
+ for k in (
+ "requires_optimum_new_arch",
+ "requires_transformers_upgrade",
+ "transformers_override",
+ "requires_tokenizer_check",
+ "trust_remote_code_required",
+ "is_vlm",
+ "custom_ops_suspected",
+ "oom_suspected",
+ )
+ if k in signals
+ },
+}
+
+RESULT_JSON.write_text(json.dumps(result_data, indent=2), encoding="utf-8")
+print(f"[build_report] Wrote {RESULT_JSON}")
+
+
+# ---------------------------------------------------------------------------
+# Step 5 — Print agent-complete marker
+# ---------------------------------------------------------------------------
+
+next_context = {
+ k: signals[k]
+ for k in (
+ "requires_optimum_new_arch",
+ "requires_transformers_upgrade",
+ "transformers_override",
+ "requires_tokenizer_check",
+ "trust_remote_code_required",
+ "is_vlm",
+ "custom_ops_suspected",
+ "oom_suspected",
+ )
+ if k in signals
+}
+
+marker = {
+ "agent": "analyze-and-convert",
+ "status": status,
+ "next_agent": target_agent,
+ "error_class": error_class,
+ "model_id": model_id,
+ "next_context": next_context,
+}
+
+print("<!-- agent-complete")
+print(json.dumps(marker, indent=2))
+print("-->")
diff --git a/.github/scripts/meat/check_subagent_results.py b/.github/scripts/meat/check_subagent_results.py
new file mode 100644
index 00000000000..485de1691e5
--- /dev/null
+++ b/.github/scripts/meat/check_subagent_results.py
@@ -0,0 +1,52 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+#!/usr/bin/env python3
+"""Phase 6 helper for enable-operator agent.
+
+Scans sub-agent result JSON files for failures and failing test results.
+Prints a summary and exits with code 1 if any failure is found, 0 otherwise.
+
+Usage:
+ python .github/scripts/meat/check_subagent_results.py
+"""
+
+import json
+import pathlib
+import sys
+
+SUBAGENT_RESULTS = [
+ "agent-results/frontend/fe_result.json",
+ "agent-results/core-opspec/core_opspec_result.json",
+ "agent-results/transformation/transformation_result.json",
+ "agent-results/cpu/cpu_result.json",
+ "agent-results/gpu/gpu_result.json",
+]
+
+failures = []
+
+for path_str in SUBAGENT_RESULTS:
+ p = pathlib.Path(path_str)
+ if not p.exists():
+ continue
+
+ try:
+ d = json.loads(p.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ failures.append(f"{path_str}: malformed JSON — {exc}")
+ continue
+
+ if d.get("status") == "failed":
+ failures.append(f"{path_str}: status=failed")
+
+ tr = d.get("test_results", "")
+ if tr and "FAILED" in str(tr).upper():
+ failures.append(f"{path_str}: test_results={tr!r}")
+
+if failures:
+ print("[OV-ORCH] [phase=e2e-gate] SUB-AGENT TEST FAILURES:")
+ for f in failures:
+ print(f" {f}")
+ sys.exit(1)
+
+print("[OV-ORCH] [phase=e2e-gate] All sub-agent results: PASS")
diff --git a/.github/scripts/meat/classify_component.py b/.github/scripts/meat/classify_component.py
new file mode 100644
index 00000000000..7acd38c7e21
--- /dev/null
+++ b/.github/scripts/meat/classify_component.py
@@ -0,0 +1,46 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+#!/usr/bin/env python3
+"""Phase 1 helper for enable-operator agent.
+
+Reads agent-results/pipeline_state.json, classifies the failing component
+from error_context, and prints the result as 'component=<value>' to stdout.
+
+Exit codes:
+ 0 — classification succeeded (result printed)
+ 0 — state file missing (prints 'component=frontend' as safe default)
+"""
+
+import json
+import pathlib
+import sys
+
+CLASSIFICATION_MAP = {
+ "missing_conversion_rule": "frontend",
+ "frontend_error": "frontend",
+ "ir_validation_error": "core_op",
+ "inference_runtime_error": "cpu_plugin",
+ "accuracy_regression": "transformation",
+}
+
+STATE = pathlib.Path("agent-results/pipeline_state.json")
+
+if not STATE.exists():
+ print("component=frontend")
+ sys.exit(0)
+
+d = json.loads(STATE.read_text(encoding="utf-8"))
+orch = d.get("ov_orchestrator", {})
+error_context = orch.get("error_context", "")
+
+error_class = error_context.split("/")[0].strip() if error_context else "unknown"
+component = CLASSIFICATION_MAP.get(error_class, "frontend")
+
+# Multi-op detection: report co_located_ops when present
+co_located = orch.get("co_located_ops", [])
+if co_located:
+ print(f"[OV-ORCH] Multi-op detected: co_located_ops={co_located} — routing as single target")
+
+print(f"component={component}")
+print(f"[OV-ORCH] Classified component: {component} (error_class={error_class})")
diff --git a/.github/scripts/meat/classify_failure.py b/.github/scripts/meat/classify_failure.py
new file mode 100644
index 00000000000..56cdfdbd69c
--- /dev/null
+++ b/.github/scripts/meat/classify_failure.py
@@ -0,0 +1,220 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+#!/usr/bin/env python3
+"""Classify-failure step for the analyze-and-convert agent.
+
+Reads conversion_attempts.json and model_profile.json, classifies each
+failure into the 11-class error taxonomy, extracts routing signals, and
+writes error excerpts for use by build_report.py.
+
+Usage:
+ python .github/scripts/meat/classify_failure.py
+
+Input files (current working directory):
+ conversion_attempts.json
+ model_profile.json
+
+Output files:
+ routing_signals.json
+ error_excerpts.json
+"""
+
+import json
+import pathlib
+import re
+import sys
+
+# ---------------------------------------------------------------------------
+# Load artifacts
+# ---------------------------------------------------------------------------
+
+def load_json(path: str, default):
+ p = pathlib.Path(path)
+ if p.exists():
+ try:
+ return json.loads(p.read_text(encoding="utf-8"))
+ except json.JSONDecodeError as exc:
+ print(f"[classify_failure] WARNING: could not parse {path}: {exc}", file=sys.stderr)
+ else:
+ print(f"[classify_failure] WARNING: {path} not found — using default", file=sys.stderr)
+ return default
+
+
+attempts = load_json("conversion_attempts.json", [])
+profile = load_json("model_profile.json", {})
+
+# Collect error text from failed attempts
+all_errors = []
+for a in attempts:
+ if not a.get("success"):
+ combined = (a.get("stderr", "") + "\n" + a.get("stdout", "")).strip()
+ all_errors.append({"id": a["id"], "text": combined})
+
+
+# ---------------------------------------------------------------------------
+# Step 2 — Pattern matching → 11-class taxonomy
+# ---------------------------------------------------------------------------
+
+def classify_error(text: str) -> str:
+ t = text.lower()
+
+ # Order matters — most specific first
+ if re.search(r"modulenotfounderror|importerror.*requires.*package|no module named", t):
+ return "missing_model_dependency"
+
+ if re.search(r"keyerror.*taskmanager|model_type.*not.*support|no configuration class", t):
+ if re.search(r"no.*class.*for.*model_type|transformers.*doesn.t.*know", t):
+ return "unknown_arch_transformers_too_old"
+ return "optimum_unsupported_arch"
+
+ if re.search(
+ r"optimum[/\\]exporters|dummy_inputs|onnx_config|ModelPatcher|"
+ r"from_pretrained.*export|openvino_config",
+ t,
+ ):
+ return "optimum_export_bug"
+
+ if re.search(
+ r"notimplemented.*aten::|no rule.*op|conversion.*failed.*aten|"
+ r"pytorch_frontend|pt_frontend|torchscript.*error",
+ t,
+ ):
+ return "missing_conversion_rule"
+
+ if re.search(
+ r"openvino[/\\]frontend|ir.*parse|frontend.*error|"
+ r"segmentation fault|core dumped",
+ t,
+ ):
+ return "frontend_error"
+
+ if re.search(
+ r"validate_and_infer_types|ngraph.*shape|ir.*invalid|"
+ r"shape inference failed|opset.*mismatch",
+ t,
+ ):
+ return "ir_validation_error"
+
+ if re.search(
+ r"ov::exception|infer.*request|plugin.*error|"
+ r"openvino.*runtime.*error|inference engine",
+ t,
+ ):
+ return "inference_runtime_error"
+
+ if re.search(r"openvino_genai|chat.*template.*missing|pipeline.*construct", t):
+ return "genai_unsupported"
+
+ if re.search(
+ r"openvino_tokenizers|sentencepiece|tokenizer.*convert|"
+ r"tiktoken.*error|fast.*tokenizer",
+ t,
+ ):
+ return "tokenizer_error"
+
+ return "unknown"
+
+
+for err in all_errors:
+ err["error_class"] = classify_error(err["text"])
+ lines = err["text"].splitlines()
+ tb_lines = [l for l in lines if "Error" in l or "Exception" in l or "raise " in l]
+ err["key_line"] = tb_lines[0].strip() if tb_lines else (lines[-1].strip() if lines else "")
+
+dominant_class = all_errors[-1]["error_class"] if all_errors else "unknown"
+print(f"[classify_failure] Dominant error class: {dominant_class}")
+
+
+# ---------------------------------------------------------------------------
+# Step 3 — Extract routing signals
+# ---------------------------------------------------------------------------
+
+def extract_signals(attempts, profile, dominant_class):
+ signals = {
+ "error_class": dominant_class,
+ "requires_optimum_new_arch": False,
+ "requires_transformers_upgrade": False,
+ "transformers_override": "",
+ "requires_tokenizer_check": False,
+ "trust_remote_code_required": profile.get("trust_remote_code_required", False),
+ "is_vlm": profile.get("is_vlm", False),
+ "custom_ops_suspected": False,
+ "oom_suspected": False,
+ "target_agent": "",
+ }
+
+ all_text = " ".join(
+ a.get("stderr", "") + a.get("stdout", "") for a in attempts
+ ).lower()
+
+ if dominant_class in ("optimum_unsupported_arch", "unknown_arch_transformers_too_old"):
+ signals["requires_optimum_new_arch"] = True
+
+ if dominant_class == "unknown_arch_transformers_too_old":
+ signals["requires_transformers_upgrade"] = True
+ signals["transformers_override"] = (
+ "git+https://github.com/huggingface/transformers.git"
+ )
+
+ ssm_keys = [
+ k for k in profile.get("special_config_keys", [])
+ if any(w in k.lower() for w in
+ ["ssm", "mamba", "rwkv", "recurrent", "conv", "delta"])
+ ]
+ if ssm_keys:
+ signals["custom_ops_suspected"] = True
+
+ if re.search(r"out of memory|oom|killed|memory error|cannot allocate", all_text):
+ signals["oom_suspected"] = True
+
+ if profile.get("is_vlm"):
+ signals["requires_tokenizer_check"] = True
+
+ routing = {
+ "optimum_unsupported_arch": "optimum-intel",
+ "optimum_export_bug": "optimum-intel",
+ "missing_model_dependency": "optimum-intel",
+ "unknown_arch_transformers_too_old": "optimum-intel",
+ "unknown": "optimum-intel",
+ "missing_conversion_rule": "enable-operator",
+ "frontend_error": "enable-operator",
+ "ir_validation_error": "enable-operator",
+ "inference_runtime_error": "enable-operator",
+ "genai_unsupported": "openvino-genai",
+ "tokenizer_error": "openvino-tokenizers",
+ }
+ signals["target_agent"] = routing.get(dominant_class, "optimum-intel")
+
+ return signals
+
+
+signals = extract_signals(attempts, profile, dominant_class)
+print("[classify_failure] Routing signals:", json.dumps(signals, indent=2))
+
+pathlib.Path("routing_signals.json").write_text(
+ json.dumps(signals, indent=2), encoding="utf-8"
+)
+print("[classify_failure] Written: routing_signals.json")
+
+
+# ---------------------------------------------------------------------------
+# Step 4 — Extract key error excerpts
+# ---------------------------------------------------------------------------
+
+def extract_excerpt(text: str, max_lines: int = 20) -> str:
+ lines = text.splitlines()
+ tb_start = max(
+ (i for i, l in enumerate(lines) if "Traceback (most recent call last)" in l),
+ default=0,
+ )
+ excerpt = lines[tb_start:]
+ return "\n".join(excerpt[-max_lines:])
+
+
+excerpts = {err["id"]: extract_excerpt(err["text"]) for err in all_errors}
+
+pathlib.Path("error_excerpts.json").write_text(
+ json.dumps(excerpts, indent=2), encoding="utf-8"
+)
+print(f"[classify_failure] Written: error_excerpts.json ({len(excerpts)} attempt(s))")
diff --git a/.github/scripts/meat/collect_patches.py b/.github/scripts/meat/collect_patches.py
new file mode 100644
index 00000000000..a3071175a39
--- /dev/null
+++ b/.github/scripts/meat/collect_patches.py
@@ -0,0 +1,81 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+#!/usr/bin/env python3
+"""Phase 7 helper for enable-operator agent — patch collection.
+
+Reads patch paths from sub-agent result JSON files and copies them to
+agent-results/enable-operator/patches/openvino/.
+Produces a combined patch file for convenience.
+
+Usage:
+ python .github/scripts/meat/collect_patches.py
+
+Exit codes:
+ 0 — patches collected (or zero patches found — no-op)
+ 1 — at least one referenced patch file is missing
+"""
+
+import json
+import pathlib
+import shutil
+import sys
+
+RESULT_FILES = [
+ "agent-results/frontend/fe_result.json",
+ "agent-results/core-opspec/core_opspec_result.json",
+ "agent-results/transformation/transformation_result.json",
+ "agent-results/cpu/cpu_result.json",
+ "agent-results/gpu/gpu_result.json",
+ "agent-results/npu/npu_result.json",
+]
+
+OUT_DIR = pathlib.Path("agent-results/enable-operator/patches/openvino")
+OUT_DIR.mkdir(parents=True, exist_ok=True)
+
+collected: list[pathlib.Path] = []
+missing: list[str] = []
+
+for path_str in RESULT_FILES:
+ p = pathlib.Path(path_str)
+ if not p.exists():
+ continue
+
+ try:
+ d = json.loads(p.read_text(encoding="utf-8"))
+ except json.JSONDecodeError:
+ continue
+
+ patch_paths = d.get("patch_paths", [])
+ if not patch_paths and d.get("patch_path"):
+ patch_paths = [d["patch_path"]]
+
+ for pp in patch_paths:
+ if not pp:
+ continue
+ src = pathlib.Path(pp)
+ if src.is_file():
+ dst = OUT_DIR / src.name
+ shutil.copy(src, dst)
+ collected.append(dst)
+ else:
+ missing.append(str(pp))
+ print(f"[WARN] Patch not found: {pp} — skipping", file=sys.stderr)
+
+# A missing patch is always an error — check before the no-collected guard
+if missing:
+ if not collected:
+ print("[WARN] No patches collected — nothing to publish")
+ sys.exit(1)
+
+if not collected:
+ print("[WARN] No patches collected — nothing to publish")
+ sys.exit(0)
+
+# Combine all patches into a single file (useful for review)
+combined = pathlib.Path("agent-results/enable-operator/patches/openvino_combined.patch")
+combined.write_text(
+ "\n".join(c.read_text(encoding="utf-8") for c in collected),
+ encoding="utf-8",
+)
+print(f"[OV-ORCH] Combined {len(collected)} patches into {combined}")
diff --git a/.github/scripts/meat/create_agent_pr.py b/.github/scripts/meat/create_agent_pr.py
new file mode 100644
index 00000000000..bd41bf67730
--- /dev/null
+++ b/.github/scripts/meat/create_agent_pr.py
@@ -0,0 +1,174 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+#!/usr/bin/env python3
+"""Phase 7 helper for enable-operator agent — branch, apply patches, open draft PR.
+
+Reads agent-results/pipeline_state.json to derive op names, creates a branch,
+applies all collected patches via 'git am', pushes to the user's fork, and opens
+a draft PR against openvinotoolkit/openvino with the required AI-generation banner
+and pull_request_template.md structure.
+
+Cross-platform: uses Python subprocess instead of bash. Requires git and gh CLI.
+
+Usage:
+ python .github/scripts/meat/create_agent_pr.py [--dry-run]
+
+Exit codes:
+ 0 — PR opened (or already exists, or dry-run)
+ 1 — unrecoverable error
+"""
+
+import argparse
+import json
+import pathlib
+import subprocess
+import sys
+import textwrap
+
+
+def run(cmd: list[str], check: bool = True, capture: bool = True) -> subprocess.CompletedProcess:
+ """Run a command, optionally capturing output."""
+ return subprocess.run(
+ cmd,
+ check=check,
+ text=True,
+ capture_output=capture,
+ )
+
+
+def gh_login() -> str:
+ return run(["gh", "api", "user", "-q", ".login"]).stdout.strip()
+
+
+def check_existing_pr(login: str, branch: str) -> str | None:
+ result = run(
+ [
+ "gh", "pr", "list",
+ "--repo", "openvinotoolkit/openvino",
+ "--head", f"{login}:{branch}",
+ "--json", "url",
+ "-q", ".[0].url",
+ ],
+ check=False,
+ )
+ url = result.stdout.strip()
+ return url if url else None
+
+
+def get_op_names(state: dict) -> tuple[list[str], str, str]:
+ """Return (ops list, slug for branch, title for PR)."""
+ orch = state.get("ov_orchestrator", {})
+ ops = orch.get("co_located_ops", [])
+ if not ops:
+ ctx = orch.get("error_context", "unknown")
+ ops = [ctx.split("/")[-1]]
+
+ slug = "-".join(o.lower().replace("::", "-").replace("_", "-") for o in ops)
+ title = ", ".join(ops)
+ return ops, slug, title
+
+
+def compose_pr_body(ops: list[str], op_title: str) -> str:
+ return textwrap.dedent(f"""\
+ > [!IMPORTANT]
+ > **This PR was generated by a Copilot coding agent and requires human review.**
+ > A maintainer must inspect the changes, run the relevant tests locally, and
+ > convert this draft to "Ready for review" only after verifying correctness.
+ > Do **not** merge without human sign-off.
+
+ ### Details:
+ - Add operator support: {op_title}
+ - Agent: Enable Operator (`enable-operator.agent.md`)
+ - Ops added: {', '.join(ops)}
+
+ ### Tickets:
+ - N/A
+
+ ### AI Assistance:
+ - AI assistance used: yes
+ - Generated by GitHub Copilot agent (`enable-operator`). Human validation required:
+ build verification, unit/functional tests, and inference sanity check.
+ """)
+
+
+def main() -> int:
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("--dry-run", action="store_true", help="Print actions without executing git/gh commands")
+ args = parser.parse_args()
+
+ state_path = pathlib.Path("agent-results/pipeline_state.json")
+ if not state_path.exists():
+ print(f"[ERROR] State file not found: {state_path}", file=sys.stderr)
+ return 1
+
+ state = json.loads(state_path.read_text(encoding="utf-8"))
+ ops, slug, op_title = get_op_names(state)
+ branch = f"fix/add-{slug}-op"
+
+ patches = sorted(
+ pathlib.Path("agent-results/enable-operator/patches/openvino").glob("*.patch")
+ )
+ if not patches:
+ print("[WARN] No patches to apply — skipping PR creation")
+ return 0
+
+ # Check for existing PR to avoid duplicates
+ try:
+ login = gh_login()
+ except subprocess.CalledProcessError:
+ print("[ERROR] gh CLI not available or not authenticated", file=sys.stderr)
+ return 1
+
+ existing = check_existing_pr(login, branch)
+ if existing:
+ print(f"[draft-pr] PR already exists: {existing} — skipping creation")
+ return 0
+
+ if args.dry_run:
+ print(f"[dry-run] Would create branch: {branch}")
+ print(f"[dry-run] Would apply {len(patches)} patch(es)")
+ print(f"[dry-run] Would open PR: 'Add operator support: {op_title}'")
+ return 0
+
+ # Create branch and apply patches
+ run(["git", "checkout", "-b", branch])
+ for patch in patches:
+ run(["git", "am", str(patch)])
+
+ # Ensure fork exists
+ run(["gh", "repo", "fork", "openvinotoolkit/openvino", "--clone=false"], check=False)
+
+ # Add fork remote (ignore error if already present)
+ fork_ssh = run(
+ ["gh", "repo", "view", f"{login}/openvino", "--json", "sshUrl", "-q", ".sshUrl"]
+ ).stdout.strip()
+ run(["git", "remote", "add", "fork", fork_ssh], check=False)
+ run(["git", "push", "fork", branch])
+
+ # Write PR body
+ pr_body_path = pathlib.Path("agent-results/enable-operator/pr_body.md")
+ pr_body_path.write_text(compose_pr_body(ops, op_title), encoding="utf-8")
+
+ # Open draft PR
+ result = run([
+ "gh", "pr", "create",
+ "--repo", "openvinotoolkit/openvino",
+ "--head", f"{login}:{branch}",
+ "--title", f"Add operator support: {op_title}",
+ "--body-file", str(pr_body_path),
+ "--draft",
+ ])
+ pr_url = result.stdout.strip()
+ print(f"[OV-ORCH] [publish] openvino PR opened: {pr_url}")
+
+ # Update pipeline state
+ state.setdefault("ov_orchestrator", {})["pr_url"] = pr_url
+ state.setdefault("ov_orchestrator", {})["overall_status"] = "success"
+ state_path.write_text(json.dumps(state, indent=2), encoding="utf-8")
+
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/.github/scripts/meat/enable_operator.py b/.github/scripts/meat/enable_operator.py
new file mode 100644
index 00000000000..630c97545b6
--- /dev/null
+++ b/.github/scripts/meat/enable_operator.py
@@ -0,0 +1,46 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+#!/usr/bin/env python3
+"""Entry point for operator-level enablement (OpenVINO core pipeline).
+
+Passes the context file to the `enable-operator` agent defined in
+`.github/agents-prototype/enable-operator.agent.md`, which drives the full
+FE → Core OpSpec → Transformation/CPU/GPU/NPU → Package Builder pipeline.
+
+Usage:
+ python .github/scripts/meat/enable_operator.py <context-file>
+
+Run from the openvino repo root.
+
+The context file should contain:
+ - the operator name (e.g. ``aten::erfinv``),
+ - a model ID or local path to a model that uses the operator — the agents
+ will use this model to test and validate the implementation.
+
+Example context file:
+
+ Operator: aten::erfinv
+ Model: Qwen/Qwen3-0.6B
+ Error: No conversion rule for aten::erfinv
+
+ erfinv computes the element-wise inverse error function.
+ PyTorch docs: https://pytorch.org/docs/stable/generated/torch.erfinv.html
+
+See .github/scripts/meat/README.md for the full context file format.
+
+Shortcut for: run_agent.py enable-operator <context-file>
+"""
+
+import os
+import subprocess
+import sys
+
+
+def main() -> None:
+ runner = os.path.join(os.path.dirname(os.path.abspath(__file__)), "run_agent.py")
+ sys.exit(subprocess.run([sys.executable, runner, "enable-operator"] + sys.argv[1:]).returncode)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/.github/scripts/meat/install_copilot_env.py b/.github/scripts/meat/install_copilot_env.py
new file mode 100644
index 00000000000..35149a4b804
--- /dev/null
+++ b/.github/scripts/meat/install_copilot_env.py
@@ -0,0 +1,331 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+#!/usr/bin/env python3
+"""Set up the environment needed to run agent scripts from .github/scripts/meat/.
+
+Checks and (where possible) performs:
+ 1. Python version requirement (3.10+)
+ 2. GitHub CLI (gh) installation
+ 3. copilot CLI installation
+ 4. copilot authentication
+
+Run from the openvino repo root:
+ python .github/scripts/meat/install_copilot_env.py
+"""
+
+import json
+import os
+import platform
+import shutil
+import subprocess
+import sys
+from pathlib import Path
+from typing import Optional
+
+REPO_ROOT = Path(__file__).parent.parent.parent
+MIN_PYTHON = (3, 10)
+
+
+# ──────────────────────────────────────────────
+# Helpers
+# ──────────────────────────────────────────────
+
+def ok(msg: str) -> None:
+ print(f" [OK] {msg}")
+
+
+def info(msg: str) -> None:
+ print(f" [..] {msg}")
+
+
+def warn(msg: str) -> None:
+ print(f" [!!] {msg}", file=sys.stderr)
+
+
+def fail(msg: str) -> None:
+ print(f"\n [FAIL] {msg}\n", file=sys.stderr)
+ sys.exit(1)
+
+
+def run(*args, **kwargs):
+ return subprocess.run(list(args), **kwargs)
+
+
+# ──────────────────────────────────────────────
+# Python
+# ──────────────────────────────────────────────
+
+def check_python() -> None:
+ if sys.version_info < MIN_PYTHON:
+ fail(f"Python {MIN_PYTHON[0]}.{MIN_PYTHON[1]}+ required, found {sys.version.split()[0]}")
+ ok(f"Python {sys.version.split()[0]}")
+
+
+# ──────────────────────────────────────────────
+# GitHub CLI (gh)
+# ──────────────────────────────────────────────
+
+def _gh_version() -> Optional[str]:
+ if not shutil.which("gh"):
+ return None
+ try:
+ r = run("gh", "--version", capture_output=True, text=True, timeout=10)
+ line = (r.stdout or "").splitlines()
+ return line[0].strip() if line else "unknown"
+ except Exception:
+ return None
+
+
+def _try_install_gh() -> bool:
+ system = platform.system()
+ if system == "Windows":
+ if shutil.which("winget"):
+ print(
+ "\n winget will accept the GitHub CLI package agreement and the\n"
+ " winget source agreement on your behalf.\n"
+ " Proceed with automatic install? [y/N] ",
+ end="", flush=True,
+ )
+ if input().strip().lower() != "y":
+ return False
+ info("Attempting: winget install --id GitHub.cli --silent …")
+ r = run("winget", "install", "--id", "GitHub.cli", "--silent",
+ "--accept-package-agreements", "--accept-source-agreements")
+ return r.returncode == 0
+ elif system == "Darwin":
+ if shutil.which("brew"):
+ info("Attempting: brew install gh …")
+ r = run("brew", "install", "gh")
+ return r.returncode == 0
+ else: # Linux
+ if shutil.which("apt-get"):
+ info("Attempting apt-based gh install …")
+ cmds = [
+ ["mkdir", "-p", "/etc/apt/keyrings"],
+ ["bash", "-c",
+ "curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg"
+ " -o /etc/apt/keyrings/githubcli-archive-keyring.gpg"],
+ ["chmod", "go+r", "/etc/apt/keyrings/githubcli-archive-keyring.gpg"],
+ ["bash", "-c",
+ "echo \"deb [arch=$(dpkg --print-architecture)"
+ " signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg]"
+ " https://cli.github.com/packages stable main\""
+ " | tee /etc/apt/sources.list.d/github-cli.list > /dev/null"],
+ ["apt-get", "update", "-qq"],
+ ["apt-get", "install", "-y", "--no-install-recommends", "gh"],
+ ]
+ for cmd in cmds:
+ if run(*cmd).returncode != 0:
+ return False
+ return True
+ if shutil.which("dnf"):
+ info("Attempting dnf-based gh install …")
+ cmds = [
+ ["dnf", "config-manager", "--add-repo",
+ "https://cli.github.com/packages/rpm/gh-cli.repo"],
+ ["dnf", "install", "-y", "gh"],
+ ]
+ for cmd in cmds:
+ if run(*cmd).returncode != 0:
+ return False
+ return True
+ return False
+
+
+def _print_gh_install_instructions() -> None:
+ system = platform.system()
+ print("\n GitHub CLI (gh) is not installed. Install it using one of the methods below,\n"
+ " then re-run this script.\n")
+ if system == "Windows":
+ print(" WinGet (recommended):")
+ print(" winget install --id GitHub.cli\n")
+ print(" Manual installer: https://cli.github.com/\n")
+ elif system == "Darwin":
+ print(" Homebrew:")
+ print(" brew install gh\n")
+ else:
+ print(" Debian/Ubuntu: https://github.com/cli/cli/blob/trunk/docs/install_linux.md\n")
+ print(" Fedora/RHEL:")
+ print(" sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo")
+ print(" sudo dnf install gh\n")
+ print(" Docs: https://cli.github.com/\n")
+
+
+def check_gh() -> None:
+ version = _gh_version()
+ if version:
+ ok(f"GitHub CLI {version}")
+ return
+
+ warn("GitHub CLI (gh) not found in PATH.")
+ info("Attempting automatic install …")
+ if _try_install_gh():
+ version = _gh_version()
+ if version:
+ ok(f"GitHub CLI installed: {version}")
+ return
+ warn("Install command succeeded but 'gh' still not in PATH. "
+ "You may need to restart your shell.")
+
+ _print_gh_install_instructions()
+ sys.exit(1)
+
+
+# ──────────────────────────────────────────────
+# copilot CLI
+# ──────────────────────────────────────────────
+
+def _copilot_version() -> Optional[str]:
+ if not shutil.which("copilot"):
+ return None
+ try:
+ r = run("copilot", "version", capture_output=True, text=True, timeout=15)
+ line = (r.stdout or r.stderr or "").splitlines()
+ return line[0].strip() if line else "unknown"
+ except Exception:
+ return None
+
+
+def _try_install_copilot() -> bool:
+ system = platform.system()
+ if system == "Windows":
+ if shutil.which("winget"):
+ print(
+ "\n winget will accept the GitHub Copilot package agreement and the\n"
+ " winget source agreement on your behalf.\n"
+ " Proceed with automatic install? [y/N] ",
+ end="", flush=True,
+ )
+ if input().strip().lower() != "y":
+ return False
+ info("Attempting: winget install GitHub.Copilot --silent …")
+ r = run("winget", "install", "GitHub.Copilot", "--silent",
+ "--accept-package-agreements", "--accept-source-agreements")
+ return r.returncode == 0
+ elif system in ("Darwin", "Linux"):
+ if shutil.which("brew"):
+ info("Attempting: brew install copilot-cli …")
+ r = run("brew", "install", "copilot-cli")
+ return r.returncode == 0
+ return False
+
+
+def _print_copilot_install_instructions() -> None:
+ system = platform.system()
+ print("\n copilot CLI is not installed. Install it using one of the methods below,\n"
+ " then re-run this script.\n")
+ if system == "Windows":
+ print(" WinGet:")
+ print(" winget install GitHub.Copilot\n")
+ else:
+ print(" Homebrew:")
+ print(" brew install copilot-cli\n")
+ print(" Docs: https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started\n")
+
+
+def check_copilot() -> None:
+ version = _copilot_version()
+ if version:
+ ok(f"copilot CLI {version}")
+ return
+
+ warn("copilot CLI not found in PATH.")
+ info("Attempting automatic install …")
+ if _try_install_copilot():
+ version = _copilot_version()
+ if version:
+ ok(f"copilot CLI installed: {version}")
+ return
+ warn("Install command succeeded but 'copilot' still not in PATH. "
+ "You may need to restart your shell.")
+
+ _print_copilot_install_instructions()
+ sys.exit(1)
+
+
+# ──────────────────────────────────────────────
+# Authentication
+# ──────────────────────────────────────────────
+
+def _token_in_env() -> Optional[str]:
+ for var in ("COPILOT_GITHUB_TOKEN", "GH_TOKEN", "GITHUB_TOKEN"):
+ if os.environ.get(var):
+ return var
+ return None
+
+
+def _token_stored() -> bool:
+ cfg = Path.home() / ".copilot" / "config.json"
+ if not cfg.exists():
+ return False
+ try:
+ data = json.loads(cfg.read_text(encoding="utf-8"))
+ return bool(data.get("token") or data.get("githubToken") or data.get("auth"))
+ except Exception:
+ return cfg.stat().st_size > 64
+
+
+def _print_token_hint() -> None:
+ print("\n Alternatively, set a Personal Access Token with 'copilot' scope:\n")
+ print(" Linux / macOS – add to ~/.bashrc or ~/.zshrc:")
+ print(" export COPILOT_GITHUB_TOKEN=ghp_<your-token>\n")
+ print(" Windows PowerShell – add to $PROFILE:")
+ print(" $env:COPILOT_GITHUB_TOKEN = 'ghp_<your-token>'\n")
+ print(" Token scopes needed: read:user, copilot\n")
+ print(" Create one at: https://github.com/settings/tokens\n")
+
+
+def check_auth() -> None:
+ var = _token_in_env()
+ if var:
+ ok(f"Auth via ${var}")
+ return
+
+ if _token_stored():
+ ok("Auth: stored credentials found (~/.copilot/config.json)")
+ return
+
+ warn("No authentication found.")
+ info("Starting 'copilot login' – follow the prompts in your browser.\n")
+ try:
+ result = run("copilot", "login")
+ if result.returncode != 0:
+ warn("'copilot login' exited with an error.")
+ _print_token_hint()
+ sys.exit(1)
+ ok("Authentication complete.")
+ except KeyboardInterrupt:
+ print()
+ warn("Login cancelled.")
+ _print_token_hint()
+ sys.exit(1)
+ except FileNotFoundError:
+ fail("'copilot' command not found – install it first (step above).")
+
+
+# ──────────────────────────────────────────────
+# Python deps
+# ──────────────────────────────────────────────
+# Entry point
+# ──────────────────────────────────────────────
+
+def main() -> None:
+ print("\n=== OpenVINO agent scripts – Environment Setup ===\n")
+
+ check_python()
+ check_gh()
+ check_copilot()
+ check_auth()
+
+ print(
+ "\n All checks passed. You can now run agent scripts.\n"
+ " Example:\n"
+ " python .github/scripts/meat/enable_operator.py my_op.md\n"
+ "\n"
+ " See .github/scripts/meat/README.md for full usage.\n"
+ )
+
+
+if __name__ == "__main__":
+ main()
diff --git a/.github/scripts/meat/probe_model.py b/.github/scripts/meat/probe_model.py
new file mode 100644
index 00000000000..168844f3669
--- /dev/null
+++ b/.github/scripts/meat/probe_model.py
@@ -0,0 +1,252 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+#!/usr/bin/env python3
+"""Probe-model step for the analyze-and-convert agent.
+
+First step in the analyze-and-convert workflow. Probes a HuggingFace model
+to collect its full profile and writes model_profile.json consumed by all
+subsequent skills.
+
+Usage:
+ python .github/scripts/meat/probe_model.py <model_id>
+
+ MODEL_ID env var is also accepted as a fallback.
+
+Output files (current working directory):
+ model_profile.json
+"""
+
+import json
+import os
+import pathlib
+import sys
+
+# ---------------------------------------------------------------------------
+# Resolve MODEL_ID
+# ---------------------------------------------------------------------------
+
+if len(sys.argv) >= 2:
+ MODEL_ID = sys.argv[1]
+else:
+ MODEL_ID = os.environ.get("MODEL_ID", "")
+
+if not MODEL_ID:
+ print(
+ "Usage: probe_model.py <model_id> OR set MODEL_ID env var",
+ file=sys.stderr,
+ )
+ sys.exit(1)
+
+print(f"[probe_model] Probing model: {MODEL_ID}")
+
+# ---------------------------------------------------------------------------
+# Step 1 — Fetch HuggingFace metadata
+# ---------------------------------------------------------------------------
+
+try:
+ import requests # type: ignore
+
+ HF_API = "https://huggingface.co/api/models"
+ resp = requests.get(f"{HF_API}/{MODEL_ID}", timeout=30)
+ meta = resp.json() if resp.ok else {}
+ if not resp.ok:
+ print(f"[probe_model] HF API returned {resp.status_code} — metadata will be empty",
+ file=sys.stderr)
+except Exception as exc: # noqa: BLE001
+ print(f"[probe_model] WARNING: could not fetch HF metadata: {exc}", file=sys.stderr)
+ meta = {}
+
+print("pipeline_tag :", meta.get("pipeline_tag"))
+print("library_name :", meta.get("library_name"))
+print("tags :", meta.get("tags", []))
+
+# ---------------------------------------------------------------------------
+# Step 2 — Load and inspect config
+# ---------------------------------------------------------------------------
+
+try:
+ from transformers import AutoConfig # type: ignore
+
+ cfg = AutoConfig.from_pretrained(MODEL_ID, trust_remote_code=False)
+ cfg_dict = cfg.to_dict()
+except Exception as exc: # noqa: BLE001
+ print(f"[probe_model] WARNING: AutoConfig failed (trust_remote_code=False): {exc}",
+ file=sys.stderr)
+ cfg = None
+ cfg_dict = {}
+
+if cfg is not None:
+ print("model_type :", cfg.model_type)
+ print("architectures :", cfg.architectures)
+ print("hidden_size :", getattr(cfg, "hidden_size", "N/A"))
+ print("num_hidden_layers :", getattr(cfg, "num_hidden_layers", "N/A"))
+ print("num_attention_heads :", getattr(cfg, "num_attention_heads", "N/A"))
+ print("num_key_value_heads :", getattr(cfg, "num_key_value_heads", "N/A"))
+ print("vocab_size :", getattr(cfg, "vocab_size", "N/A"))
+ print("max_position_embeds :", getattr(cfg, "max_position_embeddings", "N/A"))
+
+_SPECIAL_KEYWORDS = [
+ "layer_type", "ssm", "mamba", "rwkv", "moe", "expert", "conv",
+ "recurrent", "delta", "vision", "image", "video", "mm_", "vlm",
+ "audio", "cross_attn", "sliding", "hybrid", "flash", "rope",
+ "alibi", "custom_code",
+]
+special_keys = [
+ k for k in cfg_dict
+ if any(kw in k.lower() for kw in _SPECIAL_KEYWORDS)
+]
+for k in special_keys:
+ print(f" {k}: {cfg_dict[k]}")
+
+# ---------------------------------------------------------------------------
+# Step 3 — Estimate parameter count
+# ---------------------------------------------------------------------------
+
+def estimate_params(cfg) -> int:
+ h = getattr(cfg, "hidden_size", 0)
+ layers = getattr(cfg, "num_hidden_layers", 0)
+ vocab = getattr(cfg, "vocab_size", 0)
+ intermediate = getattr(cfg, "intermediate_size", h * 4)
+ heads = getattr(cfg, "num_attention_heads", 1)
+ kv_heads = getattr(cfg, "num_key_value_heads", heads)
+
+ attn = h * h + (kv_heads * (h // heads if heads else 1)) * 2 * h + h * h
+ ffn = h * intermediate * 3 if hasattr(cfg, "mlp_bias") else h * intermediate * 2
+ embed = vocab * h * 2
+ per_layer = attn + ffn
+ return layers * per_layer + embed
+
+
+est = estimate_params(cfg) if cfg is not None else 0
+print(f"[probe_model] Estimated params: ~{est / 1e9:.1f}B")
+
+# ---------------------------------------------------------------------------
+# Step 4 — Check trust_remote_code requirement
+# ---------------------------------------------------------------------------
+
+trust_remote_code_required = False
+if cfg is None:
+ # AutoConfig already failed without trust_remote_code — check whether it
+ # succeeds with it to distinguish "needs trust_rc" from "broken model".
+ try:
+ from transformers import AutoConfig # type: ignore # noqa: F811
+
+ AutoConfig.from_pretrained(MODEL_ID, trust_remote_code=True)
+ trust_remote_code_required = True
+ # Re-load cfg with trust_remote_code for subsequent steps
+ cfg = AutoConfig.from_pretrained(MODEL_ID, trust_remote_code=True)
+ cfg_dict = cfg.to_dict()
+ est = estimate_params(cfg)
+ except Exception: # noqa: BLE001
+ pass
+else:
+ try:
+ from transformers import AutoConfig # type: ignore # noqa: F811
+
+ AutoConfig.from_pretrained(MODEL_ID, trust_remote_code=False)
+ except Exception as exc: # noqa: BLE001
+ if "trust_remote_code" in str(exc) or "custom code" in str(exc).lower():
+ trust_remote_code_required = True
+
+print("trust_remote_code required:", trust_remote_code_required)
+
+# ---------------------------------------------------------------------------
+# Step 5 — Inspect tokenizer config
+# ---------------------------------------------------------------------------
+
+tokenizer_info = {}
+try:
+ from transformers import AutoTokenizer # type: ignore
+
+ tok = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
+ tokenizer_info = {
+ "tokenizer_class": type(tok).__name__,
+ "is_fast": tok.is_fast,
+ "vocab_size": tok.vocab_size,
+ "chat_template": "present" if tok.chat_template else "absent",
+ }
+ for k, v in tokenizer_info.items():
+ print(f"{'tokenizer_' if 'tokenizer' not in k else ''}{k:<20}: {v}")
+except Exception as exc: # noqa: BLE001
+ print(f"[probe_model] WARNING: tokenizer load error: {exc}", file=sys.stderr)
+
+# ---------------------------------------------------------------------------
+# Step 6 — Detect multimodal / VLM signals
+# ---------------------------------------------------------------------------
+
+# cfg may have been re-loaded with trust_remote_code above; reload once more
+# with trust_remote_code=True to get full config for VLM detection.
+try:
+ from transformers import AutoConfig # type: ignore # noqa: F811
+
+ cfg_full = AutoConfig.from_pretrained(MODEL_ID, trust_remote_code=True)
+except Exception: # noqa: BLE001
+ cfg_full = cfg
+
+vlm_signals = {}
+if cfg_full is not None:
+ vlm_signals = {
+ "vision_config": hasattr(cfg_full, "vision_config"),
+ "image_token_id": hasattr(cfg_full, "image_token_id"),
+ "video_token_id": hasattr(cfg_full, "video_token_id"),
+ "mm_projector": hasattr(cfg_full, "mm_projector_type"),
+ "audio_config": hasattr(cfg_full, "audio_config"),
+ }
+
+is_vlm = any(vlm_signals.values())
+print("VLM signals:", vlm_signals)
+print("Is VLM:", is_vlm)
+
+# ---------------------------------------------------------------------------
+# Step 7 — Check optimum-intel support
+# ---------------------------------------------------------------------------
+
+optimum_supported = False
+optimum_supported_tasks = []
+if cfg is not None:
+ model_type = getattr(cfg, "model_type", "")
+ try:
+ from optimum.exporters.tasks import TasksManager # type: ignore
+
+ supported_tasks = TasksManager.get_supported_tasks_for_model_type(
+ model_type, "openvino"
+ )
+ print(f"[probe_model] optimum-intel knows model_type='{model_type}': YES")
+ print("Supported tasks:", supported_tasks)
+ optimum_supported = True
+ optimum_supported_tasks = list(supported_tasks)
+ except KeyError:
+ print(f"[probe_model] optimum-intel does NOT know model_type='{model_type}'")
+ except ImportError:
+ print("[probe_model] WARNING: optimum not installed — skipping optimum check",
+ file=sys.stderr)
+
+# ---------------------------------------------------------------------------
+# Step 8 — Write model_profile.json
+# ---------------------------------------------------------------------------
+
+profile = {
+ "model_id": MODEL_ID,
+ "model_type": getattr(cfg, "model_type", None) if cfg else None,
+ "architectures": getattr(cfg, "architectures", None) if cfg else None,
+ "pipeline_tag": meta.get("pipeline_tag"),
+ "library_name": meta.get("library_name"),
+ "estimated_params_b": round(est / 1e9, 1),
+ "hidden_size": getattr(cfg, "hidden_size", None) if cfg else None,
+ "num_layers": getattr(cfg, "num_hidden_layers", None) if cfg else None,
+ "vocab_size": getattr(cfg, "vocab_size", None) if cfg else None,
+ "trust_remote_code_required": trust_remote_code_required,
+ "is_vlm": is_vlm,
+ "vlm_signals": vlm_signals,
+ "optimum_supported": optimum_supported,
+ "optimum_supported_tasks": optimum_supported_tasks,
+ "special_config_keys": special_keys,
+ "hf_tags": meta.get("tags", []),
+ **tokenizer_info,
+}
+
+pathlib.Path("model_profile.json").write_text(
+ json.dumps(profile, indent=2), encoding="utf-8"
+)
+print("[probe_model] Written: model_profile.json")
diff --git a/.github/scripts/meat/run_agent.py b/.github/scripts/meat/run_agent.py
new file mode 100644
index 00000000000..58de781b6c0
--- /dev/null
+++ b/.github/scripts/meat/run_agent.py
@@ -0,0 +1,107 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+#!/usr/bin/env python3
+"""Run any OpenVINO coding agent from .github/agents-prototype/.
+
+Usage:
+ python .github/scripts/meat/run_agent.py <agent-name> <context-file>
+ python .github/scripts/meat/run_agent.py --list
+
+Run from the openvino repo root.
+
+Output goes to agent-results/<agent-name>/ in the working directory:
+ session.md — full agent session transcript
+ patches/ — generated .patch files ready to apply
+ pipeline_state.json — shared state read/written by all agents
+
+Copilot CLI reference:
+ https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference
+"""
+
+import os
+import subprocess
+import sys
+
+AGENTS = [
+ "enable-operator",
+ "frontend",
+ "core-opspec",
+ "transformation",
+ "cpu",
+ "gpu",
+ "deployer",
+ "analyze-and-convert",
+]
+
+_WARN = (
+ "\n"
+ " ╔══════════════════════════════════════════════════════════════════╗\n"
+ " ║ WARNING: AUTONOMOUS / UNATTENDED MODE ║\n"
+ " ║ ║\n"
+ " ║ This script runs GitHub Copilot with --no-ask-user and ║\n"
+ " ║ --autopilot. The agent will READ, CREATE, and MODIFY files ║\n"
+ " ║ in this repository WITHOUT asking for confirmation. ║\n"
+ " ║ ║\n"
+ " ║ Review agent-results/ after the run and apply patches with ║\n"
+ " ║ 'git apply' — do NOT blindly commit generated changes. ║\n"
+ " ╚══════════════════════════════════════════════════════════════════╝\n"
+)
+
+
+def main() -> None:
+ if len(sys.argv) == 2 and sys.argv[1] in ("--list", "-l"):
+ print("Available agents:")
+ for name in AGENTS:
+ print(f" {name}")
+ sys.exit(0)
+
+ if len(sys.argv) != 3:
+ print(
+ f"Usage: {sys.argv[0]} <agent-name> <context-file>\n"
+ f" {sys.argv[0]} --list",
+ file=sys.stderr,
+ )
+ sys.exit(1)
+
+ agent_name = sys.argv[1]
+ context_file_path = sys.argv[2]
+ agent_file = f".github/agents-prototype/{agent_name}.agent.md"
+
+ if not os.path.isfile(context_file_path):
+ print(f"Error: context file not found: {context_file_path}", file=sys.stderr)
+ sys.exit(1)
+
+ if not os.path.isfile(agent_file):
+ print(
+ f"Error: agent file not found: {agent_file}\n"
+ "Make sure you are running from the openvino repo root.\n"
+ f"Available agents: {', '.join(AGENTS)}",
+ file=sys.stderr,
+ )
+ sys.exit(1)
+
+ output_dir = f"agent-results/{agent_name}"
+ os.makedirs(output_dir, exist_ok=True)
+
+ with open(context_file_path) as f:
+ prompt = f.read()
+
+ print(_WARN, flush=True)
+
+ cmd = [
+ "copilot",
+ "--agent", agent_name,
+ "--share", f"{output_dir}/session.md",
+ "--no-ask-user",
+ "--autopilot",
+ "--stream", "on",
+ "--log-level", "all",
+ "-p", prompt,
+ ]
+
+ sys.exit(subprocess.run(cmd, shell=(sys.platform == "win32")).returncode)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/.github/scripts/meat/tests/conftest.py b/.github/scripts/meat/tests/conftest.py
new file mode 100644
index 00000000000..c3a2b92488f
--- /dev/null
+++ b/.github/scripts/meat/tests/conftest.py
@@ -0,0 +1,108 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+"""Shared fixtures and helpers for meat-scripts test suite."""
+
+import json
+import os
+import pathlib
+import sys
+import textwrap
+
+import pytest
+
+SCRIPTS_DIR = pathlib.Path(__file__).parent.parent
+
+
+# ---------------------------------------------------------------------------
+# Low-level helpers
+# ---------------------------------------------------------------------------
+
+def run_script(script: pathlib.Path, cwd, *args, extra_env=None):
+ """Run a Python script as a subprocess, return CompletedProcess."""
+ import subprocess
+
+ env = os.environ.copy()
+ if extra_env:
+ env.update(extra_env)
+ return subprocess.run(
+ [sys.executable, str(script), *args],
+ capture_output=True,
+ text=True,
+ cwd=str(cwd),
+ env=env,
+ )
+
+
+def write_json(path: pathlib.Path, data) -> None:
+ path.parent.mkdir(parents=True, exist_ok=True)
+ path.write_text(json.dumps(data, indent=2), encoding="utf-8")
+
+
+# ---------------------------------------------------------------------------
+# Cross-platform fake-command factory
+#
+# Creates a callable named `name` in `bin_dir` that runs a small Python
+# script. On Windows a .bat wrapper is written; on POSIX a shell script.
+# ---------------------------------------------------------------------------
+
+def _make_stub_impl(bin_dir: pathlib.Path, name: str, body: str) -> pathlib.Path:
+ """Write the Python implementation and a platform launcher."""
+ impl = bin_dir / f"_stub_{name}.py"
+ impl.write_text(body, encoding="utf-8")
+
+ if sys.platform == "win32":
+ launcher = bin_dir / f"{name}.bat"
+ launcher.write_text(
+ f'@"{sys.executable}" "{impl}" %*\r\n',
+ encoding="utf-8",
+ )
+ else:
+ launcher = bin_dir / name
+ launcher.write_text(
+ f'#!/bin/sh\nexec python3 "{impl}" "$@"\n',
+ encoding="utf-8",
+ )
+ launcher.chmod(0o755)
+
+ return launcher
+
+
+def make_fake_cmd(bin_dir: pathlib.Path, name: str, *,
+ exit_code: int = 0,
+ create_ir: bool = False,
+ stdout_text: str = "") -> None:
+ """
+ Create a fake ``name`` command in ``bin_dir``.
+
+ Parameters
+ ----------
+ exit_code : int
+ Return code the stub will produce.
+ create_ir : bool
+ If True, the stub creates .xml/.bin files in the directory
+ given by the ``--output <dir>`` argument.
+ stdout_text : str
+ Text to print to stdout before exiting.
+ """
+ body = textwrap.dedent(f"""\
+ import sys, pathlib
+ if {stdout_text!r}:
+ print({stdout_text!r})
+ args = sys.argv
+ if {create_ir!r} and "--output" in args:
+ out_idx = args.index("--output") + 1
+ out = pathlib.Path(args[out_idx])
+ out.mkdir(parents=True, exist_ok=True)
+ (out / "openvino_model.xml").write_text("<xml/>")
+ (out / "openvino_model.bin").write_bytes(b"")
+ sys.exit({exit_code})
+ """)
+ _make_stub_impl(bin_dir, name, body)
+
+
+def patched_env(bin_dir: pathlib.Path, base: dict | None = None) -> dict:
+ """Return an env dict with *bin_dir* prepended to PATH."""
+ env = (base or os.environ).copy()
+ env["PATH"] = str(bin_dir) + os.pathsep + env.get("PATH", "")
+ return env
diff --git a/.github/scripts/meat/tests/test_build_report.py b/.github/scripts/meat/tests/test_build_report.py
new file mode 100644
index 00000000000..4b18c1cb5db
--- /dev/null
+++ b/.github/scripts/meat/tests/test_build_report.py
@@ -0,0 +1,364 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+"""Tests for build_report.py.
+
+Covers:
+ - Status determination (success / partial / failed)
+ - All five output artefacts are produced
+ - conversion_report.md contains all required sections
+ - analyse_and_convert_result.json schema
+ - agent-complete marker: present, well-formed JSON, correct field values
+ - Missing input files → graceful degradation (no crash, outputs still written)
+ - No gh CLI invoked when PR_NUMBER / ISSUE_NUMBER are absent
+"""
+
+import json
+import os
+import pathlib
+import re
+
+import pytest
+
+from conftest import SCRIPTS_DIR, run_script, write_json
+
+SCRIPT = SCRIPTS_DIR / "build_report.py"
+OUT_DIR = pathlib.Path("agent-results") / "analyze-and-convert"
+
+
+# ---------------------------------------------------------------------------
+# Helpers
+# ---------------------------------------------------------------------------
+
+_DEFAULT_PROFILE = {
+ "model_id": "test/my-model",
+ "model_type": "llama",
+ "architectures": ["LlamaForCausalLM"],
+ "pipeline_tag": "text-generation",
+ "estimated_params_b": 7.0,
+ "is_vlm": False,
+ "trust_remote_code_required": False,
+}
+
+_DEFAULT_SIGNALS = {
+ "error_class": "missing_conversion_rule",
+ "target_agent": "enable-operator",
+ "requires_optimum_new_arch": False,
+ "requires_transformers_upgrade": False,
+ "transformers_override": "",
+ "requires_tokenizer_check": False,
+ "is_vlm": False,
+ "custom_ops_suspected": False,
+ "oom_suspected": False,
+}
+
+_FAILED_ATTEMPT = {
+ "id": "A-fp16-stable",
+ "description": "fp16 stable",
+ "weight_format": "fp16",
+ "optimum_version": "stable",
+ "success": False,
+ "returncode": 1,
+ "elapsed_s": 10.0,
+ "stdout": "",
+ "stderr": "RuntimeError: no rule for aten::erfinv",
+}
+
+_SUCCESS_ATTEMPT = {
+ "id": "A-fp16-stable",
+ "description": "fp16 stable",
+ "weight_format": "fp16",
+ "optimum_version": "stable",
+ "success": True,
+ "returncode": 0,
+ "elapsed_s": 8.0,
+ "stdout": "Export done",
+ "stderr": "",
+ "ir_files": ["openvino_model.xml", "openvino_model.bin"],
+ "ir_dir": "ov_model_A",
+}
+
+
+def _setup(tmp_path, *, attempts=None, signals=None, profile=None, excerpts=None):
+ write_json(tmp_path / "model_profile.json", profile or _DEFAULT_PROFILE)
+ write_json(tmp_path / "routing_signals.json", signals or _DEFAULT_SIGNALS)
+ write_json(tmp_path / "conversion_attempts.json", attempts if attempts is not None else [_FAILED_ATTEMPT])
+ write_json(tmp_path / "error_excerpts.json", excerpts or {})
+
+
+def _run(tmp_path, **kwargs):
+ """Run build_report.py with PR_NUMBER/ISSUE_NUMBER unset to suppress gh calls."""
+ env = os.environ.copy()
+ env.pop("PR_NUMBER", None)
+ env.pop("ISSUE_NUMBER", None)
+ return run_script(SCRIPT, tmp_path, extra_env=env)
+
+
+def _report(tmp_path) -> str:
+ return (tmp_path / OUT_DIR / "conversion_report.md").read_text(encoding="utf-8")
+
+
+def _result(tmp_path) -> dict:
+ return json.loads((tmp_path / OUT_DIR / "analyze_and_convert_result.json").read_text(encoding="utf-8"))
+
+
+def _marker(stdout: str) -> dict:
+ """Parse the <!-- agent-complete ... --> block from stdout."""
+ m = re.search(r"<!-- agent-complete\s*(\{.*?\})\s*-->", stdout, re.DOTALL)
+ assert m, f"agent-complete marker not found in stdout:\n{stdout}"
+ return json.loads(m.group(1))
+
+
+# ---------------------------------------------------------------------------
+# Status determination
+# ---------------------------------------------------------------------------
+
+def test_status_failed_when_all_attempts_failed(tmp_path):
+ _setup(tmp_path)
+ _run(tmp_path)
+ assert _result(tmp_path)["status"] == "failed"
+
+
+def test_status_success_when_one_attempt_succeeded(tmp_path):
+ _setup(tmp_path, attempts=[_SUCCESS_ATTEMPT])
+ _run(tmp_path)
+ assert _result(tmp_path)["status"] == "success"
+
+
+def test_status_failed_when_no_attempts_at_all(tmp_path):
+ _setup(tmp_path, attempts=[])
+ _run(tmp_path)
+ assert _result(tmp_path)["status"] == "failed"
+
+
+# ---------------------------------------------------------------------------
+# Output files are produced
+# ---------------------------------------------------------------------------
+
+def test_conversion_report_md_is_written(tmp_path):
+ _setup(tmp_path)
+ _run(tmp_path)
+ assert (tmp_path / OUT_DIR / "conversion_report.md").exists()
+
+
+def test_result_json_is_written(tmp_path):
+ _setup(tmp_path)
+ _run(tmp_path)
+ assert (tmp_path / OUT_DIR / "analyze_and_convert_result.json").exists()
+
+
+def test_output_dir_is_created_automatically(tmp_path):
+ _setup(tmp_path)
+ _run(tmp_path)
+ assert (tmp_path / OUT_DIR).is_dir()
+
+
+# ---------------------------------------------------------------------------
+# result JSON schema
+# ---------------------------------------------------------------------------
+
+def test_result_json_required_fields(tmp_path):
+ _setup(tmp_path)
+ _run(tmp_path)
+ d = _result(tmp_path)
+ for field in ("agent", "status", "model_id", "error_class", "target_agent", "routing_signals"):
+ assert field in d, f"Missing field: {field!r}"
+
+
+def test_result_json_agent_name(tmp_path):
+ _setup(tmp_path)
+ _run(tmp_path)
+ assert _result(tmp_path)["agent"] == "analyze-and-convert"
+
+
+def test_result_json_model_id_matches_profile(tmp_path):
+ _setup(tmp_path)
+ _run(tmp_path)
+ assert _result(tmp_path)["model_id"] == "test/my-model"
+
+
+def test_result_json_error_class_matches_signals(tmp_path):
+ _setup(tmp_path)
+ _run(tmp_path)
+ assert _result(tmp_path)["error_class"] == "missing_conversion_rule"
+
+
+def test_result_json_target_agent_matches_signals(tmp_path):
+ _setup(tmp_path)
+ _run(tmp_path)
+ assert _result(tmp_path)["target_agent"] == "enable-operator"
+
+
+def test_result_json_routing_signals_subset(tmp_path):
+ """routing_signals in result JSON must only contain known signal keys."""
+ _setup(tmp_path)
+ _run(tmp_path)
+ allowed = {
+ "requires_optimum_new_arch", "requires_transformers_upgrade",
+ "transformers_override", "requires_tokenizer_check",
+ "trust_remote_code_required", "is_vlm",
+ "custom_ops_suspected", "oom_suspected",
+ }
+ actual = set(_result(tmp_path)["routing_signals"].keys())
+ assert actual <= allowed, f"Unexpected keys in routing_signals: {actual - allowed}"
+
+
+# ---------------------------------------------------------------------------
+# conversion_report.md content
+# ---------------------------------------------------------------------------
+
+def test_report_contains_model_id(tmp_path):
+ _setup(tmp_path)
+ _run(tmp_path)
+ assert "test/my-model" in _report(tmp_path)
+
+
+def test_report_has_model_profile_section(tmp_path):
+ _setup(tmp_path)
+ _run(tmp_path)
+ assert "Model Profile" in _report(tmp_path)
+
+
+def test_report_has_conversion_attempts_section(tmp_path):
+ _setup(tmp_path)
+ _run(tmp_path)
+ assert "Conversion Attempts" in _report(tmp_path)
+
+
+def test_report_has_routing_signals_section(tmp_path):
+ _setup(tmp_path)
+ _run(tmp_path)
+ assert "Routing Signals" in _report(tmp_path)
+
+
+def test_report_has_recommended_next_step_section(tmp_path):
+ _setup(tmp_path)
+ _run(tmp_path)
+ assert "Recommended Next Step" in _report(tmp_path)
+
+
+def test_report_contains_error_class(tmp_path):
+ _setup(tmp_path)
+ _run(tmp_path)
+ assert "missing_conversion_rule" in _report(tmp_path)
+
+
+def test_report_has_failure_details_when_failed(tmp_path):
+ excerpts = {"A-fp16-stable": "Traceback (most recent call last):\n RuntimeError: no rule"}
+ _setup(tmp_path, excerpts=excerpts)
+ _run(tmp_path)
+ assert "Failure Details" in _report(tmp_path)
+
+
+def test_report_no_failure_section_when_succeeded(tmp_path):
+ _setup(tmp_path, attempts=[_SUCCESS_ATTEMPT])
+ _run(tmp_path)
+ assert "Failure Details" not in _report(tmp_path)
+
+
+def test_report_has_successful_strategy_section_on_success(tmp_path):
+ _setup(tmp_path, attempts=[_SUCCESS_ATTEMPT])
+ _run(tmp_path)
+ assert "Successful Strategy" in _report(tmp_path)
+
+
+# ---------------------------------------------------------------------------
+# agent-complete marker
+# ---------------------------------------------------------------------------
+
+def test_agent_complete_marker_present_in_stdout(tmp_path):
+ _setup(tmp_path)
+ result = _run(tmp_path)
+ assert "<!-- agent-complete" in result.stdout
+ assert "-->" in result.stdout
+
+
+def test_agent_complete_marker_is_valid_json(tmp_path):
+ _setup(tmp_path)
+ result = _run(tmp_path)
+ _marker(result.stdout) # asserts internally
+
+
+def test_agent_complete_has_all_required_fields(tmp_path):
+ _setup(tmp_path)
+ result = _run(tmp_path)
+ m = _marker(result.stdout)
+ for field in ("agent", "status", "next_agent", "error_class", "model_id", "next_context"):
+ assert field in m, f"Missing field in agent-complete: {field!r}"
+
+
+def test_agent_complete_agent_name_correct(tmp_path):
+ _setup(tmp_path)
+ result = _run(tmp_path)
+ assert _marker(result.stdout)["agent"] == "analyze-and-convert"
+
+
+def test_agent_complete_status_failed(tmp_path):
+ _setup(tmp_path)
+ result = _run(tmp_path)
+ assert _marker(result.stdout)["status"] == "failed"
+
+
+def test_agent_complete_status_success(tmp_path):
+ _setup(tmp_path, attempts=[_SUCCESS_ATTEMPT])
+ result = _run(tmp_path)
+ assert _marker(result.stdout)["status"] == "success"
+
+
+def test_agent_complete_next_agent_matches_signals(tmp_path):
+ _setup(tmp_path)
+ result = _run(tmp_path)
+ assert _marker(result.stdout)["next_agent"] == "enable-operator"
+
+
+def test_agent_complete_model_id_correct(tmp_path):
+ _setup(tmp_path)
+ result = _run(tmp_path)
+ assert _marker(result.stdout)["model_id"] == "test/my-model"
+
+
+# ---------------------------------------------------------------------------
+# Resilience: missing inputs
+# ---------------------------------------------------------------------------
+
+def test_missing_all_inputs_does_not_crash(tmp_path):
+ """Script must produce outputs even with zero input files."""
+ result = _run(tmp_path)
+ assert result.returncode == 0
+ assert (tmp_path / OUT_DIR / "conversion_report.md").exists()
+ assert (tmp_path / OUT_DIR / "analyze_and_convert_result.json").exists()
+ assert "<!-- agent-complete" in result.stdout
+
+
+def test_missing_excerpts_does_not_crash(tmp_path):
+ _setup(tmp_path)
+ (tmp_path / "error_excerpts.json").unlink()
+ result = _run(tmp_path)
+ assert result.returncode == 0
+
+
+def test_missing_signals_does_not_crash(tmp_path):
+ _setup(tmp_path)
+ (tmp_path / "routing_signals.json").unlink()
+ result = _run(tmp_path)
+ assert result.returncode == 0
+
+
+def test_corrupted_json_input_does_not_crash(tmp_path):
+ _setup(tmp_path)
+ (tmp_path / "model_profile.json").write_text("{invalid json", encoding="utf-8")
+ result = _run(tmp_path)
+ assert result.returncode == 0
+
+
+# ---------------------------------------------------------------------------
+# gh CLI: must NOT be called when env vars absent
+# ---------------------------------------------------------------------------
+
+def test_no_gh_invocation_without_pr_or_issue_number(tmp_path):
+ _setup(tmp_path)
+ result = _run(tmp_path)
+ # The script should log that it is skipping — verify no unexpected exit
+ assert result.returncode == 0
+ # "skipping" message confirms gh was not invoked
+ assert "skipping" in result.stdout.lower() or "No PR_NUMBER" in result.stdout
diff --git a/.github/scripts/meat/tests/test_check_subagent_results.py b/.github/scripts/meat/tests/test_check_subagent_results.py
new file mode 100644
index 00000000000..8b09dc47c34
--- /dev/null
+++ b/.github/scripts/meat/tests/test_check_subagent_results.py
@@ -0,0 +1,141 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+"""Tests for check_subagent_results.py.
+
+The script scans five hard-coded result JSON files and exits 1 if ANY of them:
+ - carries status == "failed"
+ - has test_results containing the word "FAILED"
+ - contains malformed JSON
+
+Missing files are silently skipped (not present ≠ failed).
+
+Exit 0 + "PASS" message means every present file is healthy.
+"""
+
+import json
+import pathlib
+
+import pytest
+
+from conftest import SCRIPTS_DIR, run_script, write_json
+
+SCRIPT = SCRIPTS_DIR / "check_subagent_results.py"
+
+RESULT_PATHS = [
+ "agent-results/frontend/fe_result.json",
+ "agent-results/core-opspec/core_opspec_result.json",
+ "agent-results/transformation/transformation_result.json",
+ "agent-results/cpu/cpu_result.json",
+ "agent-results/gpu/gpu_result.json",
+]
+
+
+def _run(tmp_path):
+ return run_script(SCRIPT, tmp_path)
+
+
+def _write(tmp_path, rel_path, data):
+ write_json(tmp_path / rel_path, data)
+
+
+# ---------------------------------------------------------------------------
+# No files present
+# ---------------------------------------------------------------------------
+
+def test_no_files_exits_zero(tmp_path):
+ result = _run(tmp_path)
+ assert result.returncode == 0
+
+
+def test_no_files_prints_pass(tmp_path):
+ result = _run(tmp_path)
+ assert "PASS" in result.stdout
+
+
+# ---------------------------------------------------------------------------
+# All files present and healthy → exit 0
+# ---------------------------------------------------------------------------
+
+def test_all_passing_exits_zero(tmp_path):
+ for p in RESULT_PATHS:
+ _write(tmp_path, p, {"status": "success", "test_results": "5 passed"})
+ assert _run(tmp_path).returncode == 0
+
+
+# ---------------------------------------------------------------------------
+# status == "failed" in any file → exit 1
+# ---------------------------------------------------------------------------
+
[email protected]("path", RESULT_PATHS)
+def test_failed_status_in_one_file_exits_one(tmp_path, path):
+ """Any result file with status=failed is sufficient to exit 1."""
+ _write(tmp_path, path, {"status": "failed"})
+ assert _run(tmp_path).returncode == 1
+
+
+def test_failed_status_message_printed_to_stdout(tmp_path):
+ _write(tmp_path, RESULT_PATHS[0], {"status": "failed"})
+ result = _run(tmp_path)
+ assert "FAIL" in result.stdout.upper()
+
+
+def test_mixed_pass_and_fail_exits_one(tmp_path):
+ _write(tmp_path, RESULT_PATHS[0], {"status": "success"})
+ _write(tmp_path, RESULT_PATHS[1], {"status": "failed"})
+ assert _run(tmp_path).returncode == 1
+
+
+# ---------------------------------------------------------------------------
+# "FAILED" in test_results → exit 1
+# ---------------------------------------------------------------------------
+
+def test_failed_word_in_test_results_exits_one(tmp_path):
+ _write(tmp_path, RESULT_PATHS[2], {"status": "success", "test_results": "3 FAILED, 7 passed"})
+ assert _run(tmp_path).returncode == 1
+
+
+def test_failed_lowercase_in_test_results_exits_one(tmp_path):
+ """Case-insensitive: 'failed' also triggers exit 1."""
+ _write(tmp_path, RESULT_PATHS[3], {"status": "success", "test_results": "1 failed"})
+ assert _run(tmp_path).returncode == 1
+
+
+def test_no_failed_word_in_test_results_exits_zero(tmp_path):
+ _write(tmp_path, RESULT_PATHS[0], {"status": "success", "test_results": "10 passed, 0 skipped"})
+ assert _run(tmp_path).returncode == 0
+
+
+# ---------------------------------------------------------------------------
+# Malformed JSON → exit 1
+# ---------------------------------------------------------------------------
+
+def test_malformed_json_exits_one(tmp_path):
+ p = tmp_path / RESULT_PATHS[0]
+ p.parent.mkdir(parents=True, exist_ok=True)
+ p.write_text("{not valid json!!!", encoding="utf-8")
+ assert _run(tmp_path).returncode == 1
+
+
+def test_malformed_json_failure_message_contains_path(tmp_path):
+ p = tmp_path / RESULT_PATHS[0]
+ p.parent.mkdir(parents=True, exist_ok=True)
+ p.write_text("{bad}", encoding="utf-8")
+ result = _run(tmp_path)
+ assert RESULT_PATHS[0] in result.stdout or RESULT_PATHS[0] in result.stderr
+
+
+# ---------------------------------------------------------------------------
+# Missing files are silently skipped
+# ---------------------------------------------------------------------------
+
+def test_missing_files_are_not_treated_as_failure(tmp_path):
+ """Only one file present (passing); others absent — must exit 0."""
+ _write(tmp_path, RESULT_PATHS[0], {"status": "success"})
+ assert _run(tmp_path).returncode == 0
+
+
+def test_empty_status_field_is_not_failed(tmp_path):
+ """A file with status='' should not trip the failure gate."""
+ _write(tmp_path, RESULT_PATHS[4], {"status": "", "test_results": ""})
+ assert _run(tmp_path).returncode == 0
diff --git a/.github/scripts/meat/tests/test_classify_component.py b/.github/scripts/meat/tests/test_classify_component.py
new file mode 100644
index 00000000000..846c4954aa5
--- /dev/null
+++ b/.github/scripts/meat/tests/test_classify_component.py
@@ -0,0 +1,131 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+"""Tests for classify_component.py.
+
+Reads agent-results/pipeline_state.json and maps error_context to one of:
+ frontend | core_op | cpu_plugin | transformation
+
+Safe defaults:
+ - missing state file → component=frontend (exit 0)
+ - unknown error class → component=frontend (exit 0)
+
+co_located_ops in state → printed to stdout (routing hint, non-fatal).
+"""
+
+import json
+
+import pytest
+
+from conftest import SCRIPTS_DIR, run_script, write_json
+
+SCRIPT = SCRIPTS_DIR / "classify_component.py"
+STATE = "agent-results/pipeline_state.json"
+
+
+def _run(tmp_path):
+ return run_script(SCRIPT, tmp_path)
+
+
+def _write_state(tmp_path, error_context="", co_located_ops=None):
+ write_json(tmp_path / STATE, {
+ "ov_orchestrator": {
+ "error_context": error_context,
+ "co_located_ops": co_located_ops or [],
+ }
+ })
+
+
+# ---------------------------------------------------------------------------
+# Missing state file → safe default
+# ---------------------------------------------------------------------------
+
+def test_missing_state_file_exits_zero(tmp_path):
+ assert _run(tmp_path).returncode == 0
+
+
+def test_missing_state_file_outputs_frontend(tmp_path):
+ assert "component=frontend" in _run(tmp_path).stdout
+
+
+# ---------------------------------------------------------------------------
+# Classification map — all five entries
+# ---------------------------------------------------------------------------
+
[email protected]("error_class, expected_component", [
+ ("missing_conversion_rule", "frontend"),
+ ("frontend_error", "frontend"),
+ ("ir_validation_error", "core_op"),
+ ("inference_runtime_error", "cpu_plugin"),
+ ("accuracy_regression", "transformation"),
+])
+def test_classification_map_entry(tmp_path, error_class, expected_component):
+ _write_state(tmp_path, error_context=error_class)
+ result = _run(tmp_path)
+ assert result.returncode == 0
+ assert f"component={expected_component}" in result.stdout
+
+
+# ---------------------------------------------------------------------------
+# Unknown / empty error class → fallback to frontend
+# ---------------------------------------------------------------------------
+
+def test_unknown_error_class_defaults_to_frontend(tmp_path):
+ _write_state(tmp_path, error_context="xyzzy_completely_unknown")
+ assert "component=frontend" in _run(tmp_path).stdout
+
+
+def test_empty_error_context_defaults_to_frontend(tmp_path):
+ _write_state(tmp_path, error_context="")
+ assert "component=frontend" in _run(tmp_path).stdout
+
+
+# ---------------------------------------------------------------------------
+# error_context with a slash prefix (sub-path format)
+# ---------------------------------------------------------------------------
+
+def test_slash_separated_context_uses_prefix_only(tmp_path):
+ """'ir_validation_error/some/detail' must resolve to core_op via prefix."""
+ _write_state(tmp_path, error_context="ir_validation_error/some/extra/detail")
+ assert "component=core_op" in _run(tmp_path).stdout
+
+
+def test_slash_separated_frontend_error(tmp_path):
+ _write_state(tmp_path, error_context="missing_conversion_rule/aten::erfinv")
+ assert "component=frontend" in _run(tmp_path).stdout
+
+
+# ---------------------------------------------------------------------------
+# co_located_ops — printed but not a failure
+# ---------------------------------------------------------------------------
+
+def test_co_located_ops_printed_in_stdout(tmp_path):
+ _write_state(tmp_path, error_context="frontend_error",
+ co_located_ops=["aten::erfinv", "aten::logit"])
+ result = _run(tmp_path)
+ assert "aten::erfinv" in result.stdout
+ assert "co_located_ops" in result.stdout
+
+
+def test_co_located_ops_does_not_change_exit_code(tmp_path):
+ _write_state(tmp_path, error_context="frontend_error",
+ co_located_ops=["aten::erfinv"])
+ assert _run(tmp_path).returncode == 0
+
+
+def test_empty_co_located_ops_no_multi_op_message(tmp_path):
+ _write_state(tmp_path, error_context="frontend_error", co_located_ops=[])
+ assert "Multi-op" not in _run(tmp_path).stdout
+
+
+# ---------------------------------------------------------------------------
+# Malformed state file → should not crash (safe fallback)
+# ---------------------------------------------------------------------------
+
+def test_malformed_state_json_handled_gracefully(tmp_path):
+ p = tmp_path / STATE
+ p.parent.mkdir(parents=True, exist_ok=True)
+ p.write_text("{invalid json", encoding="utf-8")
+ # Must not crash with an unhandled exception (returncode != 2 which is Python traceback)
+ result = _run(tmp_path)
+ assert result.returncode != 2, f"Unhandled exception:\n{result.stderr}"
diff --git a/.github/scripts/meat/tests/test_classify_failure.py b/.github/scripts/meat/tests/test_classify_failure.py
new file mode 100644
index 00000000000..ca77ca179b1
--- /dev/null
+++ b/.github/scripts/meat/tests/test_classify_failure.py
@@ -0,0 +1,319 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+"""Tests for classify_failure.py.
+
+Covers:
+ - All 11 error taxonomy classes
+ - Dominant-class selection (last failed attempt)
+ - Routing decisions for every taxonomy class
+ - OOM, custom-ops, VLM signal extraction
+ - transformers_override signal
+ - Empty / all-success attempts (safe fallback)
+ - Missing input files (no crash)
+ - error_excerpts.json correctness
+ - Excerpt starts at last Traceback block
+"""
+
+import json
+import pathlib
+
+import pytest
+
+from conftest import SCRIPTS_DIR, run_script, write_json
+
+SCRIPT = SCRIPTS_DIR / "classify_failure.py"
+
+
+# ---------------------------------------------------------------------------
+# Helpers
+# ---------------------------------------------------------------------------
+
+def _attempt(aid, success, stderr="", stdout=""):
+ return {"id": aid, "success": success, "stderr": stderr, "stdout": stdout}
+
+
+def _profile(is_vlm=False, special_config_keys=None, trust_remote_code_required=False):
+ return {
+ "model_id": "test/model",
+ "trust_remote_code_required": trust_remote_code_required,
+ "is_vlm": is_vlm,
+ "special_config_keys": special_config_keys or [],
+ }
+
+
+def _run(tmp_path, attempts, profile=None):
+ write_json(tmp_path / "conversion_attempts.json", attempts)
+ write_json(tmp_path / "model_profile.json", profile or _profile())
+ return run_script(SCRIPT, tmp_path)
+
+
+def _signals(tmp_path):
+ return json.loads((tmp_path / "routing_signals.json").read_text(encoding="utf-8"))
+
+
+def _excerpts(tmp_path):
+ return json.loads((tmp_path / "error_excerpts.json").read_text(encoding="utf-8"))
+
+
+# ---------------------------------------------------------------------------
+# Error taxonomy — one parametrised test per class
+# ---------------------------------------------------------------------------
+
[email protected]("expected_class, error_text", [
+ (
+ "missing_model_dependency",
+ "ModuleNotFoundError: No module named 'flash_attn'",
+ ),
+ (
+ "missing_model_dependency",
+ "ImportError: requires package 'einops'. Install via pip.",
+ ),
+ (
+ "optimum_unsupported_arch",
+ "KeyError: 'TasksManager' model_type not support llama4",
+ ),
+ (
+ "unknown_arch_transformers_too_old",
+ # Must match outer (no configuration class) AND inner (transformers doesn't know)
+ "no configuration class found for model_type and transformers doesn't know this arch",
+ ),
+ (
+ "optimum_export_bug",
+ "Exception raised in optimum/exporters/openvino dummy_inputs TypeError",
+ ),
+ (
+ "missing_conversion_rule",
+ "NotImplementedError: aten::erfinv — no rule for this op",
+ ),
+ (
+ "frontend_error",
+ "Exception in openvino/frontend/pytorch ir parse error",
+ ),
+ (
+ "ir_validation_error",
+ "ngraph::validate_and_infer_types shape inference failed",
+ ),
+ (
+ "inference_runtime_error",
+ "ov::exception raised in infer request plugin error openvino runtime",
+ ),
+ (
+ "genai_unsupported",
+ "ValueError from openvino_genai chat template missing pipeline construct failed",
+ ),
+ (
+ "tokenizer_error",
+ "openvino_tokenizers sentencepiece tokenizer convert error",
+ ),
+ (
+ "unknown",
+ "some completely unrecognised xyzzy error that matches nothing",
+ ),
+])
+def test_error_class_classification(tmp_path, expected_class, error_text):
+ """Every error pattern maps to the correct taxonomy class."""
+ result = _run(tmp_path, [_attempt("A", False, stderr=error_text)])
+ assert result.returncode == 0, result.stderr
+ assert _signals(tmp_path)["error_class"] == expected_class
+
+
+# ---------------------------------------------------------------------------
+# Dominant class = last failed attempt
+# ---------------------------------------------------------------------------
+
+def test_dominant_class_taken_from_last_failed_attempt(tmp_path):
+ attempts = [
+ _attempt("A", False, stderr="ModuleNotFoundError no module named x"),
+ _attempt("B", False, stderr="ov::exception infer request plugin error"),
+ ]
+ _run(tmp_path, attempts)
+ # B is the last → inference_runtime_error, not missing_model_dependency
+ assert _signals(tmp_path)["error_class"] == "inference_runtime_error"
+
+
+def test_successful_attempt_ignored_in_classification(tmp_path):
+ """A trailing successful attempt must not change the dominant class."""
+ attempts = [
+ _attempt("A", False, stderr="ov::exception infer request"),
+ _attempt("B", True, stdout="Export done"), # success — skip
+ ]
+ _run(tmp_path, attempts)
+ assert _signals(tmp_path)["error_class"] == "inference_runtime_error"
+
+
+# ---------------------------------------------------------------------------
+# Routing decisions
+# ---------------------------------------------------------------------------
+
[email protected]("error_class_text, expected_agent", [
+ ("ModuleNotFoundError no module named foo", "optimum-intel"),
+ ("KeyError TasksManager model_type not support", "optimum-intel"),
+ ("no class for model_type transformers doesn't know", "optimum-intel"),
+ ("Exception in optimum/exporters dummy_inputs TypeError", "optimum-intel"),
+ ("some completely unrecognised error", "optimum-intel"),
+ ("NotImplementedError aten::erfinv no rule", "enable-operator"),
+ ("openvino/frontend pytorch ir parse error", "enable-operator"),
+ ("validate_and_infer_types shape inference failed", "enable-operator"),
+ ("ov::exception infer request plugin error", "enable-operator"),
+ ("openvino_genai chat template missing", "openvino-genai"),
+ ("openvino_tokenizers sentencepiece convert", "openvino-tokenizers"),
+])
+def test_routing_target_agent(tmp_path, error_class_text, expected_agent):
+ _run(tmp_path, [_attempt("A", False, stderr=error_class_text)])
+ assert _signals(tmp_path)["target_agent"] == expected_agent
+
+
+# ---------------------------------------------------------------------------
+# Signal extraction
+# ---------------------------------------------------------------------------
+
+def test_oom_detected_in_stderr(tmp_path):
+ err = "RuntimeError: CUDA out of memory. Tried to allocate 2.00 GiB"
+ _run(tmp_path, [_attempt("A", False, stderr=err)])
+ assert _signals(tmp_path)["oom_suspected"] is True
+
+
+def test_oom_detected_in_stdout(tmp_path):
+ """OOM in stdout (some backends print there) must also be caught."""
+ err = "Killed — memory error allocating buffer"
+ _run(tmp_path, [_attempt("A", False, stdout=err)])
+ assert _signals(tmp_path)["oom_suspected"] is True
+
+
+def test_custom_ops_detected_via_ssm_config_keys(tmp_path):
+ profile = _profile(special_config_keys=["ssm_state_size", "recurrent_layer"])
+ _run(tmp_path, [_attempt("A", False, stderr="unrelated")], profile=profile)
+ assert _signals(tmp_path)["custom_ops_suspected"] is True
+
+
+def test_mamba_key_triggers_custom_ops(tmp_path):
+ profile = _profile(special_config_keys=["mamba_d_state"])
+ _run(tmp_path, [_attempt("A", False, stderr="unrelated")], profile=profile)
+ assert _signals(tmp_path)["custom_ops_suspected"] is True
+
+
+def test_non_ssm_keys_do_not_trigger_custom_ops(tmp_path):
+ profile = _profile(special_config_keys=["hidden_size", "num_layers"])
+ _run(tmp_path, [_attempt("A", False, stderr="unrelated")], profile=profile)
+ assert _signals(tmp_path)["custom_ops_suspected"] is False
+
+
+def test_vlm_sets_tokenizer_check_signal(tmp_path):
+ profile = _profile(is_vlm=True)
+ _run(tmp_path, [_attempt("A", False, stderr="unrelated")], profile=profile)
+ assert _signals(tmp_path)["requires_tokenizer_check"] is True
+
+
+def test_non_vlm_does_not_set_tokenizer_check(tmp_path):
+ _run(tmp_path, [_attempt("A", False, stderr="unrelated")])
+ assert _signals(tmp_path)["requires_tokenizer_check"] is False
+
+
+def test_optimum_new_arch_signal_set(tmp_path):
+ err = "KeyError: TasksManager model_type not support"
+ _run(tmp_path, [_attempt("A", False, stderr=err)])
+ assert _signals(tmp_path)["requires_optimum_new_arch"] is True
+
+
+def test_transformers_too_old_sets_upgrade_and_override(tmp_path):
+ err = "no configuration class found for model_type and transformers doesn't know this arch"
+ _run(tmp_path, [_attempt("A", False, stderr=err)])
+ s = _signals(tmp_path)
+ assert s["requires_transformers_upgrade"] is True
+ assert "github.com/huggingface/transformers" in s["transformers_override"]
+
+
+def test_trust_remote_code_propagated_from_profile(tmp_path):
+ profile = _profile(trust_remote_code_required=True)
+ _run(tmp_path, [_attempt("A", False, stderr="unrelated")], profile=profile)
+ assert _signals(tmp_path)["trust_remote_code_required"] is True
+
+
+# ---------------------------------------------------------------------------
+# Edge cases: empty / all-success / missing files
+# ---------------------------------------------------------------------------
+
+def test_empty_attempts_produces_unknown_fallback(tmp_path):
+ _run(tmp_path, [])
+ s = _signals(tmp_path)
+ assert s["error_class"] == "unknown"
+ assert s["target_agent"] == "optimum-intel"
+
+
+def test_all_successful_attempts_produces_unknown_fallback(tmp_path):
+ """Zero failed attempts → no text to classify → unknown is the safe default."""
+ attempts = [_attempt("A", True, stdout="OK"), _attempt("B", True, stdout="OK")]
+ _run(tmp_path, attempts)
+ assert _signals(tmp_path)["error_class"] == "unknown"
+
+
+def test_missing_profile_does_not_crash(tmp_path):
+ write_json(tmp_path / "conversion_attempts.json", [_attempt("A", False, stderr="ov::exception")])
+ # no model_profile.json
+ result = run_script(SCRIPT, tmp_path)
+ assert result.returncode == 0
+ assert (tmp_path / "routing_signals.json").exists()
+
+
+def test_missing_attempts_does_not_crash(tmp_path):
+ write_json(tmp_path / "model_profile.json", _profile())
+ # no conversion_attempts.json
+ result = run_script(SCRIPT, tmp_path)
+ assert result.returncode == 0
+ assert (tmp_path / "routing_signals.json").exists()
+
+
+def test_missing_both_inputs_does_not_crash(tmp_path):
+ result = run_script(SCRIPT, tmp_path)
+ assert result.returncode == 0
+
+
+# ---------------------------------------------------------------------------
+# Output: routing_signals.json schema
+# ---------------------------------------------------------------------------
+
+def test_routing_signals_has_all_required_keys(tmp_path):
+ _run(tmp_path, [_attempt("A", False, stderr="unrelated")])
+ s = _signals(tmp_path)
+ required = {
+ "error_class", "target_agent",
+ "requires_optimum_new_arch", "requires_transformers_upgrade",
+ "transformers_override", "requires_tokenizer_check",
+ "is_vlm", "custom_ops_suspected", "oom_suspected",
+ "trust_remote_code_required",
+ }
+ missing = required - set(s.keys())
+ assert not missing, f"routing_signals.json missing keys: {missing}"
+
+
+# ---------------------------------------------------------------------------
+# Output: error_excerpts.json correctness
+# ---------------------------------------------------------------------------
+
+def test_error_excerpts_written_for_each_failed_attempt(tmp_path):
+ attempts = [
+ _attempt("A", False, stderr="Traceback (most recent call last):\nValueError: bad"),
+ _attempt("B", False, stderr="RuntimeError: ov::exception"),
+ ]
+ _run(tmp_path, attempts)
+ ex = _excerpts(tmp_path)
+ assert "A" in ex and "B" in ex
+
+
+def test_excerpt_starts_at_last_traceback_block(tmp_path):
+ """Excerpts must begin at 'Traceback (most recent call last)' — not at INFO lines."""
+ noise = "\n".join(f"INFO step {i}" for i in range(40))
+ tb = "Traceback (most recent call last):\n File x.py, line 1\nRuntimeError: real error"
+ _run(tmp_path, [_attempt("A", False, stderr=noise + "\n" + tb)])
+ ex = _excerpts(tmp_path)
+ assert ex["A"].startswith("Traceback"), (
+ f"Excerpt should start with Traceback, got: {ex['A'][:60]!r}"
+ )
+
+
+def test_excerpt_not_present_for_successful_attempt(tmp_path):
+ attempts = [_attempt("OK", True, stdout="done")]
+ _run(tmp_path, attempts)
+ ex = _excerpts(tmp_path)
+ assert "OK" not in ex
diff --git a/.github/scripts/meat/tests/test_collect_patches.py b/.github/scripts/meat/tests/test_collect_patches.py
new file mode 100644
index 00000000000..d88d3551fe9
--- /dev/null
+++ b/.github/scripts/meat/tests/test_collect_patches.py
@@ -0,0 +1,193 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+"""Tests for collect_patches.py.
+
+Reads sub-agent result JSON files, copies referenced patch files to
+ agent-results/enable-operator/patches/openvino/
+and produces a combined patch file.
+
+Exit codes:
+ 0 — all referenced patches found (or zero patches total)
+ 1 — at least one referenced patch file is missing
+
+Resilience requirements:
+ - Missing result JSON files → silently skipped
+ - Malformed result JSON → silently skipped
+ - Missing patch file → exit 1 + warning to stderr
+ - Both patch_paths (list) and patch_path (singular) keys supported
+"""
+
+import json
+import pathlib
+
+import pytest
+
+from conftest import SCRIPTS_DIR, run_script, write_json
+
+SCRIPT = SCRIPTS_DIR / "collect_patches.py"
+
+RESULT_FILES = [
+ "agent-results/frontend/fe_result.json",
+ "agent-results/core-opspec/core_opspec_result.json",
+ "agent-results/transformation/transformation_result.json",
+ "agent-results/cpu/cpu_result.json",
+ "agent-results/gpu/gpu_result.json",
+ "agent-results/npu/npu_result.json",
+]
+
+OUT_DIR = pathlib.Path("agent-results/enable-operator/patches/openvino")
+COMBINED = pathlib.Path("agent-results/enable-operator/patches/openvino_combined.patch")
+
+
+def _run(tmp_path):
+ return run_script(SCRIPT, tmp_path)
+
+
+def _result(tmp_path, rel_path, data):
+ write_json(tmp_path / rel_path, data)
+
+
+def _patch(tmp_path, name, content="diff --git a/x b/x\n+added line\n"):
+ p = tmp_path / name
+ p.write_text(content, encoding="utf-8")
+ return str(p)
+
+
+# ---------------------------------------------------------------------------
+# No result files → exit 0, "No patches" message
+# ---------------------------------------------------------------------------
+
+def test_no_result_files_exits_zero(tmp_path):
+ assert _run(tmp_path).returncode == 0
+
+
+def test_no_result_files_warns_no_patches(tmp_path):
+ assert "no patches" in _run(tmp_path).stdout.lower()
+
+
+def test_output_dir_created_even_when_no_patches(tmp_path):
+ _run(tmp_path)
+ assert (tmp_path / OUT_DIR).is_dir()
+
+
+# ---------------------------------------------------------------------------
+# Successful patch collection
+# ---------------------------------------------------------------------------
+
+def test_patch_is_copied_to_output_dir(tmp_path):
+ pp = _patch(tmp_path, "frontend.patch", "diff frontend content")
+ _result(tmp_path, RESULT_FILES[0], {"status": "success", "patch_paths": [pp]})
+ _run(tmp_path)
+ assert (tmp_path / OUT_DIR / "frontend.patch").exists()
+
+
+def test_copied_patch_content_is_intact(tmp_path):
+ pp = _patch(tmp_path, "core.patch", "unique-content-XYZZY")
+ _result(tmp_path, RESULT_FILES[1], {"patch_paths": [pp]})
+ _run(tmp_path)
+ content = (tmp_path / OUT_DIR / "core.patch").read_text(encoding="utf-8")
+ assert "unique-content-XYZZY" in content
+
+
+def test_combined_patch_is_created(tmp_path):
+ pp = _patch(tmp_path, "a.patch", "content-A")
+ _result(tmp_path, RESULT_FILES[0], {"patch_paths": [pp]})
+ _run(tmp_path)
+ assert (tmp_path / COMBINED).exists()
+
+
+def test_combined_patch_contains_all_collected_content(tmp_path):
+ p1 = _patch(tmp_path, "fe.patch", "content-FE")
+ p2 = _patch(tmp_path, "cpu.patch", "content-CPU")
+ _result(tmp_path, RESULT_FILES[0], {"patch_paths": [p1]})
+ _result(tmp_path, RESULT_FILES[3], {"patch_paths": [p2]})
+ _run(tmp_path)
+ combined = (tmp_path / COMBINED).read_text(encoding="utf-8")
+ assert "content-FE" in combined
+ assert "content-CPU" in combined
+
+
+def test_multiple_patches_per_result_all_collected(tmp_path):
+ p1 = _patch(tmp_path, "part1.patch", "part-one")
+ p2 = _patch(tmp_path, "part2.patch", "part-two")
+ _result(tmp_path, RESULT_FILES[0], {"patch_paths": [p1, p2]})
+ _run(tmp_path)
+ assert (tmp_path / OUT_DIR / "part1.patch").exists()
+ assert (tmp_path / OUT_DIR / "part2.patch").exists()
+
+
+def test_singular_patch_path_key_supported(tmp_path):
+ """Older result files may use 'patch_path' (string) not 'patch_paths' (list)."""
+ pp = _patch(tmp_path, "singular.patch", "singular-content")
+ _result(tmp_path, RESULT_FILES[1], {"patch_path": pp})
+ _run(tmp_path)
+ assert (tmp_path / OUT_DIR / "singular.patch").exists()
+
+
+def test_patch_paths_list_takes_precedence_over_singular_key(tmp_path):
+ """When patch_paths (list) is present, it is used; patch_path (singular) is a fallback only."""
+ p1 = _patch(tmp_path, "list.patch", "list-content")
+ _result(tmp_path, RESULT_FILES[0], {"patch_paths": [p1], "patch_path": "/nonexistent/ignored.patch"})
+ # patch_path is ignored when patch_paths is present — must not exit 1 for the unreferenced path
+ result = _run(tmp_path)
+ assert result.returncode == 0
+ assert (tmp_path / OUT_DIR / "list.patch").exists()
+
+
+# ---------------------------------------------------------------------------
+# Missing patch file → exit 1
+# ---------------------------------------------------------------------------
+
+def test_missing_patch_file_exits_one(tmp_path):
+ _result(tmp_path, RESULT_FILES[0], {"patch_paths": ["/nonexistent/ghost.patch"]})
+ assert _run(tmp_path).returncode == 1
+
+
+def test_missing_patch_file_warning_to_stderr(tmp_path):
+ _result(tmp_path, RESULT_FILES[0], {"patch_paths": ["/nonexistent/ghost.patch"]})
+ result = _run(tmp_path)
+ assert result.stderr, "Expected warning on stderr for missing patch"
+
+
+def test_missing_patch_exits_one_even_if_others_succeed(tmp_path):
+ """Partial failure: one found + one missing → still exit 1."""
+ good = _patch(tmp_path, "good.patch", "OK")
+ _result(tmp_path, RESULT_FILES[0], {"patch_paths": [good]})
+ _result(tmp_path, RESULT_FILES[1], {"patch_paths": ["/nonexistent/bad.patch"]})
+ assert _run(tmp_path).returncode == 1
+
+
+# ---------------------------------------------------------------------------
+# Resilience
+# ---------------------------------------------------------------------------
+
+def test_malformed_json_result_skipped_no_crash(tmp_path):
+ p = tmp_path / RESULT_FILES[0]
+ p.parent.mkdir(parents=True, exist_ok=True)
+ p.write_text("{invalid json!!!", encoding="utf-8")
+ result = _run(tmp_path)
+ # Malformed JSON = skip, not crash; exit 0 (no patches found)
+ assert result.returncode == 0
+
+
+def test_missing_result_files_skipped_silently(tmp_path):
+ """Only one file present (with a valid patch); others absent → exit 0."""
+ pp = _patch(tmp_path, "x.patch", "content")
+ _result(tmp_path, RESULT_FILES[4], {"patch_paths": [pp]})
+ result = _run(tmp_path)
+ assert result.returncode == 0
+ assert (tmp_path / OUT_DIR / "x.patch").exists()
+
+
+def test_result_file_with_empty_patch_paths_skipped(tmp_path):
+ _result(tmp_path, RESULT_FILES[0], {"patch_paths": []})
+ result = _run(tmp_path)
+ assert result.returncode == 0
+
+
+def test_result_file_with_no_patch_key_skipped(tmp_path):
+ """Result files that don't mention patches at all are fine."""
+ _result(tmp_path, RESULT_FILES[0], {"status": "success"})
+ result = _run(tmp_path)
+ assert result.returncode == 0
diff --git a/.github/scripts/meat/tests/test_create_agent_pr.py b/.github/scripts/meat/tests/test_create_agent_pr.py
new file mode 100644
index 00000000000..8ce0f290a20
--- /dev/null
+++ b/.github/scripts/meat/tests/test_create_agent_pr.py
@@ -0,0 +1,203 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+"""Tests for create_agent_pr.py.
+
+The script has importable helper functions (get_op_names, compose_pr_body)
+and a main() entry point guarded by ``if __name__ == "__main__"``.
+
+Function-level tests (no external processes):
+ - get_op_names: branch slug and title derived from co_located_ops / error_context
+ - compose_pr_body: required AI-generation banner, human-review warning
+
+CLI-level tests (subprocess):
+ - Missing state file → exit 1
+ - No patches in output dir → exit 0, no PR created
+ - --dry-run with valid state + patches → exit 0, no git/gh commands executed
+"""
+
+import importlib.util
+import json
+import pathlib
+import sys
+
+import pytest
+
+from conftest import SCRIPTS_DIR, run_script, write_json
+
+SCRIPT = SCRIPTS_DIR / "create_agent_pr.py"
+
+
+# ---------------------------------------------------------------------------
+# Import helpers from the module without executing main()
+# ---------------------------------------------------------------------------
+
+def _import_module():
+ spec = importlib.util.spec_from_file_location("create_agent_pr", SCRIPT)
+ mod = importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(mod)
+ return mod
+
+
+# The module defines only functions + `if __name__ == "__main__"` guard,
+# so importing it is safe and produces no side effects.
+_mod = _import_module()
+
+
+# ---------------------------------------------------------------------------
+# get_op_names
+# ---------------------------------------------------------------------------
+
+def _state(co_located_ops=None, error_context=""):
+ return {
+ "ov_orchestrator": {
+ "co_located_ops": co_located_ops or [],
+ "error_context": error_context,
+ }
+ }
+
+
+class TestGetOpNames:
+ def test_co_located_ops_used_when_present(self):
+ ops, slug, title = _mod.get_op_names(_state(co_located_ops=["aten::erfinv"]))
+ assert "erfinv" in slug
+ assert "aten::erfinv" in title
+
+ def test_multiple_co_located_ops_joined_in_slug(self):
+ ops, slug, title = _mod.get_op_names(
+ _state(co_located_ops=["aten::erfinv", "aten::logit"])
+ )
+ assert "erfinv" in slug
+ assert "logit" in slug
+
+ def test_slug_is_lowercase_hyphenated(self):
+ ops, slug, title = _mod.get_op_names(_state(co_located_ops=["aten::MyCustomOp"]))
+ assert slug == slug.lower()
+ assert "::" not in slug
+ assert "_" not in slug or "-" in slug # colons replaced by hyphens
+
+ def test_fallback_to_error_context_when_no_co_located_ops(self):
+ ops, slug, title = _mod.get_op_names(
+ _state(error_context="missing_conversion_rule/aten::erfinv")
+ )
+ assert len(ops) == 1
+ assert "erfinv" in ops[0]
+
+ def test_empty_state_returns_some_slug(self):
+ """Must not crash on empty state — a slug is always returned."""
+ ops, slug, title = _mod.get_op_names({})
+ assert isinstance(slug, str)
+ assert len(slug) > 0
+
+
+# ---------------------------------------------------------------------------
+# compose_pr_body
+# ---------------------------------------------------------------------------
+
+class TestComposePrBody:
+ _REQUIRED_PHRASES = [
+ "generated by", # AI generation disclosure
+ "human review", # reviewer responsibility
+ "sign-off", # safety instruction (actual: 'do **not** merge without human sign-off')
+ "draft", # must stay draft until reviewed
+ ]
+
+ def test_body_contains_ai_generation_banner(self):
+ body = _mod.compose_pr_body(["aten::erfinv"], "aten::erfinv")
+ lower = body.lower()
+ for phrase in self._REQUIRED_PHRASES:
+ assert phrase in lower, f"Missing required phrase: {phrase!r}"
+
+ def test_body_contains_op_name(self):
+ body = _mod.compose_pr_body(["aten::erfinv"], "aten::erfinv")
+ assert "aten::erfinv" in body
+
+ def test_body_contains_agent_name(self):
+ body = _mod.compose_pr_body(["aten::erfinv"], "aten::erfinv")
+ assert "enable-operator" in body
+
+ def test_body_with_multiple_ops(self):
+ ops = ["aten::erfinv", "aten::logit"]
+ body = _mod.compose_pr_body(ops, ", ".join(ops))
+ for op in ops:
+ assert op in body
+
+ def test_body_is_non_empty_string(self):
+ body = _mod.compose_pr_body(["aten::erfinv"], "aten::erfinv")
+ assert isinstance(body, str)
+ assert len(body.strip()) > 0
+
+ def test_important_callout_present(self):
+ """The [!IMPORTANT] GitHub callout must be present."""
+ body = _mod.compose_pr_body(["aten::erfinv"], "aten::erfinv")
+ assert "IMPORTANT" in body
+
+
+# ---------------------------------------------------------------------------
+# CLI: missing state file → exit 1
+# ---------------------------------------------------------------------------
+
+def test_missing_state_file_exits_one(tmp_path):
+ result = run_script(SCRIPT, tmp_path)
+ assert result.returncode == 1
+
+
+def test_missing_state_file_error_message(tmp_path):
+ result = run_script(SCRIPT, tmp_path)
+ assert "state" in result.stderr.lower() or "not found" in result.stderr.lower()
+
+
+# ---------------------------------------------------------------------------
+# CLI: no patches → exit 0 (nothing to publish)
+# ---------------------------------------------------------------------------
+
+def test_no_patches_exits_zero(tmp_path):
+ write_json(tmp_path / "agent-results/pipeline_state.json", _state(
+ co_located_ops=["aten::erfinv"],
+ ))
+ # patch dir exists but is empty
+ (tmp_path / "agent-results/enable-operator/patches/openvino").mkdir(parents=True)
+ result = run_script(SCRIPT, tmp_path)
+ assert result.returncode == 0
+
+
+# ---------------------------------------------------------------------------
+# CLI: --dry-run with state + patches → exit 0, no git/gh mutation
+# ---------------------------------------------------------------------------
+
+def test_dry_run_with_patches_exits_zero(tmp_path):
+ write_json(tmp_path / "agent-results/pipeline_state.json", _state(
+ co_located_ops=["aten::erfinv"],
+ ))
+ patch_dir = tmp_path / "agent-results/enable-operator/patches/openvino"
+ patch_dir.mkdir(parents=True)
+ (patch_dir / "fe.patch").write_text("diff --git a/x b/x\n", encoding="utf-8")
+
+ result = run_script(SCRIPT, tmp_path, "--dry-run")
+ assert result.returncode == 0
+
+
+def test_dry_run_prints_would_create_branch(tmp_path):
+ write_json(tmp_path / "agent-results/pipeline_state.json", _state(
+ co_located_ops=["aten::erfinv"],
+ ))
+ patch_dir = tmp_path / "agent-results/enable-operator/patches/openvino"
+ patch_dir.mkdir(parents=True)
+ (patch_dir / "fe.patch").write_text("diff", encoding="utf-8")
+
+ result = run_script(SCRIPT, tmp_path, "--dry-run")
+ assert "dry-run" in result.stdout.lower() or "would" in result.stdout.lower()
+
+
+def test_dry_run_does_not_call_git_checkout(tmp_path, monkeypatch):
+ """--dry-run must not issue any mutating git commands."""
+ write_json(tmp_path / "agent-results/pipeline_state.json", _state(
+ co_located_ops=["aten::erfinv"],
+ ))
+ patch_dir = tmp_path / "agent-results/enable-operator/patches/openvino"
+ patch_dir.mkdir(parents=True)
+ (patch_dir / "fe.patch").write_text("diff", encoding="utf-8")
+
+ result = run_script(SCRIPT, tmp_path, "--dry-run")
+ # In dry-run, gh CLI is never invoked — so if gh is absent the run still passes
+ assert result.returncode == 0
diff --git a/.github/scripts/meat/tests/test_probe_model.py b/.github/scripts/meat/tests/test_probe_model.py
new file mode 100644
index 00000000000..19ad8578085
--- /dev/null
+++ b/.github/scripts/meat/tests/test_probe_model.py
@@ -0,0 +1,183 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+"""Tests for probe_model.py.
+
+probe_model.py requires heavy external dependencies (transformers, requests,
+optimum) that are not expected to be installed in a bare test environment.
+Tests here therefore focus on:
+
+ 1. Guard rail: no MODEL_ID → exit 1 with usage message
+ 2. MODEL_ID via env var vs. positional argument are both accepted
+ 3. The estimate_params() logic (inlined for unit testing — matches the
+ formula in the script)
+ 4. The PIPELINE_TAG_MAP used in try_conversion.py is complete for the
+ task values consumed downstream
+
+When the external deps ARE present (CI with the full ML env), the script
+will naturally be exercised by integration runs; these unit tests guard
+against silent regressions in the script's own logic.
+"""
+
+import pathlib
+import sys
+
+import pytest
+
+from conftest import SCRIPTS_DIR, run_script
+
+SCRIPT = SCRIPTS_DIR / "probe_model.py"
+
+
+# ---------------------------------------------------------------------------
+# Guard: MODEL_ID is required
+# ---------------------------------------------------------------------------
+
+def test_no_model_id_exits_one(tmp_path):
+ import os
+ env = os.environ.copy()
+ env.pop("MODEL_ID", None)
+ result = run_script(SCRIPT, tmp_path, extra_env=env)
+ assert result.returncode == 1
+
+
+def test_no_model_id_prints_usage(tmp_path):
+ import os
+ env = os.environ.copy()
+ env.pop("MODEL_ID", None)
+ result = run_script(SCRIPT, tmp_path, extra_env=env)
+ combined = result.stderr + result.stdout
+ assert "model_id" in combined.lower() or "usage" in combined.lower()
+
+
+def test_model_id_env_var_is_accepted(tmp_path):
+ """With MODEL_ID set, the script must NOT exit 1 on the usage guard."""
+ result = run_script(SCRIPT, tmp_path, extra_env={"MODEL_ID": "test/model"})
+ # The script will fail later (no transformers installed), but must pass
+ # the usage guard. returncode == 1 with "Usage:" in stderr = guard fired.
+ if result.returncode == 1:
+ assert "Usage:" not in result.stderr, (
+ "MODEL_ID env var not accepted — usage guard fired unexpectedly"
+ )
+
+
+def test_model_id_positional_argument_is_accepted(tmp_path):
+ """MODEL_ID as positional arg must also bypass the usage guard."""
+ import os
+ env = os.environ.copy()
+ env.pop("MODEL_ID", None)
+ result = run_script(SCRIPT, tmp_path, "some/model", extra_env=env)
+ if result.returncode == 1:
+ assert "Usage:" not in result.stderr
+
+
+# ---------------------------------------------------------------------------
+# estimate_params() — inlined formula unit tests
+# ---------------------------------------------------------------------------
+# The formula is duplicated here intentionally. If the script's formula
+# changes, this test breaks loudly, prompting a review of the change.
+
+def _estimate_params(hidden_size, num_hidden_layers, vocab_size,
+ intermediate_size=None, num_attention_heads=32,
+ num_key_value_heads=None, has_mlp_bias=False):
+ h = hidden_size
+ layers = num_hidden_layers
+ vocab = vocab_size
+ intermediate = intermediate_size if intermediate_size is not None else h * 4
+ heads = num_attention_heads
+ kv_heads = num_key_value_heads if num_key_value_heads is not None else heads
+
+ attn = h * h + (kv_heads * (h // heads if heads else 1)) * 2 * h + h * h
+ ffn = h * intermediate * 3 if has_mlp_bias else h * intermediate * 2
+ embed = vocab * h * 2
+ per_layer = attn + ffn
+ return layers * per_layer + embed
+
+
+def test_estimate_params_llama7b_in_plausible_range():
+ """LLaMA-7B config should estimate somewhere between 5B and 15B params."""
+ est = _estimate_params(
+ hidden_size=4096,
+ num_hidden_layers=32,
+ vocab_size=32000,
+ intermediate_size=11008,
+ num_attention_heads=32,
+ num_key_value_heads=32,
+ )
+ assert 5e9 < est < 15e9, f"Estimate {est/1e9:.1f}B seems off for LLaMA-7B config"
+
+
+def test_estimate_params_zero_config_returns_zero():
+ """All-zero config must return 0, not crash."""
+ est = _estimate_params(0, 0, 0, intermediate_size=0, num_attention_heads=1)
+ assert est == 0
+
+
+def test_estimate_params_scales_with_layers():
+ """Doubling the layer count roughly doubles the estimate."""
+ base = _estimate_params(2048, 16, 16000, intermediate_size=8192, num_attention_heads=16)
+ doubled = _estimate_params(2048, 32, 16000, intermediate_size=8192, num_attention_heads=16)
+ ratio = doubled / base if base else float("inf")
+ assert 1.8 < ratio < 2.2, f"Layer scaling ratio {ratio:.2f} is unexpected"
+
+
+def test_estimate_params_gqa_less_than_mha():
+ """GQA (fewer kv_heads) should produce a smaller estimate than full MHA."""
+ mha = _estimate_params(4096, 32, 32000, intermediate_size=11008,
+ num_attention_heads=32, num_key_value_heads=32)
+ gqa = _estimate_params(4096, 32, 32000, intermediate_size=11008,
+ num_attention_heads=32, num_key_value_heads=8)
+ assert gqa < mha, "GQA should use fewer params than full MHA"
+
+
+# ---------------------------------------------------------------------------
+# PIPELINE_TAG_MAP completeness
+# ---------------------------------------------------------------------------
+
+# These are the pipeline tags that the analyze-and-convert agent documents
+# as supported. Every tag must map to a non-empty task string.
+_EXPECTED_TAGS = [
+ "text-generation",
+ "text2text-generation",
+ "image-text-to-text",
+ "text-classification",
+ "token-classification",
+ "question-answering",
+ "feature-extraction",
+ "fill-mask",
+ "text-to-image",
+ "image-to-text",
+ "automatic-speech-recognition",
+ "audio-classification",
+ "zero-shot-image-classification",
+]
+
+# Read PIPELINE_TAG_MAP from the try_conversion.py source (authoritative copy)
+def _load_pipeline_tag_map():
+ """Parse PIPELINE_TAG_MAP from try_conversion.py without executing the file."""
+ src = (SCRIPTS_DIR / "try_conversion.py").read_text(encoding="utf-8")
+ # Extract the dict literal between PIPELINE_TAG_MAP = { ... }
+ import ast, re
+ m = re.search(
+ r"PIPELINE_TAG_MAP\s*=\s*(\{[^}]+\})",
+ src,
+ re.DOTALL,
+ )
+ if not m:
+ return {}
+ return ast.literal_eval(m.group(1))
+
+
[email protected]("tag", _EXPECTED_TAGS)
+def test_pipeline_tag_map_covers_expected_tag(tag):
+ tag_map = _load_pipeline_tag_map()
+ assert tag in tag_map, f"PIPELINE_TAG_MAP missing tag: {tag!r}"
+
+
[email protected]("tag", _EXPECTED_TAGS)
+def test_pipeline_tag_map_value_is_non_empty_string(tag):
+ tag_map = _load_pipeline_tag_map()
+ task = tag_map.get(tag, "")
+ assert isinstance(task, str) and task.strip(), (
+ f"PIPELINE_TAG_MAP[{tag!r}] is empty or not a string"
+ )
diff --git a/.github/scripts/meat/tests/test_run_agent.py b/.github/scripts/meat/tests/test_run_agent.py
new file mode 100644
index 00000000000..aeffe4824f4
--- /dev/null
+++ b/.github/scripts/meat/tests/test_run_agent.py
@@ -0,0 +1,151 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+"""Tests for run_agent.py.
+
+This is the CLI entry point for all agents. Critical safety properties:
+ - Wrong arg count → exit 1, usage hint
+ - Unknown agent → exit 1, error mentions available agents
+ - Missing context file → exit 1, path reported
+ - Missing agent file (repo root not found) → exit 1
+ - --list / -l → exit 0, all expected agents listed
+ - No mutating side effect when args are invalid
+"""
+
+import pathlib
+import sys
+import tempfile
+import os
+
+import pytest
+
+from conftest import SCRIPTS_DIR, run_script
+
+SCRIPT = SCRIPTS_DIR / "run_agent.py"
+# run_agent checks for agent files relative to the repo root
+REPO_ROOT = SCRIPTS_DIR.parent.parent.parent
+
+KNOWN_AGENTS = [
+ "enable-operator",
+ "frontend",
+ "core-opspec",
+ "transformation",
+ "cpu",
+ "gpu",
+ "deployer",
+ "analyze-and-convert",
+]
+
+
+def _run(*args, cwd=None):
+ return run_script(SCRIPT, cwd or REPO_ROOT, *args)
+
+
+# ---------------------------------------------------------------------------
+# --list flag
+# ---------------------------------------------------------------------------
+
+def test_list_flag_exits_zero():
+ assert _run("--list").returncode == 0
+
+
+def test_list_short_flag_exits_zero():
+ assert _run("-l").returncode == 0
+
+
+def test_list_contains_all_expected_agents():
+ stdout = _run("--list").stdout
+ for agent in KNOWN_AGENTS:
+ assert agent in stdout, f"Agent {agent!r} not in --list output"
+
+
+# ---------------------------------------------------------------------------
+# Wrong argument count
+# ---------------------------------------------------------------------------
+
+def test_no_args_exits_nonzero():
+ assert _run().returncode != 0
+
+
+def test_single_non_list_arg_exits_nonzero():
+ assert _run("enable-operator").returncode != 0
+
+
+def test_three_args_exits_nonzero():
+ assert _run("enable-operator", "ctx.txt", "extra").returncode != 0
+
+
+def test_usage_hint_on_wrong_arg_count():
+ result = _run()
+ assert "usage" in result.stderr.lower() or "usage" in result.stdout.lower()
+
+
+# ---------------------------------------------------------------------------
+# Missing context file
+# ---------------------------------------------------------------------------
+
+def test_missing_context_file_exits_nonzero():
+ result = _run("enable-operator", "/nonexistent/context_file.txt")
+ assert result.returncode != 0
+
+
+def test_missing_context_file_error_mentions_path():
+ result = _run("enable-operator", "/nonexistent/context_file.txt")
+ assert "context" in result.stderr.lower() or "not found" in result.stderr.lower()
+
+
+# ---------------------------------------------------------------------------
+# Unknown agent (agent .md file missing)
+# ---------------------------------------------------------------------------
+
+def test_unknown_agent_with_existing_context_file_exits_nonzero():
+ with tempfile.NamedTemporaryFile(
+ mode="w", suffix=".txt", delete=False
+ ) as fh:
+ fh.write("Operator: aten::erfinv\nModel: test/model\n")
+ ctx = fh.name
+ try:
+ result = _run("no-such-agent-ever", ctx)
+ assert result.returncode != 0
+ finally:
+ os.unlink(ctx)
+
+
+def test_unknown_agent_error_mentions_agent_file():
+ with tempfile.NamedTemporaryFile(
+ mode="w", suffix=".txt", delete=False
+ ) as fh:
+ fh.write("dummy")
+ ctx = fh.name
+ try:
+ result = _run("no-such-agent-ever", ctx)
+ combined = result.stderr + result.stdout
+ assert "agent" in combined.lower() or "not found" in combined.lower()
+ finally:
+ os.unlink(ctx)
+
+
+# ---------------------------------------------------------------------------
+# Valid context file + known agent: verifies pre-flight checks pass
+# (script will fail later when trying to invoke copilot CLI, that's expected)
+# ---------------------------------------------------------------------------
+
+def test_known_agent_with_valid_context_does_not_exit_with_usage_error():
+ """If the agent .md exists and context file exists, the usage-check phase
+ must pass (exit code != 1 from arg-parsing). The script will fail later
+ attempting to invoke ``copilot`` — that is acceptable here.
+ """
+ with tempfile.NamedTemporaryFile(
+ mode="w", suffix=".txt", delete=False
+ ) as fh:
+ fh.write("Operator: aten::erfinv\nModel: test/model\n")
+ ctx = fh.name
+ try:
+ result = _run("enable-operator", ctx)
+ # Should NOT fail with the usage-error message
+ combined = result.stderr + result.stdout
+ assert "Usage:" not in combined, (
+ f"Got usage error for valid inputs:\n{combined}"
+ )
+ finally:
+ os.unlink(ctx)
diff --git a/.github/scripts/meat/tests/test_try_conversion.py b/.github/scripts/meat/tests/test_try_conversion.py
new file mode 100644
index 00000000000..2c826db4838
--- /dev/null
+++ b/.github/scripts/meat/tests/test_try_conversion.py
@@ -0,0 +1,283 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+"""Tests for try_conversion.py.
+
+Uses a cross-platform ``optimum-cli`` stub injected via PATH to exercise
+the strategy-matrix logic without invoking the real tool.
+
+Critical properties under test:
+ - Missing model_profile.json → exit 1, clear error
+ - Strategy D (int4 AWQ) is present for >7B models, absent for ≤7B
+ - Script stops on the first successful strategy
+ - Exit 0 without IR files on disk is NOT treated as success
+ - All conversion attempts are persisted with required fields
+ - Failed attempts have success=False
+ - conversion_attempts.json is always written (even on all-failure)
+"""
+
+import json
+import os
+import pathlib
+import sys
+
+import pytest
+
+from conftest import SCRIPTS_DIR, run_script, write_json, make_fake_cmd, patched_env
+
+SCRIPT = SCRIPTS_DIR / "try_conversion.py"
+
+
+# ---------------------------------------------------------------------------
+# Helpers
+# ---------------------------------------------------------------------------
+
+def _write_profile(tmp_path, **overrides):
+ profile = {
+ "model_id": "test/model",
+ "trust_remote_code_required": False,
+ "is_vlm": False,
+ "optimum_supported": True,
+ "estimated_params_b": 1.0,
+ "pipeline_tag": "text-generation",
+ }
+ profile.update(overrides)
+ write_json(tmp_path / "model_profile.json", profile)
+
+
+def _run_with_stub(tmp_path, bin_dir):
+ env = patched_env(bin_dir)
+ # Skip pip install calls during tests to avoid network access.
+ env["_TRY_CONVERSION_SKIP_PIP"] = "1"
+ return run_script(SCRIPT, tmp_path, extra_env=env)
+
+
+def _attempts(tmp_path) -> list:
+ p = tmp_path / "conversion_attempts.json"
+ assert p.exists(), "conversion_attempts.json was not written"
+ return json.loads(p.read_text(encoding="utf-8"))
+
+
+# ---------------------------------------------------------------------------
+# Guard: missing model_profile.json
+# ---------------------------------------------------------------------------
+
+def test_missing_profile_exits_one(tmp_path):
+ result = run_script(SCRIPT, tmp_path)
+ assert result.returncode == 1
+
+
+def test_missing_profile_error_mentions_file(tmp_path):
+ result = run_script(SCRIPT, tmp_path)
+ assert "model_profile.json" in result.stderr
+
+
+# ---------------------------------------------------------------------------
+# Strategy matrix: int4 AWQ (Strategy D)
+# ---------------------------------------------------------------------------
+
+def test_int4_strategy_absent_for_small_model(tmp_path):
+ """Models ≤7B must never trigger the expensive int4 AWQ strategy."""
+ _write_profile(tmp_path, estimated_params_b=1.0)
+ bin_dir = tmp_path / "bin"
+ bin_dir.mkdir()
+ make_fake_cmd(bin_dir, "optimum-cli", exit_code=1)
+
+ _run_with_stub(tmp_path, bin_dir)
+
+ ids = [a["id"] for a in _attempts(tmp_path)]
+ assert not any("int4" in i.lower() for i in ids), (
+ f"int4 strategy incorrectly present for 1B model: {ids}"
+ )
+
+
+def test_int4_strategy_present_for_large_model(tmp_path):
+ """Models >7B must include the int4 AWQ strategy in the matrix."""
+ _write_profile(tmp_path, estimated_params_b=70.0)
+ bin_dir = tmp_path / "bin"
+ bin_dir.mkdir()
+ make_fake_cmd(bin_dir, "optimum-cli", exit_code=1)
+
+ _run_with_stub(tmp_path, bin_dir)
+
+ ids = [a["id"] for a in _attempts(tmp_path)]
+ assert any("int4" in i.lower() for i in ids), (
+ f"int4 strategy missing for 70B model: {ids}"
+ )
+
+
+def test_boundary_exactly_7b_does_not_get_int4(tmp_path):
+ """Exactly 7.0B is NOT greater than 7 → no int4 strategy."""
+ _write_profile(tmp_path, estimated_params_b=7.0)
+ bin_dir = tmp_path / "bin"
+ bin_dir.mkdir()
+ make_fake_cmd(bin_dir, "optimum-cli", exit_code=1)
+
+ _run_with_stub(tmp_path, bin_dir)
+
+ ids = [a["id"] for a in _attempts(tmp_path)]
+ assert not any("int4" in i.lower() for i in ids)
+
+
+# ---------------------------------------------------------------------------
+# Stop-on-success behaviour
+# ---------------------------------------------------------------------------
+
+def test_stops_after_first_successful_strategy(tmp_path):
+ """Only strategy A should run when it succeeds immediately."""
+ _write_profile(tmp_path)
+ bin_dir = tmp_path / "bin"
+ bin_dir.mkdir()
+ make_fake_cmd(bin_dir, "optimum-cli", exit_code=0, create_ir=True)
+
+ _run_with_stub(tmp_path, bin_dir)
+
+ attempts = _attempts(tmp_path)
+ assert len(attempts) == 1, (
+ f"Expected exactly 1 attempt after first success, got {len(attempts)}"
+ )
+ assert attempts[0]["success"] is True
+
+
+def test_all_strategies_run_when_all_fail(tmp_path):
+ """All strategies (A-E, or A-E+D for large model) must be tried on failure."""
+ _write_profile(tmp_path, estimated_params_b=1.0)
+ bin_dir = tmp_path / "bin"
+ bin_dir.mkdir()
+ make_fake_cmd(bin_dir, "optimum-cli", exit_code=1)
+
+ _run_with_stub(tmp_path, bin_dir)
+
+ attempts = _attempts(tmp_path)
+ # Small model: A, B, C, E (no D) = 4 strategies
+ assert len(attempts) >= 4, (
+ f"Expected ≥4 attempts for 1B model, got {len(attempts)}: {[a['id'] for a in attempts]}"
+ )
+
+
+# ---------------------------------------------------------------------------
+# Exit-0-without-IR-files is NOT success
+# ---------------------------------------------------------------------------
+
+def test_exit_zero_without_ir_files_is_not_success(tmp_path):
+ """optimum-cli returning 0 but producing no .xml/.bin must not be success."""
+ _write_profile(tmp_path)
+ bin_dir = tmp_path / "bin"
+ bin_dir.mkdir()
+ # create_ir=False: exits 0 but writes nothing
+ make_fake_cmd(bin_dir, "optimum-cli", exit_code=0, create_ir=False)
+
+ _run_with_stub(tmp_path, bin_dir)
+
+ for a in _attempts(tmp_path):
+ assert a["success"] is False, (
+ f"Attempt {a['id']} marked success despite no IR files"
+ )
+
+
+# ---------------------------------------------------------------------------
+# Output: conversion_attempts.json structure
+# ---------------------------------------------------------------------------
+
+def test_conversion_attempts_json_written_on_all_failure(tmp_path):
+ _write_profile(tmp_path)
+ bin_dir = tmp_path / "bin"
+ bin_dir.mkdir()
+ make_fake_cmd(bin_dir, "optimum-cli", exit_code=1)
+
+ _run_with_stub(tmp_path, bin_dir)
+ assert (tmp_path / "conversion_attempts.json").exists()
+
+
+def test_each_attempt_has_required_fields(tmp_path):
+ _write_profile(tmp_path)
+ bin_dir = tmp_path / "bin"
+ bin_dir.mkdir()
+ make_fake_cmd(bin_dir, "optimum-cli", exit_code=1)
+
+ _run_with_stub(tmp_path, bin_dir)
+
+ required = {"id", "description", "command", "returncode", "success", "stdout", "stderr"}
+ for a in _attempts(tmp_path):
+ missing = required - set(a.keys())
+ assert not missing, f"Attempt {a.get('id')!r} missing fields: {missing}"
+
+
+def test_failed_attempts_have_success_false(tmp_path):
+ _write_profile(tmp_path)
+ bin_dir = tmp_path / "bin"
+ bin_dir.mkdir()
+ make_fake_cmd(bin_dir, "optimum-cli", exit_code=1)
+
+ _run_with_stub(tmp_path, bin_dir)
+
+ for a in _attempts(tmp_path):
+ assert a["success"] is False
+
+
+def test_successful_attempt_recorded_with_ir_files(tmp_path):
+ _write_profile(tmp_path)
+ bin_dir = tmp_path / "bin"
+ bin_dir.mkdir()
+ make_fake_cmd(bin_dir, "optimum-cli", exit_code=0, create_ir=True)
+
+ _run_with_stub(tmp_path, bin_dir)
+
+ winner = _attempts(tmp_path)[0]
+ assert winner["success"] is True
+ assert "openvino_model.xml" in winner.get("ir_files", [])
+
+
+def test_returncode_recorded_in_attempt(tmp_path):
+ _write_profile(tmp_path)
+ bin_dir = tmp_path / "bin"
+ bin_dir.mkdir()
+ make_fake_cmd(bin_dir, "optimum-cli", exit_code=42)
+
+ _run_with_stub(tmp_path, bin_dir)
+
+ assert _attempts(tmp_path)[0]["returncode"] == 42
+
+
+def test_command_string_contains_model_id(tmp_path):
+ _write_profile(tmp_path, model_id="org/my-special-model")
+ bin_dir = tmp_path / "bin"
+ bin_dir.mkdir()
+ make_fake_cmd(bin_dir, "optimum-cli", exit_code=1)
+
+ _run_with_stub(tmp_path, bin_dir)
+
+ for a in _attempts(tmp_path):
+ assert "org/my-special-model" in a["command"]
+
+
+# ---------------------------------------------------------------------------
+# trust_remote_code flag forwarded
+# ---------------------------------------------------------------------------
+
+def test_trust_remote_code_flag_in_command_when_required(tmp_path):
+ _write_profile(tmp_path, trust_remote_code_required=True)
+ bin_dir = tmp_path / "bin"
+ bin_dir.mkdir()
+ make_fake_cmd(bin_dir, "optimum-cli", exit_code=1)
+
+ _run_with_stub(tmp_path, bin_dir)
+
+ for a in _attempts(tmp_path):
+ assert "--trust-remote-code" in a["command"], (
+ f"--trust-remote-code missing from command: {a['command']}"
+ )
+
+
+def test_no_trust_remote_code_flag_when_not_required(tmp_path):
+ _write_profile(tmp_path, trust_remote_code_required=False)
+ bin_dir = tmp_path / "bin"
+ bin_dir.mkdir()
+ make_fake_cmd(bin_dir, "optimum-cli", exit_code=1)
+
+ _run_with_stub(tmp_path, bin_dir)
+
+ for a in _attempts(tmp_path):
+ assert "--trust-remote-code" not in a["command"], (
+ f"--trust-remote-code should not appear: {a['command']}"
+ )
diff --git a/.github/scripts/meat/try_conversion.py b/.github/scripts/meat/try_conversion.py
new file mode 100644
index 00000000000..5933c053e8d
--- /dev/null
+++ b/.github/scripts/meat/try_conversion.py
@@ -0,0 +1,282 @@
+# Copyright (C) 2018-2026 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+#!/usr/bin/env python3
+"""Try-conversion step for the analyze-and-convert agent.
+
+Attempts model export to OpenVINO IR using a systematic strategy matrix.
+Tries multiple weight formats, optimum-intel versions, and flag combinations.
+Records every attempt with full output in conversion_attempts.json.
+
+Usage:
+ python .github/scripts/meat/try_conversion.py
+
+Input files (current working directory):
+ model_profile.json
+
+Output files:
+ conversion_attempts.json
+ ov_model_<strategy_id>/ — IR files from first successful strategy
+"""
+
+import json
+import os
+import pathlib
+import shutil
+import subprocess
+import sys
+import time
+
+# ---------------------------------------------------------------------------
+# Load profile
+# ---------------------------------------------------------------------------
+
+profile_path = pathlib.Path("model_profile.json")
+if not profile_path.exists():
+ print("[try_conversion] ERROR: model_profile.json not found. Run probe_model.py first.",
+ file=sys.stderr)
+ sys.exit(1)
+
+profile = json.loads(profile_path.read_text(encoding="utf-8"))
+
+MODEL_ID = profile["model_id"]
+TRUST_RC = profile.get("trust_remote_code_required", False)
+IS_VLM = profile.get("is_vlm", False)
+OPTIMUM_SUPPORTED = profile.get("optimum_supported", True)
+
+print(f"[try_conversion] model_id : {MODEL_ID}")
+print(f"[try_conversion] trust_rc : {TRUST_RC}")
+print(f"[try_conversion] is_vlm : {IS_VLM}")
+print(f"[try_conversion] optimum_support : {OPTIMUM_SUPPORTED}")
+
+# ---------------------------------------------------------------------------
+# Step 1 — Determine task
+# ---------------------------------------------------------------------------
+
+PIPELINE_TAG_MAP = {
+ "text-generation": "text-generation-with-past",
+ "text2text-generation": "text2text-generation-with-past",
+ "image-text-to-text": "image-text-to-text",
+ "text-classification": "text-classification",
+ "token-classification": "token-classification",
+ "question-answering": "question-answering",
+ "feature-extraction": "feature-extraction",
+ "fill-mask": "fill-mask",
+ "text-to-image": "text-to-image",
+ "image-to-text": "image-to-text",
+ "automatic-speech-recognition": "automatic-speech-recognition",
+ "audio-classification": "audio-classification",
+ "zero-shot-image-classification": "zero-shot-image-classification",
+}
+
+task = "text-generation-with-past" # safe default
+try:
+ from transformers import AutoConfig # type: ignore
+
+ cfg = AutoConfig.from_pretrained(MODEL_ID, trust_remote_code=True)
+ pipeline_tag = getattr(cfg, "pipeline_tag", None) or profile.get("pipeline_tag")
+ if pipeline_tag is None:
+ model_type = getattr(cfg, "model_type", "")
+ task = (
+ "text2text-generation-with-past"
+ if model_type in ("t5", "mt5", "bart", "mbart")
+ else "text-generation-with-past"
+ )
+ else:
+ task = PIPELINE_TAG_MAP.get(pipeline_tag, pipeline_tag)
+except Exception as exc: # noqa: BLE001
+ print(f"[try_conversion] WARNING: could not resolve task from config: {exc}",
+ file=sys.stderr)
+
+print(f"[try_conversion] resolved task: {task}")
+
+# ---------------------------------------------------------------------------
+# Step 2 — Build strategy matrix
+# ---------------------------------------------------------------------------
+
+strategies = []
+
+_GIT_OPTIMUM = "git+https://github.com/huggingface/optimum-intel.git"
+_GIT_TRANSFORMERS = "git+https://github.com/huggingface/transformers.git"
+
+# Strategy A: fp16, stable optimum-intel
+strategies.append({
+ "id": "A-fp16-stable",
+ "weight_format": "fp16",
+ "optimum_version": "stable",
+ "extra_flags": [],
+ "description": "fp16, stable optimum-intel",
+})
+
+# Strategy B: int8 symmetric, stable (lighter on memory)
+strategies.append({
+ "id": "B-int8-stable",
+ "weight_format": "int8",
+ "optimum_version": "stable",
+ "extra_flags": [],
+ "description": "int8, stable optimum-intel",
+})
+
+# Strategy C: fp16, optimum-intel git-HEAD
+strategies.append({
+ "id": "C-fp16-gitHEAD",
+ "weight_format": "fp16",
+ "optimum_version": _GIT_OPTIMUM,
+ "extra_flags": [],
+ "description": "fp16, optimum-intel git-HEAD",
+})
+
+# Strategy D: int4 AWQ — only for large models (>7B)
+if profile.get("estimated_params_b", 0) > 7:
+ strategies.append({
+ "id": "D-int4-awq-gitHEAD",
+ "weight_format": "int4",
+ "optimum_version": _GIT_OPTIMUM,
+ "extra_flags": ["--ratio", "1.0", "--group-size", "128"],
+ "description": "int4 AWQ, optimum-intel git-HEAD (large model)",
+ })
+
+# Strategy E: fp16 + git-HEAD optimum + transformers pre-release
+strategies.append({
+ "id": "E-fp16-transformers-pre",
+ "weight_format": "fp16",
+ "optimum_version": _GIT_OPTIMUM,
+ "extra_flags": [],
+ "description": "fp16, git-HEAD + transformers pre-release",
+ "transformers_override": _GIT_TRANSFORMERS,
+})
+
+# ---------------------------------------------------------------------------
+# Step 3 — Run each strategy
+# ---------------------------------------------------------------------------
+
+attempts = []
+
+for s in strategies:
+ sep = "=" * 60
+ print(f"\n{sep}")
+ print(f"Strategy {s['id']}: {s['description']}")
+ print(sep)
+
+ out_dir = f"ov_model_{s['id']}"
+ if os.path.exists(out_dir):
+ shutil.rmtree(out_dir)
+
+ # Install required optimum-intel version when non-stable.
+ # Set _TRY_CONVERSION_SKIP_PIP=1 to suppress installs (e.g. in tests).
+ _skip_pip = os.environ.get("_TRY_CONVERSION_SKIP_PIP", "")
+ if s["optimum_version"] != "stable" and not _skip_pip:
+ subprocess.run(
+ [sys.executable, "-m", "pip", "install", "-q", s["optimum_version"]],
+ check=False,
+ )
+
+ if s.get("transformers_override") and not _skip_pip:
+ subprocess.run(
+ [sys.executable, "-m", "pip", "install", "-q", s["transformers_override"]],
+ check=False,
+ )
+
+ cmd = [
+ "optimum-cli", "export", "openvino",
+ "--model", MODEL_ID,
+ "--task", task,
+ "--weight-format", s["weight_format"],
+ "--output", out_dir,
+ ]
+ if TRUST_RC:
+ cmd.append("--trust-remote-code")
+ cmd.extend(s.get("extra_flags", []))
+
+ t0 = time.time()
+ # shell=True is required on Windows so that cmd.exe resolves the tool via
+ # PATHEXT (real optimum-cli installs as .exe; test stubs may be .bat/.cmd).
+ proc = subprocess.run(
+ cmd,
+ capture_output=True,
+ text=True,
+ shell=(sys.platform == "win32"),
+ )
+ elapsed = round(time.time() - t0, 1)
+
+ attempt = {
+ "id": s["id"],
+ "description": s["description"],
+ "weight_format": s["weight_format"],
+ "optimum_version": s["optimum_version"],
+ "command": " ".join(cmd),
+ "returncode": proc.returncode,
+ "elapsed_s": elapsed,
+ "stdout": proc.stdout[-8000:],
+ "stderr": proc.stderr[-8000:],
+ "success": False,
+ "ir_files": [],
+ }
+
+ if proc.returncode == 0:
+ ir_files = [
+ f for f in os.listdir(out_dir)
+ if f.endswith(".xml") or f.endswith(".bin")
+ ] if os.path.isdir(out_dir) else []
+
+ if ir_files:
+ attempt["success"] = True
+ attempt["ir_files"] = ir_files
+ attempt["ir_dir"] = out_dir
+ print(f" SUCCESS in {elapsed}s — IR files: {ir_files}")
+ else:
+ attempt["stderr"] += "\n[No IR files found in output dir despite exit 0]"
+ print(f" EXIT 0 but no IR files produced in {out_dir}")
+ else:
+ print(f" FAILED (rc={proc.returncode}) in {elapsed}s")
+ last_err = (proc.stderr or proc.stdout)[-500:]
+ print(f" Last error: {last_err}")
+
+ attempts.append(attempt)
+
+ if attempt["success"]:
+ print(f"\n[try_conversion] First successful strategy: {s['id']}")
+ break
+
+pathlib.Path("conversion_attempts.json").write_text(
+ json.dumps(attempts, indent=2), encoding="utf-8"
+)
+print(f"\n[try_conversion] Attempts recorded : {len(attempts)}")
+print(f"[try_conversion] Successful : {sum(1 for a in attempts if a['success'])}")
+
+# ---------------------------------------------------------------------------
+# Step 4 — Quick inference sanity check (on success only)
+# ---------------------------------------------------------------------------
+
+winning = next((a for a in attempts if a.get("success")), None)
+
+if winning is None:
+ print("[try_conversion] No successful conversion — skipping inference check.")
+else:
+ ir_dir = winning["ir_dir"]
+ print(f"[try_conversion] Running inference check on: {ir_dir}")
+ try:
+ from optimum.intel import OVModelForCausalLM # type: ignore
+ from transformers import AutoTokenizer # type: ignore
+
+ tok = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=TRUST_RC)
+ model = OVModelForCausalLM.from_pretrained(ir_dir, trust_remote_code=TRUST_RC)
+
+ inputs = tok("Hello, world!", return_tensors="pt")
+ out = model.generate(**inputs, max_new_tokens=10)
+ generated = tok.decode(out[0], skip_special_tokens=True)
+
+ print(f"[try_conversion] Inference OK: '{generated}'")
+ winning["inference_ok"] = True
+ winning["inference_sample"] = generated
+ except Exception as exc: # noqa: BLE001
+ print(f"[try_conversion] Inference check failed: {exc}", file=sys.stderr)
+ winning["inference_ok"] = False
+ winning["inference_error"] = str(exc)
+
+ # Persist updated inference results
+ pathlib.Path("conversion_attempts.json").write_text(
+ json.dumps(attempts, indent=2), encoding="utf-8"
+ )
+
+print("[try_conversion] Written: conversion_attempts.json")