|
| 1 | +--- |
| 2 | +description: Convert the provided application into a native Intel DL Streamer / OpenVINO C++ application. |
| 3 | +--- |
| 4 | + |
| 5 | +# Goal |
| 6 | + |
| 7 | +Convert the provided application into a native Intel DL Streamer / OpenVINO C++ |
| 8 | +application. |
| 9 | + |
| 10 | +# How this prompt is organized |
| 11 | + |
| 12 | +This prompt is intentionally short. It is a **sequential orchestrator** — each |
| 13 | +step links to a single, focused reference file under |
| 14 | +[`.github/skills/dlstreamer-coding-agent/convert-app/`](../skills/dlstreamer-coding-agent/convert-app/). |
| 15 | +Read the linked reference **at the moment you start a given step** (not all |
| 16 | +at once at the beginning) so the relevant rules stay in active attention |
| 17 | +while you work on that step. |
| 18 | + |
| 19 | +| # | Step | Reference | |
| 20 | +|---|---|---| |
| 21 | +| 0 | Pipeline construction skill (always available) | [SKILL.md](../skills/dlstreamer-coding-agent/SKILL.md) | |
| 22 | +| 1 | Scaffold from scratch (source + output dir + env) | [conversion-bootstrap.md](../skills/dlstreamer-coding-agent/convert-app/conversion-bootstrap.md) | |
| 23 | +| 2 | Build the per-run deprecation deny-list | [deprecation-discovery.md](../skills/dlstreamer-coding-agent/convert-app/deprecation-discovery.md) | |
| 24 | +| 3 | Review the source app + build the functional block inventory | (this file, §Step 3) | |
| 25 | +| 4 | Plan model substitutions + 1-to-1 element mapping | [model-sourcing.md](../skills/dlstreamer-coding-agent/convert-app/model-sourcing.md) | |
| 26 | +| 5 | Implement (pipeline, probes, paths, encoders, traceability) | [pipeline-implementation.md](../skills/dlstreamer-coding-agent/convert-app/pipeline-implementation.md) + [cmake-and-deliverables.md](../skills/dlstreamer-coding-agent/convert-app/cmake-and-deliverables.md) | |
| 27 | +| 6 | Verify correctness (clean-shell runs + auto-fix loop) | [validation-protocol.md](../skills/dlstreamer-coding-agent/convert-app/validation-protocol.md) + [runsh-pitfalls.md](../skills/dlstreamer-coding-agent/convert-app/runsh-pitfalls.md) | |
| 28 | +| 7 | Document the conversion | [documentation-spec.md](../skills/dlstreamer-coding-agent/convert-app/documentation-spec.md) | |
| 29 | +| 8 | Final compliance audit (last gate before reporting completion) | [final-audit-checklist.md](../skills/dlstreamer-coding-agent/convert-app/final-audit-checklist.md) | |
| 30 | + |
| 31 | +# Target platform |
| 32 | + |
| 33 | +Intel hardware — iGPU / dGPU (Arc, Iris Xe), CPU, or NPU. Default to `GPU` |
| 34 | +with CPU fallback unless the user specifies otherwise. |
| 35 | + |
| 36 | +# Checkpoint protocol (mandatory liveness signal) |
| 37 | + |
| 38 | +After completing each numbered step below, the agent MUST emit a one-line |
| 39 | +checkpoint message of the form |
| 40 | +`Checkpoint N/8: <step name> — <one-line outcome>` AND make at least one tool |
| 41 | +call as part of that checkpoint (typically `manage_todo_list` to flip the step |
| 42 | +from `in-progress` to `completed` and the next from `not-started` to |
| 43 | +`in-progress`). |
| 44 | + |
| 45 | +If a step is naturally large (e.g. step 5 Implement), emit additional |
| 46 | +intra-step checkpoints (`Checkpoint 5/8a`, `5/8b`, …) every time a major |
| 47 | +sub-artifact is created (CMakeLists, main `.cpp`, `run.sh`, `export_models.sh`). |
| 48 | + |
| 49 | +**Never go more than ~3 minutes of wall-clock time without a tool call or a |
| 50 | +checkpoint message.** This guarantees a visible liveness signal lands in the |
| 51 | +chat for every step, so the user can distinguish a working agent from a |
| 52 | +stalled one even during a single long turn. If a substep is genuinely |
| 53 | +long-running (e.g. `cmake --build`, `omz_downloader`), break it up: emit a |
| 54 | +short `Checkpoint N/8x: <substep> — starting` before launching the command, |
| 55 | +then a follow-up checkpoint with the outcome when it returns. |
| 56 | + |
| 57 | +# Steps |
| 58 | + |
| 59 | +## Step 1 — Scaffold from scratch |
| 60 | + |
| 61 | +Execute the procedure in |
| 62 | +[conversion-bootstrap.md](../skills/dlstreamer-coding-agent/convert-app/conversion-bootstrap.md): |
| 63 | + |
| 64 | +- Resolve workspace root. |
| 65 | +- Idempotent source clone. |
| 66 | +- Create a **fresh numbered output directory** (`<app>_NNN/`). |
| 67 | +- Announce the directory name to the user up-front. |
| 68 | +- Apply the mandatory env-setup recipe (§4.1) in full, run the verification |
| 69 | + (§4.2), and if anything reports `MISSING:` apply the registry-cache |
| 70 | + recovery (§4.3) before proceeding. |
| 71 | + |
| 72 | +All subsequent file writes happen inside the newly-created numbered directory. |
| 73 | +The exact same env-setup recipe MUST also be wired verbatim into the generated |
| 74 | +`run.sh` (see [cmake-and-deliverables.md](../skills/dlstreamer-coding-agent/convert-app/cmake-and-deliverables.md) §4). |
| 75 | + |
| 76 | +## Step 2 — Run the upstream deprecation discovery |
| 77 | + |
| 78 | +Execute the grep procedure in |
| 79 | +[deprecation-discovery.md](../skills/dlstreamer-coding-agent/convert-app/deprecation-discovery.md) |
| 80 | +and build the per-run deny-list. Keep it handy as the authoritative deny-list |
| 81 | +for steps 4–6. |
| 82 | + |
| 83 | +## Step 3 — Review the source app + build the functional block inventory |
| 84 | + |
| 85 | +Review the cloned source application to understand its functionality, |
| 86 | +structure, and generated output. Then build a **functional block inventory** |
| 87 | +— a numbered list of every distinct: |
| 88 | + |
| 89 | +- inference stage (PGIE, SGIE, secondary detectors/classifiers), |
| 90 | +- pre/post-processing step, |
| 91 | +- tracking, |
| 92 | +- analytics, |
| 93 | +- visualization element |
| 94 | + |
| 95 | +…together with what each block contributes to the visible output (bounding |
| 96 | +boxes, labels, counters, overlay text). This inventory is the contract for |
| 97 | +step 4 — every block listed here MUST receive a dedicated counterpart in the |
| 98 | +converted pipeline. |
| 99 | + |
| 100 | +## Step 4 — Plan the conversion |
| 101 | + |
| 102 | +Map **every** functional block from the step-3 inventory to a corresponding |
| 103 | +DL Streamer element or OpenVINO API. The mapping MUST be **strictly 1-to-1** |
| 104 | +— simplifications, merges, and stage drops are NOT permitted. Example: an |
| 105 | +N-stage cascade in the source app (e.g. detect → detect → classify) becomes |
| 106 | +an N-stage cascade in the conversion using the equivalent DL Streamer |
| 107 | +elements (e.g. `gvadetect` → `gvadetect` on upstream ROIs → `gvaclassify`). |
| 108 | +The only exception is blocks explicitly listed under *Scope → Exclude* in |
| 109 | +[cmake-and-deliverables.md](../skills/dlstreamer-coding-agent/convert-app/cmake-and-deliverables.md). |
| 110 | + |
| 111 | +For model substitutions, precision, OCR language defaults, and device |
| 112 | +mapping, follow |
| 113 | +[model-sourcing.md](../skills/dlstreamer-coding-agent/convert-app/model-sourcing.md). |
| 114 | + |
| 115 | +The agent MUST make all element-mapping decisions **autonomously** based on |
| 116 | +DL Streamer documentation, installed element properties |
| 117 | +(`gst-inspect-1.0 <element>`), sample code, and the coding-agent skill — |
| 118 | +**without** asking the user for confirmation. If multiple elements could |
| 119 | +satisfy a block, pick the best match (highest performance, lowest deprecation |
| 120 | +risk, closest semantic equivalence) and document the choice with a one-line |
| 121 | +justification in the README. |
| 122 | + |
| 123 | +Cross-check every chosen element/property against the deny-list built in |
| 124 | +step 2. |
| 125 | + |
| 126 | +## Step 5 — Implement |
| 127 | + |
| 128 | +Implement the conversion in C++ following |
| 129 | +[pipeline-implementation.md](../skills/dlstreamer-coding-agent/convert-app/pipeline-implementation.md) |
| 130 | +end-to-end (see its §§1–10 for the full set of rules). |
| 131 | + |
| 132 | +Generate the build system and wrapper per |
| 133 | +[cmake-and-deliverables.md](../skills/dlstreamer-coding-agent/convert-app/cmake-and-deliverables.md): |
| 134 | +`CMakeLists.txt` (with mandatory adjustments), `run.sh` (with `--help`, |
| 135 | +`--sink display|file|fake`, headless auto-detection, pre-flight resource |
| 136 | +audit), and `export_models.sh` if applicable. |
| 137 | + |
| 138 | +Cross-check every element, property, file format, and metadata API against |
| 139 | +the deny-list from step 2. |
| 140 | + |
| 141 | +## Step 6 — Verify correctness |
| 142 | + |
| 143 | +Run the full validation protocol in |
| 144 | +[validation-protocol.md](../skills/dlstreamer-coding-agent/convert-app/validation-protocol.md): |
| 145 | + |
| 146 | +1. Capture baseline outputs (if the original can be run on this host). |
| 147 | +2. Build (`cmake -S . -B build && cmake --build build -j$(nproc)`). |
| 148 | +3. Clean-shell `./run.sh` runs (`env -i …`) for all five invocations |
| 149 | + (`--help`, defaults, `--sink fake`, `--sink file`, `--sink invalid`) with |
| 150 | + the **auto-fix loop**. |
| 151 | +4. Compare against baseline (if available). |
| 152 | +5. Benchmark. |
| 153 | +6. Deprecated-API scan (dynamic grep against the step-2 deny-list). |
| 154 | + |
| 155 | +When a clean-shell run fails, map the error to |
| 156 | +[runsh-pitfalls.md](../skills/dlstreamer-coding-agent/convert-app/runsh-pitfalls.md), |
| 157 | +apply the fix, and **re-run every test** — fixes for one bug frequently |
| 158 | +expose the next. |
| 159 | + |
| 160 | +## Step 7 — Document |
| 161 | + |
| 162 | +Generate the README **strictly** following |
| 163 | +[documentation-spec.md](../skills/dlstreamer-coding-agent/convert-app/documentation-spec.md) — see its §1 |
| 164 | +(required README sections) and §3 (Conversion Notes sub-sections) for the |
| 165 | +full contract. |
| 166 | + |
| 167 | +Source traceability comments in the C++ code are mandatory and are enforced |
| 168 | +by [pipeline-implementation.md](../skills/dlstreamer-coding-agent/convert-app/pipeline-implementation.md) |
| 169 | +§9 — not by the README itself. |
| 170 | + |
| 171 | +## Step 8 — Final requirements compliance audit |
| 172 | + |
| 173 | +Walk through the checklist in |
| 174 | +[final-audit-checklist.md](../skills/dlstreamer-coding-agent/convert-app/final-audit-checklist.md) |
| 175 | +and verify every requirement with a concrete artifact or test result. Emit |
| 176 | +the filled checklist (with `[x]` / `[ ]` and a one-line note per item) in the |
| 177 | +final user-facing summary message. Any remaining `[ ]` items block completion |
| 178 | +— fix them and re-audit. |
0 commit comments