### Install PocketHarness via script Source: https://github.com/yunusemrejr/pocketharness/blob/main/README.md Clone the repository and run the installation script to build, test, and install the binary to ~/.local/bin/pocket. ```bash git clone https://github.com/yunusemrejr/pocketharness cd pocketharness ./install.sh # builds, tests, installs to ~/.local/bin/pocket ``` -------------------------------- ### Example Configuration JSON Source: https://github.com/yunusemrejr/pocketharness/blob/main/README.md A comprehensive example of a configuration file defining providers, models, roles, hooks, and resource limits. ```json { "default_model": "glm", "thinking": "auto", "providers": { "orcarouter": { "protocol": "openai", "base_url": "https://api.orcarouter.ai/v1", "key_env": "ORCAROUTER_API_KEY" } }, "models": { "glm": { "provider": "orcarouter", "model": "z-ai/glm-5.3-flash" } }, "roles": { "fast": "deepseek:deepseek-flash", "review": "deepseek:deepseek-flash,openrouter:z-ai/glm-5.3-flash" }, "hooks": { "post_edit": ["case {file} in *.py) python3 -m py_compile {file};; esac"], "pre_bash": [], "post_bash": [], "stop": ["make -s test"] }, "review": true, "autonomy": true, "jev": true, "local_lm": { "server": "~/llama.cpp/llama-server", "model": "~/models/Qwen3.5-0.8B-Q4_0.gguf", "key_file": "", "port": 18735, "threads": 4, "ctx": 4096 }, "tool_network": true, "bash_timeout": 120, "output_limit": 262144, "disk_budget_gb": 40, "disk_reserve_gb": 10, "max_file_gb": 32, "max_rounds": 100, "working_context_tokens": 96000, "allow_read": [], "allow_write": [], "expose_env": [] } ``` -------------------------------- ### ffmpeg SDR H.264/AAC encode starting point Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/terminal-video-editing/references/encoding-verification.md Example command for already-SDR video with a desired first audio track, if libx264 exists. Uses stream copy for video and audio, sets yuv420p, AAC 192k, and faststart. Excludes extra tracks and subtitles intentionally. ```text ffmpeg -n -i INPUT -map 0:v:0 -map 0:a:0? -c:v libx264 -preset medium -crf 20 -pix_fmt yuv420p -c:a aac -b:a 192k -movflags +faststart OUTPUT.mp4 ``` -------------------------------- ### Upgrade section example Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/github-release-notes/SKILL.md An example of how to document breaking changes or migration steps in release notes. ```markdown ### Upgrade from 1.3 `client.run()` no longer retries by default; pass `retries: 3` to keep it. ``` -------------------------------- ### Install WineCharm via Flatpak Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/winecharm/references/patterns.md Commands to install and launch WineCharm using Flatpak. ```bash flatpak --user install flathub io.github.fastrizwaan.WineCharm ``` ```bash flatpak run io.github.fastrizwaan.WineCharm ``` -------------------------------- ### Verify WineCharm installation Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/winecharm/references/patterns.md Command to verify the installation and view help documentation. ```bash winecharm --help ``` -------------------------------- ### App manifest configuration Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/wasm-python/SKILL.md Example of pinning Pyodide and package versions in an application manifest. ```json {pyodide: "0.27.x", packages: {ourpkg: "1.2.3"}} ``` -------------------------------- ### Install custom wheel with micropip Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/wasm-python/SKILL.md Use micropip to install a pure-Python package from a local file or custom index. ```python micropip.install('file:///app/ourpkg-1.2.3-py3-none-any.whl') ``` -------------------------------- ### Local LM Studio Provider Configuration Source: https://github.com/yunusemrejr/pocketharness/blob/main/README.md Example configuration for connecting to a local LM Studio instance. ```json { "providers": { "lmstudio": { "protocol": "openai", "base_url": "http://127.0.0.1:1234/v1" } }, "models": { "local": { "provider": "lmstudio", "model": "" } } } ``` -------------------------------- ### Build and Test Commands Source: https://github.com/yunusemrejr/pocketharness/blob/main/README.md Common Makefile targets for building, testing, and installing the PocketHarness executable. ```bash make # build ./pocket make test # functional + security + localhost curl integration tests make sanitize # AddressSanitizer + UndefinedBehaviorSanitizer make install # install to ~/.local/bin + bundled skills make clean ``` -------------------------------- ### GSAP ScrollTrigger setup and animation Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/scroll-animated-websites/SKILL.md Typical setup for GSAP ScrollTrigger and an example of a scrubbed animation with pinning. ```js gsap.registerPlugin(ScrollTrigger); ``` ```js gsap.to(".product", { y: -200, rotation: 8, scrollTrigger: { trigger: ".scene", start: "top top", end: "+=1500", scrub: true, pin: true } }); ``` -------------------------------- ### Initialize Pyodide and Load Packages Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/wasm-python/SKILL.md Basic setup for loading Pyodide and executing Python code. The indexURL must be an absolute path to the directory containing the Pyodide files to avoid 404 errors. ```html ``` -------------------------------- ### Single-GPU SFT setup and training script Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/llm-fine-tuning/references/sft-recipes.md Sets up and runs a single-GPU SFT training job. Requires CUDA, WORLD_SIZE=1, and MODE set to 'lora', 'qlora', or 'full'. Loads a model and tokenizer, optionally applies QLoRA quantization, validates the dataset, and runs a three-step smoke test. Saves environment.json and exports the model. ```python import inspect, json, os from importlib.metadata import version from pathlib import Path import torch from datasets import load_dataset from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, set_seed from peft import LoraConfig, get_peft_model, prepare_model_for_kbit_training from trl import SFTConfig, SFTTrainer required = {"max_length", "completion_only_loss", "eval_strategy", "save_steps"} assert required <= set(inspect.signature(SFTConfig).parameters), "Adapt to installed TRL" assert "processing_class" in inspect.signature(SFTTrainer).parameters assert torch.cuda.is_available(), "This recipe requires a CUDA runtime" assert int(os.environ.get("WORLD_SIZE", "1")) == 1, "Use a separate distributed recipe" mode = os.environ["MODE"] assert mode in {"lora", "qlora", "full"} model_id, revision = os.environ["MODEL_ID"], os.environ["MODEL_REVISION"] assert len(revision) == 40 and all(c in "0123456789abcdef" for c in revision.lower()) out = Path(os.environ["RUN_DIR"]) out.mkdir(parents=True, exist_ok=False) seed = 1729 set_seed(seed) bf16 = torch.cuda.is_bf16_supported() dtype = torch.bfloat16 if bf16 else torch.float16 packages = ["torch", "transformers", "trl", "peft", "accelerate", "datasets"] if mode == "qlora": packages.append("bitsandbytes") manifest = {"versions": {p: version(p) for p in packages}, "model": model_id, "revision": revision, "seed": seed, "mode": mode, "gpu": torch.cuda.get_device_name(0), "cuda": torch.version.cuda} (out / "environment.json").write_text(json.dumps(manifest, indent=2)) tokenizer = AutoTokenizer.from_pretrained(model_id, revision=revision) assert tokenizer.eos_token_id is not None, "Choose and audit the model's end token" if tokenizer.pad_token_id is None: tokenizer.pad_token = tokenizer.eos_token tokenizer.padding_side = "right" data = load_dataset("json", data_files={"train": "train.jsonl", "validation": "validation.jsonl"}) for split in data.values(): assert len(split) and {"prompt", "completion"} <= set(split.column_names) # FP16 AMP full tuning keeps FP32 trainable weights for gradient unscaling. weight_dtype = torch.float32 if mode == "full" and not bf16 else dtype load_args = {"revision": revision, "torch_dtype": weight_dtype} if mode == "qlora": load_args.update(device_map={"": 0}, quantization_config=BitsAndBytesConfig( load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_use_double_quant=True, bnb_4bit_compute_dtype=dtype)) model = AutoModelForCausalLM.from_pretrained(model_id, **load_args) model.config.use_cache = False if mode == "qlora": model = prepare_model_for_kbit_training(model, use_gradient_checkpointing=True) if mode != "full": model = get_peft_model(model, LoraConfig( task_type="CAUSAL_LM", r=16, lora_alpha=32, lora_dropout=0.05, target_modules="all-linear", bias="none")) model.print_trainable_parameters() trainable = sum(p.numel() for p in model.parameters() if p.requires_grad) assert trainable > 0 # Three optimizer steps are a mechanics smoke test, not a quality experiment. args = SFTConfig( output_dir=str(out), max_length=512, packing=False, completion_only_loss=True, per_device_train_batch_size=1, per_device_eval_batch_size=1, gradient_accumulation_steps=2, max_steps=3, learning_rate=1e-5 if mode == "full" else 1e-4, optim="adamw_torch", gradient_checkpointing=True, bf16=bf16, fp16=not bf16, logging_steps=1, eval_strategy="steps", eval_steps=3, save_strategy="steps", save_steps=3, save_total_limit=2, report_to="none", push_to_hub=False, seed=seed, data_seed=seed, ) trainer = SFTTrainer(model=model, args=args, processing_class=tokenizer, train_dataset=data["train"], eval_dataset=data["validation"]) batch = next(iter(trainer.get_train_dataloader())) labels = batch["labels"] assert (labels != -100).sum().item() > 0, "All supervised tokens were masked" assert ((labels != -100).sum(dim=1) > 0).all(), "A row has no training target" assert (labels[:, 1:] != -100).any(), "No target survives causal shift" if "attention_mask" in batch: assert (labels[batch["attention_mask"] == 0] == -100).all() print("Supervised tokens:", (labels != -100).sum().item()) # Inspect decoded supervised spans locally without persisting private examples. # Audit prompt exclusion, true EOS labels and truncation before running train(). ``` ```python torch.cuda.reset_peak_memory_stats() trainer.train() trainer.save_model(str(out / "export")) tokenizer.save_pretrained(str(out / "export")) print("Peak allocated bytes:", torch.cuda.max_memory_allocated()) ``` -------------------------------- ### Launch WineCharm GUI Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/winecharm/references/patterns.md Command to start the WineCharm graphical user interface. ```bash winecharm ``` -------------------------------- ### Verify PocketHarness installation Source: https://github.com/yunusemrejr/pocketharness/blob/main/README.md Check that the pocket command is available and verify the version and help documentation. ```bash command -v pocket pocket --version pocket --help ``` -------------------------------- ### Install WineCharm dependencies on Debian Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/winecharm/references/patterns.md List of required system packages for developer installations on Debian-based systems. ```bash wine wine32 wine64 winetricks icoutils libimage-exiftool-perl zstd winbind python3-yaml python3-psutil libgtk-4-1 libadwaita-1-0 python3-gi ``` -------------------------------- ### tshark starting patterns for traffic analysis Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/packet-trace-analysis/references/tooling-and-evidence.md Three tshark commands for summarizing traffic mix, listing SYN packets with epoch timestamps, and following a TCP stream. Replace display filters (-Y) per question; display filters differ from capture filters which discard traffic at collection. Verify filter syntax against the installed version as field names change. ```text tshark -r trace.pcapng -q -z io,stat,1,"COUNT(tcp) tcp","COUNT(dns) dns" ``` ```text tshark -r trace.pcapng -Y "tcp.flags.syn==1 && tcp.flags.ack==0" -T fields -e frame.number -e ip.src -e tcp.dstport -e frame.time_epoch ``` ```text tshark -r trace.pcapng -q -z follow,tcp,ascii,0 ``` -------------------------------- ### SVG path stroke animation setup Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/scroll-animated-websites/SKILL.md Initial CSS setup for animating SVG paths by setting the stroke-dasharray and stroke-dashoffset. ```css path { stroke-dasharray: 800; stroke-dashoffset: 800; } ``` -------------------------------- ### Convert sample rate with SoX Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/audio-processing/references/signal-pipeline.md Illustrates a rate conversion using SoX. Confirm optional resampler availability in the installed build and consult the relevant effect help before writing a chain. Do not assume SoX is installed or that an effect exists in every build. ```bash sox input.wav output.wav rate 48000 ``` -------------------------------- ### Compile and self-test C++ examples Source: https://github.com/yunusemrejr/pocketharness/blob/main/examples/capabilities/README.md From the repository root, compile the shortest_path and logistic_regression C++ sources with C++17 and run their self-tests. Requires a C++17 compiler. ```bash work=$(mktemp -d) c++ -std=c++17 -O2 -Wall -Wextra -Werror skills/algorithm-design/assets/shortest_path.cpp -o "$work/shortest-path" "$work/shortest-path" --self-test c++ -std=c++17 -O2 -Wall -Wextra -Werror skills/classical-ml-modeling/assets/logistic_regression.cpp -o "$work/logistic-regression" "$work/logistic-regression" --self-test ``` -------------------------------- ### Headless conversion command with unique profile Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/libreoffice-automation/references/headless-jobs.md Example command to convert a document to PDF using a unique, isolated user profile to prevent conflicts with existing instances. ```text soffice -env:UserInstallation=file:///tmp/office-job-UNIQUE/profile --headless --convert-to pdf --outdir /tmp/office-job-UNIQUE/output /absolute/source.docx ``` -------------------------------- ### Three.js Scene Setup and Model Loading Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/threejs/assets/model-preview.html Initializes the Three.js scene, camera, renderer, and loads a GLTF model from the document dataset. ```javascript import * as THREE from 'three'; import {GLTFLoader} from 'three/addons/loaders/GLTFLoader.js'; const scene = new THREE.Scene(); scene.background = new THREE.Color('#121d24'); const camera = new THREE.PerspectiveCamera(45, innerWidth / innerHeight, .1, 50); camera.position.set(3.4, 2.1, 3.4); camera.lookAt(0, 0, 0); const renderer = new THREE.WebGLRenderer({antialias:true}); renderer.setPixelRatio(1); renderer.setSize(innerWidth, innerHeight); renderer.outputColorSpace = THREE.SRGBColorSpace; document.body.appendChild(renderer.domElement); scene.add(new THREE.HemisphereLight('#dbeeff', '#283126', 2)); const key = new THREE.DirectionalLight('#fff0dc', 3); key.position.set(4, 6, 3); scene.add(key); const turntable = new THREE.Group(); scene.add(turntable); let mixer; // The exporter waits for this Promise. A loader failure is propagated with its // actual source URL; an empty canvas must never become a successful final video. window.renderReady = new GLTFLoader().loadAsync(document.body.dataset.model).then(gltf => { const model = gltf.scene; const bounds = new THREE.Box3().setFromObject(model), size = bounds.getSize(new THREE.Vector3()); const span = Math.max(size.x, size.y, size.z); if (!Number.isFinite(span) || span <= 0) throw new Error('Model has no finite visible bounds'); model.position.sub(bounds.getCenter(new THREE.Vector3())); turntable.add(model); turntable.scale.setScalar(2 / span); if (gltf.animations.length) { mixer = new THREE.AnimationMixer(model); mixer.clipAction(gltf.animations[0]).play(); } window.renderFrame(0); }); window.renderFrame = seconds => { turntable.rotation.y = seconds * Math.PI / 3; if (mixer) mixer.setTime(seconds); renderer.render(scene, camera); }; addEventListener('resize', () => { camera.aspect = innerWidth / innerHeight; camera.updateProjectionMatrix(); renderer.setSize(innerWidth, innerHeight); window.renderFrame(0); }); ``` -------------------------------- ### Run local Colab runtime with Docker Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/google-colab-training/references/connections.md Starts a local Docker container for Colab runtime, binding to the loopback interface. ```bash docker run --gpus=all -p 127.0.0.1:9000:8080 us-docker.pkg.dev/colab-images/public/runtime ``` -------------------------------- ### Run motion rendering script Source: https://github.com/yunusemrejr/pocketharness/blob/main/examples/capabilities/README.md Renders the complete six-second motion and synthesized audio demonstration. Produces 144 frames at 960x540/24 fps, checks the soundtrack, and prints encoded stream metadata. Requires Chrome and FFmpeg; the native exporter does not install them. ```sh examples/capabilities/motion/render.sh /tmp/pocket-motion ``` -------------------------------- ### Start Jupyter for Colab connection Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/google-colab-training/references/connections.md Configures Jupyter to allow connections from the Colab origin with specific security flags. ```bash jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --port=8888 --NotebookApp.port_retries=0 --NotebookApp.allow_credentials=True ``` -------------------------------- ### Probabilistic Event Scheduling Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/cinematic-pixel-scene/SKILL.md Example of using probabilistic logic to schedule events like announcements. ```js if (time > nextAnnouncement) { playAnnouncement(); nextAnnouncement = time + rand(35, 80); } ``` -------------------------------- ### Parallax Layering Implementation Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/cinematic-pixel-scene/SKILL.md Example of separating background, midground, and foreground layers with different parallax factors. ```js const cameraX = ...; drawBackground(-cameraX * 0.1); drawMidground(-cameraX * 0.4); drawForeground(-cameraX * 0.8); ``` -------------------------------- ### Navigation Structure Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/scroll-animated-websites/SKILL.md Example of navigation items for long scrollytelling pages that allow jumping to scene anchors. ```text Overview Design Mechanism Performance Details ``` -------------------------------- ### Unsigned modular addition in NASM syntax Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/x86-assembly-engineering/references/patterns.md An example of an unsigned modular addition function for System V AMD64 userspace. This implementation preserves callee-saved registers and avoids memory access. ```asm ; NASM syntax, System V AMD64 userspace: uint64_t add_u64(uint64_t a, uint64_t b) global add_u64 section .text add_u64: lea rax, [rdi + rsi] ret ``` -------------------------------- ### State and asynchronous work: generation counter to suppress stale writes Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/browser-javascript-engineering/references/patterns.md Use a generation counter to ignore stale responses after a newer request has started. This example suppresses stale writes but does not cancel work; add an AbortController and teardown when the component needs them. ```javascript let generation = 0; async function refresh(url) { const mine = ++generation; const response = await fetch(url); if (!response.ok) throw new Error(`HTTP ${response.status}`); const data = await response.json(); // validate its shape here if (mine !== generation) return; output.textContent = String(data.label); } ``` -------------------------------- ### Run tests, benchmarks, and media scripts Source: https://github.com/yunusemrejr/pocketharness/blob/main/docs/benchmarks-0.12.0.md Commands to run the test suite, check workflows, run benchmarks, and execute media integration and benchmark scripts. The benchmark script compares a baseline binary (e.g., 0.11.3) with the current build, and can be repeated for a specific workload. Finally, run the release test script. ```sh make -j4 test make check-workflows make bench python3 tests/media_integration.py ./pocket --out build/media-integration python3 tests/benchmark_media.py --before /path/to/0.11.3/pocket \ --after ./pocket --out build/media-benchmark --runs 3 # Repeat only a concerned workload: python3 tests/benchmark_media.py --before /path/to/0.11.3/pocket \ --after ./pocket --out build/video-confirm --runs 5 --workload video ./scripts/test-release.sh ``` -------------------------------- ### Responsive Desktop Choreography Configuration Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/scroll-animated-websites/SKILL.md Recommended design patterns for desktop scroll animations. ```text large pinned scenes horizontal movement multi-layer parallax side-by-side compositions ``` -------------------------------- ### Build, test, and release commands Source: https://github.com/yunusemrejr/pocketharness/blob/main/docs/execution-workflows.md Commands to run tests, check workflows, run benchmarks, and create a tagged release. After updating kVersion and CHANGELOG and committing verified changes, tag and push the release. ```sh make -j4 test make check-workflows make bench make bench-runtime ./scripts/test-release.sh # After updating kVersion and CHANGELOG and committing verified changes: git tag -a vVERSION -m 'Pocket Harness VERSION' git push origin main vVERSION ``` -------------------------------- ### Execute test and benchmark commands Source: https://github.com/yunusemrejr/pocketharness/blob/main/docs/benchmarks-0.13.0.md Run the test suite, workflow checks, and media benchmarks using the provided make and python scripts. ```sh make -j2 test make check-workflows make bench python3 tests/media_integration.py ./pocket --out build/media-integration python3 tests/benchmark_media.py --before /path/to/released/0.12.0/pocket \ --after ./pocket --out build/video-pairs --runs 3 --workload video ./scripts/test-release.sh ``` -------------------------------- ### DrawWindow Primitive Composition Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/cinematic-pixel-scene/SKILL.md Example of a complex object composed of primitive rect functions. ```js function drawWindow(x, y, w, h, opts = {}) { rect(x, y, w, h, opts.frame ?? COLORS.frame); rect(x + 1, y + 1, w - 2, h - 2, opts.glass ?? COLORS.glass); if (opts.glow) { rect(x + 2, y + 2, w - 4, h - 4, opts.glow); } if (opts.divider) { rect(x + Math.floor(w / 2), y + 1, 1, h - 2, COLORS.frameDark); } } ``` -------------------------------- ### Initialize AudioContext and Master Gain Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/cinematic-pixel-scene/SKILL.md Sets up the base AudioContext and a master gain node to control overall volume. ```javascript const audioCtx = new AudioContext(); const master = audioCtx.createGain(); master.gain.value = 0.7; master.connect(audioCtx.destination); ``` -------------------------------- ### Configuration File Paths Source: https://github.com/yunusemrejr/pocketharness/blob/main/README.md The locations for user and project-specific configuration files. ```text ~/.config/pocketharness/config.json ./.pocket/config.json # models/aliases only, never providers ``` -------------------------------- ### Progressive Loading Strategy Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/scroll-animated-websites/SKILL.md Load assets based on narrative progression to improve startup time. ```text load hero immediately load scene 2 soon load scene 3 when scene 1 is active load scene 4 later ``` -------------------------------- ### Scene-based animation structure Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/scroll-animated-websites/SKILL.md Example of dividing a page into distinct scenes for organized animation logic. ```text Scene 1: Hero Scene 2: Product enters Scene 3: Product disassembles Scene 4: Technical explanation Scene 5: Reassembly Scene 6: Final CTA ``` -------------------------------- ### Compose recursive agency with Linux Source: https://github.com/yunusemrejr/pocketharness/blob/main/README.md Demonstrates running multiple pocket instances in parallel using standard Linux process composition. ```bash pocket -p "Inspect auth" > /tmp/auth-review & pocket -p "Inspect storage" > /tmp/storage-review & wait ``` -------------------------------- ### Generate and analyze procedural audio cues Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/procedural-audio/SKILL.md Create an output directory, generate various sound effects and melodies using sfx and wav presets, and verify the output with the audio command. ```bash mkdir -p public/audio pocket kit sfx public/audio/reveal.wav chime --freq 660 --gain .28 pocket kit sfx public/audio/transition.wav whoosh --duration .6 --seed 17 --gain .22 pocket kit sfx public/audio/hit.wav impact --duration .4 --gain .3 pocket kit sfx public/audio/laser.wav laser --freq 1800 --end-freq 120 --duration .35 pocket kit wav public/audio/motif.wav "C5:.5 E5:.5 G5:1 R:.25 G5:.5 C6:1" --bpm 100 --wave sine --gain .22 pocket kit wav public/audio/loop.wav "C4+E4+G4:2 A3+C4+E4:2 | saw> C2:1 C2 A1 A1 | K:.5 H S H K H S H" --bpm 96 --gain .2 pocket kit audio public/audio/reveal.wav ``` -------------------------------- ### Initialize and stream text generation with transformers.js Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/browser-ml/SKILL.md Configure the pipeline to use the WebGPU device and stream generated tokens. ```javascript import { pipeline, env } from "@huggingface/transformers"; env.allowLocalModels = false; // or serve from your CDN const gen = await pipeline("text-generation", "onnx-community/Qwen2.5-0.5B-Instruct-GGUF", { device: "webgpu", dtype: "q4f16" }); // wasm backend auto-fallbacks for await (const out of gen("Explain X in one sentence.", { max_new_tokens: 128, do_sample: false })) { /* stream */ } ``` -------------------------------- ### Define subranges for scroll progress Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/scroll-animated-websites/SKILL.md Example mapping of scroll progress ranges to specific animation actions. ```text 0.00–0.20 title fades 0.15–0.40 object scales 0.35–0.65 diagram appears 0.60–0.85 copy changes 0.80–1.00 scene exits ``` -------------------------------- ### Produce key visuals with PocketHarness Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/key-visual-art-direction/SKILL.md Use these commands to initialize a scene, render frames for review, and generate final video output. Edit the scene.json file to customize geometry, materials, and lighting. ```js tool_search({ names: ["scene_create", "scene_render", "video_compose"] }) scene_create({ preset: "keyvisual" }) // frosted-glass mark, spot pool, beam, soft shadow, bloom/grain/vignette // Edit scene.json: replace the mark with the brand's form (arch/disc/capsule/torus/box parts, group + parent), // set backgroundGradient, wall color, spot position/target, beams, post; keep tracks for a loop. scene_render({ path: "./media-/scene.json", mode: "frame", time: 1.5 }) // LOOK at the poster, fix, repeat scene_render({ path: "./media-/scene.json", mode: "video" }) // loop or intro plate ``` -------------------------------- ### Define Visual State Object Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/cinematic-pixel-scene/SKILL.md An example of an explicit state object to avoid scattering global variables. ```js const state = { time: 0, weather: { rain: 0.8, fog: 0.3 }, train: { x: -120, state: "approaching" }, lights: { platform: true, vending: true }, audio: { enabled: false } }; ``` -------------------------------- ### Render video frames and clips with pocket kit Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/code-first-video/SKILL.md Commands to generate a single frame, a low-resolution preview, and a final video with audio. ```bash pocket kit frame scene.html settled.png --time 3 --size 1280x720 pocket kit video scene.html preview.mp4 --size 640x360 --fps 24 --duration 6 pocket kit video scene.html final.mp4 --size 1280x720 --fps 30 --duration 6 --audio soundtrack.wav ``` -------------------------------- ### Logical Resolution Constants (480x270) Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/cinematic-pixel-scene/SKILL.md Example of setting a low internal resolution for a cinematic pixel scene. ```js const VIEW_W = 480; const VIEW_H = 270; ``` -------------------------------- ### Render video preview with pocket kit Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/code-first-video/references/production-pipeline.md Command to generate a preview video with specified dimensions, frame rate, and duration. ```bash pocket kit video scene.html preview.mp4 --size 640x360 --fps 24 --duration 6 ``` -------------------------------- ### Normalize scroll progress Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/scroll-animated-websites/SKILL.md Helper functions to clamp values and calculate progress between specific start and end points. ```js function clamp(v, min = 0, max = 1) { return Math.max(min, Math.min(max, v)); } function progressBetween(value, start, end) { return clamp((value - start) / (end - start)); } ``` -------------------------------- ### Compile and run shortest_path.cpp Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/algorithm-design/SKILL.md Commands to compile the C++17 shortest path implementation and execute it with a self-test or a graph input file. ```bash c++ -std=c++17 -O2 -Wall -Wextra -Werror assets/shortest_path.cpp -o "$TMPDIR/shortest-path" "$TMPDIR/shortest-path" --self-test "$TMPDIR/shortest-path" graph.txt ``` -------------------------------- ### Export function with wasm-bindgen Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/wasm-rust/SKILL.md Example of exposing a Rust function to JavaScript, mapping errors to JsError for proper exception handling. ```rust #[wasm_bindgen] pub fn process(input: &str) -> Result, JsError> { parse(input).map_err(|e| JsError::new(&e.to_string())) // across the boundary = JS exception } ``` -------------------------------- ### Render audio cues with render.sh Source: https://github.com/yunusemrejr/pocketharness/blob/main/examples/capabilities/audio/README.md Executes the rendering script to generate original cues, stereo scores, and mixed audio programs in the specified output directory. ```sh POCKET=./pocket sh examples/capabilities/audio/render.sh /tmp/pocket-audio-demo ``` -------------------------------- ### Pocket Kit CLI Commands Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/video-studio/SKILL.md A collection of commands for managing video themes, assets, narration, music, sound effects, and rendering processes. ```bash pocket kit theme "topic words" [--seed N] # palette + font pair derived from the subject; re-roll with --seed pocket kit asset font "Family" fonts/ --weights 400,700 # local woff2 + css (scenes must not depend on the network) pocket kit say --setup # once: Piper engine + neural voice (~90 MB); then: pocket kit say narration.wav --file script.txt # + narration.json/.srt/.captions.html/.cues.css (measured beat and sentence times) pocket kit music music.wav --style corporate --duration D --seed N # styles: ambient lofi corporate cinematic tech upbeat pocket kit sfx whoosh.wav whoosh --seed 3 ; pocket kit sfx tick.wav click pocket kit mix audio.wav --voice narration.wav --music music.wav --duration D --lufs -14 --at 9.3:whoosh.wav:-2 ... pocket kit frame scene.html check.png --time 6 --size 1280x720 # lint + a still: look at it pocket kit frame scene.html moments.png --times 3,12,40,66 --size 960x540 # several moments, ONE launch, one numbered sheet (not N renders + ffmpeg stacking) pocket kit video scene.html preview.mp4 --duration D --fps 12 --size 640x360 --audio audio.wav pocket kit vsheet preview.mp4 sheet.png --n 12 # the whole video in one image: read it pocket kit video scene.html final.mp4 --duration D --fps 30 --size 1920x1080 --audio audio.wav pocket kit vcheck final.mp4 --duration D ``` -------------------------------- ### HTML head metadata for public articles Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/search-discoverability/references/patterns.md Example of essential SEO metadata including title, description, and canonical link for a public-facing article. ```html Calibrating an ESP32 temperature sensor | Lab Notes ``` -------------------------------- ### Read configuration with pathlib Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/python-software-engineering/references/patterns.md Uses a context manager to safely open and parse a JSON configuration file, ensuring the result is a dictionary. ```python from pathlib import Path import json def read_config(path: Path) -> dict: with path.open(encoding="utf-8") as stream: value = json.load(stream) if not isinstance(value, dict): raise ValueError("configuration must be an object") return value ``` -------------------------------- ### Build custom package with pyodide-build Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/wasm-python/SKILL.md Command to build a custom package for Pyodide. ```bash pyodide build ourpkg ``` -------------------------------- ### Validate audio files with FFmpeg Source: https://github.com/yunusemrejr/pocketharness/blob/main/examples/capabilities/audio/README.md Uses ffprobe and ffmpeg to verify the codec, sample rate, channels, and duration of generated audio files when FFmpeg is installed. ```sh ffprobe -v error -show_entries stream=codec_name,sample_rate,channels,duration -of default=noprint_wrappers=1 /tmp/pocket-audio-demo/chime.wav ffmpeg -v error -i /tmp/pocket-audio-demo/chime.wav -f null - ``` -------------------------------- ### Spawn a child process with node:child_process Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/node-runtime-engineering/references/patterns.md Demonstrates spawning a git process with specific working directory and stream configurations. Ensure output streams are consumed or redirected and the process tree is terminated when necessary. ```js import { spawn } from 'node:child_process'; const child = spawn('git', ['status', '--porcelain'], { cwd: projectDir, stdio: ['ignore', 'pipe', 'pipe'], shell: false }); ``` -------------------------------- ### Define a short musical motif in JSON Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/music-composition/references/score.md A basic score structure defining BPM, time signature, and a single melodic track with notes containing pitch, start time, duration, and velocity. ```json {"score":{"bpm":100,"beats":4,"numerator":4,"denominator":4,"tracks":[{"name":"Motif","program":0,"waveform":"triangle","notes":[{"pitch":60,"start":0,"duration":0.8,"velocity":86},{"pitch":64,"start":1,"duration":0.8,"velocity":80},{"pitch":67,"start":2,"duration":0.8,"velocity":90},{"pitch":64,"start":3,"duration":1,"velocity":72}]}]}} ``` -------------------------------- ### Inspect workflow configurations with pocket --workflow Source: https://github.com/yunusemrejr/pocketharness/blob/main/docs/execution-workflows.md Use the --workflow flag to display the native complexity, reasoning, planning, and budget requirements for a specific task without initiating a session or calling a provider. ```sh pocket --workflow 'Fix the title in README.md' pocket --workflow 'Build a PHP 8 website and deploy through Git/SSH to Namecheap' pocket --workflow 'Fine-tune a language model with QLoRA in Google Colab' pocket --workflow 'Edit sound and mix music with a video animation' ``` -------------------------------- ### Identify Python runtime and verify GPU availability Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/google-colab-training/SKILL.md This standard-library cell identifies the current Python version and checks for the presence of the nvidia-smi utility to confirm GPU capability without installing additional packages. ```python import platform, shutil, subprocess print(platform.python_version()) gpu = shutil.which("nvidia-smi") if gpu: subprocess.run([gpu, "--query-gpu=name,memory.total", "--format=csv,noheader"], check=True, timeout=10) else: print("nvidia-smi unavailable; GPU capability has not been verified") ``` -------------------------------- ### Render a single frame via command line Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/blender-production/references/render-pipeline.md Executes a background render of a specific frame from a blend file, specifying output path and format. ```text blender --background scene.blend --render-output /absolute/frames/frame_#### --render-format PNG --render-frame 1 ``` -------------------------------- ### Render and Audit Musical Sketches Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/music-composition/SKILL.md Commands to render a musical sketch from a note string, check audio levels, and generate a background music bed. ```bash pocket kit wav sketch.wav "C4+E4+G4:2 A3+C4+E4:2 | saw> C2:1 C2 A1 A1 | K:.5 H S H K H S H" --bpm 96 --gain .2 pocket kit audio sketch.wav pocket kit music bed.wav --style ambient --duration 20 --seed 17 ``` -------------------------------- ### Fetch with context and HTTP client Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/go-service-engineering/references/patterns.md Use this function to make an HTTP GET request with a context, handling cancellation and errors. It discards at most 1 MiB of the response body and returns an error for non-200 status codes. Note that it does not prove the entire body was read or that the connection is reusable; real parsing should detect oversize payloads and validate schema. ```go func fetch(ctx context.Context, client *http.Client, url string) error { req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) if err != nil { return err } resp, err := client.Do(req) if err != nil { return err } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { return fmt.Errorf("unexpected HTTP status %d", resp.StatusCode) } _, err = io.Copy(io.Discard, io.LimitReader(resp.Body, 1<<20)) return err } ``` -------------------------------- ### Responsive Mobile Choreography Configuration Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/scroll-animated-websites/SKILL.md Recommended design patterns for mobile scroll animations. ```text shorter pins simpler transforms vertical compositions less parallax more direct content flow ``` -------------------------------- ### Run validation and benchmark commands Source: https://github.com/yunusemrejr/pocketharness/blob/main/docs/runtime-efficiency.md A collection of make and script commands used to verify project integrity, run benchmarks, and perform media integration testing. ```sh make -j4 test make -j4 test CXX=clang++ # in an independent build tree make -j2 sanitize # in an independent build tree make check-workflows make bench make bench-runtime ./scripts/test-release.sh python3 tests/media_integration.py ./pocket --out build/media-verification ``` -------------------------------- ### LLM Iterative Development Workflow Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/cinematic-pixel-scene/SKILL.md A 20-step loop for building scenes incrementally, ensuring each pass solves a specific class of problem. ```text 1. establish canvas and scaling 2. establish composition 3. render large silhouettes 4. inspect 5. add architecture 6. inspect 7. add palette and lighting 8. inspect 9. add props 10. inspect 11. add characters 12. inspect 13. add atmospheric effects 14. inspect 15. animate 16. inspect 17. add audio 18. inspect 19. optimize 20. final QA ``` -------------------------------- ### Build a main program with em++ Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/wasm-c-cpp/SKILL.md Use em++ to compile a C++ program defining a main function into a modularized JavaScript file. ```sh em++ main.cpp -O2 -sMODULARIZE=1 -sEXPORT_NAME=createApp \ -sEXPORTED_FUNCTIONS='["_main"]' -o app.js ``` -------------------------------- ### Project Directory Structure Source: https://github.com/yunusemrejr/pocketharness/blob/main/README.md The standard layout for source files, configuration, and data storage in PocketHarness. ```text ~/src/pocketharness/ source / Git repo ~/.local/bin/pocket installed executable ~/.config/pocketharness/config.json user config (+ roles.json, env, system.md, wisdom.md, skills/) ~/.local/share/pocketharness/ sessions, catalog.json, brain.json, bundled skills ~/.cache/pocketharness/ disposable cache ``` -------------------------------- ### CONTRIBUTING.md Development and Proposal Guidelines Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/github-repo-presentation/references/patterns.md Defines development requirements and the process for proposing changes to the repository. ```markdown ## Development Requirements: Node >= 22, pnpm 9. pnpm install pnpm test pnpm lint ## Proposing a change Open an issue for behavior changes before writing code. Keep pull requests focused; one concern per PR. Run the checks above and paste the results in the description. ``` -------------------------------- ### Execute local diagnostic commands Source: https://github.com/yunusemrejr/pocketharness/blob/main/README.md A collection of pocket kit commands for network reachability, system monitoring, SEO analysis, and asset inspection. ```sh pocket kit reach localhost:8080 .5 pocket kit wait http://127.0.0.1:8080/health 5 pocket kit sys # pressure, memory and filesystem evidence pocket kit sys 1234 # status and I/O; no environment or command line pocket kit seo index.html # source defects and separate recommendations pocket kit asset inspect scene.glb ``` -------------------------------- ### Run one-step value-target sanity check Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/reinforcement-learning/SKILL.md Use this command to verify value-target calculations by providing JSON input via stdin. The script compares targets based on gamma, reward, next_value, termination, and truncation status. ```bash python3 scripts/check_targets.py ``` ```json {"gamma":0.9,"transitions":[{"reward":1,"next_value":10,"terminated":false,"truncated":true}]} ``` -------------------------------- ### Python CI Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/github-actions-workflows/references/patterns.md Sets up a Python environment with pip caching and runs tests. It is recommended to pin the interpreter version and run linters and type checkers as separate steps. ```yaml - uses: actions/setup-python@v6 with: {python-version: '3.12', cache: pip} - run: pip install -e '.[test]' - run: pytest -q ``` -------------------------------- ### Sound Accessibility Configuration Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/cinematic-pixel-scene/SKILL.md Provide a clear toggle for sound and remember user preferences locally. ```text Sound: On / Off ``` -------------------------------- ### GSAP MatchMedia Viewport Handling Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/scroll-animated-websites/SKILL.md Use matchMedia to define separate timelines for different viewport widths instead of forcing one timeline to serve all. ```js const mm = gsap.matchMedia(); mm.add("(min-width: 900px)", () => { // desktop timeline }); mm.add("(max-width: 899px)", () => { // mobile timeline }); ``` -------------------------------- ### Export frames and video with pocket kit Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/motion-graphics-production/references/rendering.md Commands to export a single frame or a full video from an HTML scene. Specify dimensions, time, frame rate, and duration as needed. ```bash pocket kit frame scene.html settled.png --time 3 --size 1280x720 pocket kit video scene.html output.mp4 --size 1280x720 --fps 30 --duration 6 ``` -------------------------------- ### Rendering technology comparison Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/scroll-animated-websites/SKILL.md A summary of use cases for DOM, SVG, Canvas, and WebGL rendering technologies. ```text DOM: text, layout, controls, semantic content SVG: diagrams, vectors, paths Canvas: dense 2D rendering, sequences, particles WebGL: true 3D, shaders, high-volume GPU effects ``` -------------------------------- ### Configure Provider API Keys Source: https://github.com/yunusemrejr/pocketharness/blob/main/README.md Set environment variables for API providers. These can be set in the shell or in ~/.config/pocketharness/env. ```bash export DEEPSEEK_API_KEY=... export OPENROUTER_API_KEY=... # also enables the Span/Jev judges ``` -------------------------------- ### Model Configuration JSON Source: https://github.com/yunusemrejr/pocketharness/blob/main/README.md Defines model providers, context limits, and reasoning settings within the configuration file. ```json { "models": { "small": { "provider": "ollama", "model": "qwen3:8b", "context": 8192, "max_tokens": 2048, "reasoning": "effort", "stream_usage": true }, "claude": { "provider": "anthropic", "model": "claude-sonnet-4-6", "max_tokens": 8192, "reasoning": "adaptive", "prompt_cache": true } } } ``` -------------------------------- ### Configure Rain Depth Bands Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/cinematic-pixel-scene/SKILL.md Organize rain into layers to create depth. ```text background rain midground rain foreground rain ``` -------------------------------- ### Content Hierarchy Planning Source: https://github.com/yunusemrejr/pocketharness/blob/main/skills/scroll-animated-websites/SKILL.md Identify these core elements before building animations to ensure content clarity. ```text message hierarchy story order visual emphasis ```