cross-device-emit

Generates validated CDP batch text from repository diffs for cross-device code modification workflows.

Updated Jun 9, 2026
One-click install
npx skills add https://github.com/lechao365/AndroidSystemEnhance --skill cross-device-emit-lechao365
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cross-device-emit
Source: https://github.com/lechao365/AndroidSystemEnhance/tree/main/harness/skills/cross-device/cross-device-emit
Command: npx skills add https://github.com/lechao365/AndroidSystemEnhance --skill cross-device-emit-lechao365

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Coordinating code changes between a remote analysis device and a local apply device is error-prone: batches can be malformed, anchored to stale base commits, or corrupted during manual copy-paste. This Skill produces strictly validated, checksum-protected CDP batch text that the apply device can execute without ambiguity. ## Core Features & Use Cases - Context Assembly: Gathers main..dev diffs, full contents of affected files under code/, latest verify receipts with timing data, and relevant docs to ground batch generation. - Batch Generation with Selfcheck: Produces CDP plain-text batches (450-500 characters, 6-7 change points) validated by cdp_parse.py until exit 0, with a sha256 checksum header to detect copy corruption. - Role-Gated Safety: Runs only on devices declaring HARNESS_ROLE=emit; precheck enforces clean worktree, synced HEAD, and pushed prior receipts before any batch is produced. - Use Case: After pulling the latest dev branch on your remote analysis machine, run the precheck, assemble the diff context, and emit a single validated batch describing the next round of kernel logging changes for the apply device to execute. ## Quick Start Run the emit precheck and then generate one selfcheck-passing CDP batch describing the next round of changes for the apply device.

Frequently Asked Questions about cross-device-emit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a CDP batch on the emit device?

Run cdp_emit_precheck.py first, assemble context from the main..dev diff and latest verify receipts, then write a 450-500 character batch with 6-7 change points. Validate it with cdp_parse.py --role emit until exit 0, then add the checksum header with --gen-checksum before delivering.

What is the cross-device emit and apply workflow?

The emit device analyzes repository context and produces CDP batch text that the user copies to the apply device, which executes the edits and verification. The loop is strictly serial: apply executes, results land, emit reviews, then the next batch is produced.

Why does the emit precheck refuse to produce a batch?

Precheck exits with an error when the worktree is dirty, local HEAD differs from origin/dev, the previous batch receipt was not pushed, or HARNESS_ROLE is not set to emit. Fix the reported reason, such as pulling or pushing, before retrying.

Why are quotes forbidden in CDP batch text?

Single and double quotes are consumed by the shell when the apply side writes temporary files, flattening multi-line content and corrupting batch_base and batch_id fields. Express quoting semantics descriptively instead, such as writing role is apply rather than a quoted assignment.

What happens if the batch base does not match on the apply side?

The apply side rejects the entire batch with exit 18 when the base anchor no longer matches origin/dev, which happens if a batch was produced before prior results landed. The emit side must then regenerate the batch against the fresh base.