$npx -y skills add GoogleCloudPlatform/cxas-scrapi --skill task-coverage-protocolEnforces 100% task and file ingestion coverage via an asynchronous, supervisor-driven state polling mechanism.
| 1 | # PROTOCOL: Supervisor-Driven Task Coverage Checklist |
| 2 | |
| 3 | This protocol governs how you must handle large, repetitive, or multi-step |
| 4 | requirements ingestion tasks to prevent context drift, avoid memory exhaustion, |
| 5 | and guarantee 100% file coverage. Workloads are partitioned into sliced batches |
| 6 | dynamically monitored by a decoupled supervisor. |
| 7 | |
| 8 | ## Architectural Overview |
| 9 | |
| 10 | Instead of attempting to list and process hundreds of files in a single |
| 11 | conversation turn, tasks are executed asynchronously: |
| 12 | |
| 13 | 1. The **Ingestor Supervisor** scans the directory, partitions the files, and |
| 14 | outputs a structured batch directive. |
| 15 | 2. You (or parallel subagents) consume this directive, process only the |
| 16 | assigned slice of files, and write the output files to the designated |
| 17 | folder. |
| 18 | 3. The supervisor verifies and grades the outputs before queueing the next |
| 19 | slice. |
| 20 | |
| 21 | -------------------------------------------------------------------------------- |
| 22 | |
| 23 | ## Execution Workflow |
| 24 | |
| 25 | ### 1. Scoped Scan & Scoping Setup |
| 26 | |
| 27 | When instructed to ingest a requirements directory (e.g. "Ingest and parse all |
| 28 | files in this folder"), you MUST launch the Supervisor script to initialize the |
| 29 | task state: |
| 30 | |
| 31 | ```bash |
| 32 | python3 protocols/task-coverage-protocol/scripts/ingestor_supervisor.py \ |
| 33 | --source_dir="path/to/source" \ |
| 34 | --target_skill="path/to/cxas-cuj-report-generator/" |
| 35 | ``` |
| 36 | |
| 37 | ### 2. Consume the Handoff Directive |
| 38 | |
| 39 | The supervisor will scan the target folder, slice the files into batch lists of |
| 40 | size 10, and print a structured directive to standard output: |
| 41 | `SPAWN_BATCH_DIRECTIVE: {"spec_file": "/tmp/ingestor/batch_spec.json", |
| 42 | "output_dir": "/tmp/ingestor/outputs/"}` |
| 43 | |
| 44 | Upon seeing this token, you MUST: |
| 45 | |
| 46 | 1. Read the spec file `/tmp/ingestor/batch_spec.json` to retrieve the list of |
| 47 | files, prompts, and expected output paths. |
| 48 | 2. Spawn fresh, parallel subagents (one per file or partition) using their |
| 49 | respective prompt files (e.g., |
| 50 | `/tmp/ingestor/prompts/<file_name>_prompt.txt`). |
| 51 | 3. Instruct the subagents to write their generated YAML transcripts directly to |
| 52 | `/tmp/ingestor/outputs/<file_name>_output.txt`. |
| 53 | |
| 54 | ### 3. Yield Terminal & Polling Gate |
| 55 | |
| 56 | Once parallel subagents have been spawned in the background, you MUST |
| 57 | immediately stop calling tools and go idle (or report status) to release the |
| 58 | terminal lock. The supervisor will poll the output directory until all files are |
| 59 | completed. |
| 60 | |
| 61 | ### 4. Progress Verification & Next Slices |
| 62 | |
| 63 | When all subagents have delivered their YAML transcripts, run the supervisor |
| 64 | script again: |
| 65 | |
| 66 | ```bash |
| 67 | python3 protocols/task-coverage-protocol/scripts/ingestor_supervisor.py \ |
| 68 | --source_dir="path/to/source" \ |
| 69 | --target_skill="path/to/cxas-cuj-report-generator/" |
| 70 | ``` |
| 71 | |
| 72 | * **Verification Pass**: If the supervisor grades all outputs as passing, it |
| 73 | automatically advances the file pointer and writes the next batch spec. |
| 74 | Consume the new directive and repeat the parallel spawning cycle! |
| 75 | * **Verification Fail**: If the supervisor detects any syntax, schema, or |
| 76 | linguistic violations, it automatically triggers recovery, rebasing, or load |
| 77 | bisection. Re-spawn the corrective subagents as directed. |
| 78 | |
| 79 | ### 5. Final Compilation & Completion |
| 80 | |
| 81 | When all batch slices are fully processed, the supervisor will declare `All |
| 82 | files successfully ingested!` and compile the final interactive CUJ reports. |