[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6BTHV9M65YMX558C22H638A":3,"skill-same:01M6BTHV9M65YMX558C22H638A":80},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":58,"commitSha":59,"skillDirectory":60,"forksCount":61,"repositoryHtmlUrl":62,"repositoryHomepageUrl":17,"ownerHtmlUrl":63,"ownerBlogUrl":64,"ownerDescription":65,"updatedAt":66,"install":67,"resources":79},"01M6BTHV9M65YMX558C22H638A","pi-loop","Pi 周期性任务管理","Set up and manage recurring Pi tasks that run as background Pi processes. Use for recurring prompts, scheduled reports, or \u002Floop requests.","设置并管理作为后台 Pi 进程运行的周期性 Pi 任务。用于重复性提示、定时报告或 \u002Floop 请求。","ahmedelgabri\u002Fdotfiles","ahmedelgabri","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F63876?v=4","01M6BTGT61KWRDXN595X7Q8ZRY","Ahmed El Gabri","01M6BTGTAFSBR3A7ZFXK5QDHVZ",291,"Unlicense",null,"https:\u002F\u002Fgithub.com\u002Fahmedelgabri\u002Fdotfiles\u002Fblob\u002Fmain\u002Fconfig\u002Fpi\u002Fagent\u002Fextensions\u002Floop\u002Fskills\u002Fpi-loop\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BS5011KJDVSRXG1DC4P666","普通用户","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSFHC0DJXKNN0QBZDDS4K9","定时任务与自动化编排","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"pi loop","loop","pi","prompts","background","for","scheduled","requests","processes","as","manage","reports","tasks","up","use","recurring","SET","run","2026-11-10 10:12:30",false,"---\nname: run-e2e\ndescription: Run SkyWalking E2E tests locally\ndisable-model-invocation: true\nargument-hint: \"[test-case-path]\"\n---\n\n# Run SkyWalking E2E Test\n\nRun an E2E test case using `skywalking-infra-e2e`. The user provides a test case path (e.g., `simple\u002Fjdk`, `storage\u002Fbanyandb`, `alarm`).\n\n## Prerequisites\n\nAll tools require **Go** installed. Check `.github\u002Fworkflows\u002F` for the exact `e2e` commit used in CI.\n\n### e2e CLI\n\nBuilt from [apache\u002Fskywalking-infra-e2e](https:\u002F\u002Fgithub.com\u002Fapache\u002Fskywalking-infra-e2e), pinned by commit in CI:\n\n```bash\n# Install the pinned commit\ngo install github.com\u002Fapache\u002Fskywalking-infra-e2e\u002Fcmd\u002Fe2e@\u003Ccommit-id>\n\n# Or clone and build locally (useful when debugging the e2e tool itself)\ngit clone https:\u002F\u002Fgithub.com\u002Fapache\u002Fskywalking-infra-e2e.git\ncd skywalking-infra-e2e\ngit checkout \u003Ccommit-id>\nmake build\n# binary is in bin\u002Fe2e — add to PATH or copy to $GOPATH\u002Fbin\n```\n\n### swctl, yq, and other tools\n\nE2E test cases run pre-install steps (see `setup.steps` in each `e2e.yaml`) that install tools into `\u002Ftmp\u002Fskywalking-infra-e2e\u002Fbin`. When running locally, you need these tools on your PATH.\n\n**swctl** — SkyWalking CLI, used in verify cases to query OAP's GraphQL API. Pinned at `SW_CTL_COMMIT` in `test\u002Fe2e-v2\u002Fscript\u002Fenv`:\n\n```bash\n# Option 1: Use the install script (same as CI)\nbash test\u002Fe2e-v2\u002Fscript\u002Fprepare\u002Fsetup-e2e-shell\u002Finstall.sh swctl\nexport PATH=\u002Ftmp\u002Fskywalking-infra-e2e\u002Fbin:$PATH\n\n# Option 2: Build from source\ngo install github.com\u002Fapache\u002Fskywalking-cli\u002Fcmd\u002Fswctl@\u003CSW_CTL_COMMIT>\n```\n\n**yq** — YAML processor, used in verify cases:\n\n```bash\n# Option 1: Use the install script\nbash test\u002Fe2e-v2\u002Fscript\u002Fprepare\u002Fsetup-e2e-shell\u002Finstall.sh yq\nexport PATH=\u002Ftmp\u002Fskywalking-infra-e2e\u002Fbin:$PATH\n\n# Option 2: brew install yq (macOS)\n```\n\n**Other tools** (only needed for specific test cases):\n\n| Tool | Install script | Used by |\n|------|---------------|---------|\n| `kubectl` | `install.sh kubectl` | Kubernetes-based tests |\n| `helm` | `install.sh helm` | Helm chart tests |\n| `istioctl` | `install.sh istioctl` | Istio\u002Fservice mesh tests |\n| `etcdctl` | `install.sh etcdctl` | etcd cluster tests |\n\nAll install scripts are at `test\u002Fe2e-v2\u002Fscript\u002Fprepare\u002Fsetup-e2e-shell\u002F`.\n\n## Steps\n\n### 1. Determine the test case\n\nResolve the user's argument to a full path under `test\u002Fe2e-v2\u002Fcases\u002F`. If ambiguous, list matching directories and ask.\n\n```bash\nls test\u002Fe2e-v2\u002Fcases\u002F\u003Cargument>\u002Fe2e.yaml\n```\n\n### 2. Check if rebuild is needed\n\nCompare source file timestamps against the last build:\n\n```bash\n# OAP server changes since last build\nfind oap-server apm-protocol -type f \\( \\\n  -name \"*.java\" -o -name \"*.yaml\" -o -name \"*.yml\" -o \\\n  -name \"*.json\" -o -name \"*.xml\" -o -name \"*.properties\" -o \\\n  -name \"*.proto\" \\\n\\) -newer dist\u002Fapache-skywalking-apm-bin.tar.gz 2>\u002Fdev\u002Fnull | head -5\n\n# Test service changes since last build\nfind test\u002Fe2e-v2\u002Fjava-test-service -type f \\( \\\n  -name \"*.java\" -o -name \"*.xml\" -o -name \"*.yaml\" -o -name \"*.yml\" \\\n\\) -newer test\u002Fe2e-v2\u002Fjava-test-service\u002Fe2e-service-provider\u002Ftarget\u002F*.jar 2>\u002Fdev\u002Fnull | head -5\n```\n\nIf files are found, warn the user and suggest rebuilding before running.\n\n### 3. Rebuild if needed (only with user confirmation)\n\n```bash\n# Rebuild OAP\n.\u002Fmvnw clean flatten:flatten package -Pall -Dmaven.test.skip && make docker\n\n# Rebuild test services\n.\u002Fmvnw -f test\u002Fe2e-v2\u002Fjava-test-service\u002Fpom.xml clean flatten:flatten package\n```\n\n### 4. Run the E2E test\n\nSet required environment variables and run:\n\n```bash\nexport SW_AGENT_JDK_VERSION=8\ne2e run -c test\u002Fe2e-v2\u002Fcases\u002F\u003Ccase-path>\u002Fe2e.yaml\n```\n\n### 5. If the test fails\n\nDo NOT run cleanup immediately. Instead:\n\n1. Check container logs:\n   ```bash\n   docker compose -f test\u002Fe2e-v2\u002Fcases\u002F\u003Ccase-path>\u002Fdocker-compose.yml logs oap\n   docker compose -f test\u002Fe2e-v2\u002Fcases\u002F\u003Ccase-path>\u002Fdocker-compose.yml logs provider\n   ```\n\n2. Run verify separately (can retry after investigation):\n   ```bash\n   e2e verify -c test\u002Fe2e-v2\u002Fcases\u002F\u003Ccase-path>\u002Fe2e.yaml\n   ```\n\n3. Only cleanup when done debugging:\n   ```bash\n   e2e cleanup -c test\u002Fe2e-v2\u002Fcases\u002F\u003Ccase-path>\u002Fe2e.yaml\n   ```\n\n### 6. Manually fire each verify query (fast triage)\n\nThe `e2e verify` retry loop runs in sequence and stops at the first failing case, so a single bad query hides every case after it. When a verify fails, **run each verify case directly against the still-running OAP** before editing anything — you'll see the real error (bad flag, missing data, wrong expected), not the progress spinner. This is also the right way to author new verify cases: craft the query against live OAP, confirm the actual YAML, then write the expected file.\n\n```bash\n# Find the host-side port that infra-e2e bound to OAP's container port 12800.\n# (Each run picks a new random port; the trigger log prints it too.)\ndocker ps --filter \"name=skywalking_e2e-oap\" --format \"{{.Ports}}\" \\\n  | grep -oE \"[0-9]+->12800\" | head -1\n# => e.g. 56381->12800\n\nURL=http:\u002F\u002Flocalhost:56381\u002Fgraphql\nSWCTL=\u002Ftmp\u002Fskywalking-infra-e2e\u002Fbin\u002Fswctl\n\n# Copy the query from e2e.yaml verbatim, then substitute ${oap_host} → localhost\n# and ${oap_12800} → the port you just found:\n$SWCTL --display yaml --base-url=$URL service ly IOS\n$SWCTL --display yaml --base-url=$URL logs list --service-name=MyiOSApp\n$SWCTL --display yaml --base-url=$URL metrics exec --expression=service_cpm --service-name=MyiOSApp\n```\n\nWhen a `swctl` subcommand rejects a flag (`Incorrect Usage: flag provided but not defined: -layer`), the e2e config is using syntax the pinned `swctl` commit doesn't support. Find the right syntax with `swctl \u003Ccmd> --help` and update the e2e config. Common cases encountered:\n\n| Broken flag\u002Fform | Working form |\n|---|---|\n| `service ls --layer IOS` | `service ly IOS` |\n| `metrics exec ... --is-normal=true` | drop `--is-normal` (default behavior) |\n\nFor queries that *don't* use `swctl` (raw `curl` against `\u002Floki\u002F...`, Zipkin, PromQL), hit the matching exposed port:\n\n```bash\ncurl \"http:\u002F\u002Flocalhost:$(docker ps --filter name=skywalking_e2e-oap --format '{{.Ports}}' | grep -oE '[0-9]+->3100' | head -1 | cut -d'-' -f1)\u002Floki\u002Fapi\u002Fv1\u002Flabels\"\n```\n\n### 7. UI template changes require a fresh DB\n\n`UITemplateInitializer.initTemplate()` (in `oap-server\u002Fserver-core`) calls `uiTemplateManagementService.addIfNotExist(setting)` — keyed by the `id` field in each `ui-initialized-templates\u002F**\u002F*.json`. Same ID → skipped. So edits to an *existing* template JSON (adding widgets, relabeling, changing expressions) will **not** be applied on an already-initialized OAP, even after a container restart, because the old copy still lives in storage.\n\nTo pick up dashboard JSON changes:\n\n```bash\n# Remove both containers — BanyanDB stores state inside the container FS in the\n# e2e compose (no named volume), so removing the container wipes state cleanly.\ndocker rm -f skywalking_e2e-oap-1 skywalking_e2e-banyandb-1\n\n# For compose setups that use a named volume, also:\n# docker volume rm \u003Cvolume-name>\n\n# Then re-run — OAP sees empty storage, loads the new template JSON.\ne2e run -c test\u002Fe2e-v2\u002Fcases\u002F\u003Ccase>\u002Fe2e.yaml\n```\n\nSymptom to watch for: you edit the JSON, rebuild, redeploy — dashboard in the UI still shows the pre-edit layout. That's not a caching bug; that's `addIfNotExist` doing exactly what its name says.\n\n### 8. Author the expected YAML from live output\n\nFor a new verify case, the workflow is:\n\n1. Fire the query manually (see step 6) and capture the YAML.\n2. Pick which fields are *meaningful domain values* (must match exactly) vs *dynamic runtime values* (`notEmpty` \u002F `gt` \u002F `ge`). See `test\u002Fe2e-v2\u002FCLAUDE.md` for the decision guide.\n3. Write the expected file. If the response is a list, wrap the items in `{{- contains . }} ... {{- end }}` so ordering and extra actual items don't fail the match.\n4. Re-run `e2e verify` alone (the containers are still up from the previous run); iterate on the expected file without rebuilding.\n\n### 9. Expected-file authoring traps\n\nThese burn CI cycles and pass locally. Each was learned the hard way.\n\n**Unquoted `content: {{ notEmpty .content }}` with `:` inside the value.** Sim-generated or real log content routinely includes colons (`POST https:\u002F\u002Fapi.example.com\u002Fcart failed: 500`, `HTTP\u002F1.1 500: Internal Server Error`). Without quoting, the template renders to invalid YAML (snakeyaml parses `failed:` as a nested key) and the *whole log entry* marshals to `nil`. Symptom: diff shows `- nil` at *every* position in the expected logs list vs real maps in actual. Fix: wrap in single quotes — `content: '{{ notEmpty .content }}'`. Single-quoted YAML preserves `:` in the scalar; only fails on embedded `'`. Double quotes also work unless the content has `\"`.\n\n**Nested `contains` with multiple per-element pattern assertions against a varied stream.** The template renders the block body once per actual element; when the outer block body has *multiple* inner `contains` patterns asserting specific tag key\u002Fvalue pairs, and only *some* actuals satisfy all the inner patterns, `go-cmp` with `contains` can end up comparing `[rendered_for_A0, nil, nil, ...]` vs `[A0, A1, A2, ...]` and fail despite `contains` being permissive on extras. Specifically: outer `contains .logs` with a single log pattern + inner `contains .tags` asserting two distinct key\u002Fvalue pairs. On a simulator emitting heterogeneous errors (js + promise + ajax + pageNotFound), only a subset satisfy the inner assertion. Passes locally with 1–2 logs, fails in CI with 6+.\n- Keep the outer `contains` body lenient: field-shape checks (`notEmpty`, `gt`), one discriminator tag that *every* element in the stream carries.\n- Cover per-category assertions via separate labeled-metric verify cases, not inside the nested template.\n- Rule of thumb: \"at least one log exists with the right layer routing\" inside the logs expected; per-category coverage via `meter_*_count{label=X}` verify cases.\n\n**Hand-crafted OTLP curl payloads drift from real SDK output.** When the upstream SDK ships a published simulator image (mini-program-monitor's `sim-wechat` \u002F `sim-alipay`, browser-client-js sim, etc.), prefer driving the e2e with that image in `MODE=timed` with a bounded `DURATION_MS` over hand-rolling the OTLP JSON. Hand-crafted payloads miss real-world shape issues: delta-vs-cumulative temporality, label-cardinality surprises, stacktrace formatting variance, attribute key names that changed between SDK versions. Pin to a released tag (`v0.4.0`), not `:latest` or HEAD SHA — reproducibility.\n\n**`timeUnixNano: \"0\"` in an OTLP metric datapoint.** The receiver propagates this into MAL's bucket computation and the metric lands in the 1970 time bucket — `swctl metrics exec` over the \"last N minutes\" window won't find it. Either use `$(date +%s)000000000` at setup time or omit the field if the receiver accepts \"now\" as default.\n\n**Setup-step curl loop with `|| sleep` pattern.** The shell line `for ... do curl && break || sleep 5; done` exits 0 when every attempt connection-refused because the final `sleep 5` returns 0. OAP takes ~50 s to start in CI, so all attempts fail before OAP is ready, and the setup step silently succeeds with zero traffic ingested. Fix: `curl -sS -f --retry 30 --retry-delay 5 --retry-connrefused --retry-all-errors --max-time 10 ...` + `set -e` at step top.\n\n**`swctl` flag rejected.** If a verify case uses a flag the pinned `swctl` commit doesn't support (`service ls --layer` vs `service ly`), the whole case fails 20× before CI gives up. Fire each verify query by hand once before pushing (step 6 above).\n\n**Published image cache miss in CI.** `docker compose pull` sometimes hits rate limits or unreachable registries; the test spins until timeout with \"dependency failed to start\". Look at the CI log for `Error response from daemon: pull access denied` or `manifest unknown`. If you see that, pin a different image tag that's definitely published (check `docker manifest inspect \u003Ctag>` locally), not a floating one.\n\n## Common test cases\n\n| Shorthand | Path |\n|-----------|------|\n| `simple\u002Fjdk` | `test\u002Fe2e-v2\u002Fcases\u002Fsimple\u002Fjdk\u002F` |\n| `storage\u002Fbanyandb` | `test\u002Fe2e-v2\u002Fcases\u002Fstorage\u002Fbanyandb\u002F` |\n| `storage\u002Felasticsearch` | `test\u002Fe2e-v2\u002Fcases\u002Fstorage\u002Felasticsearch\u002F` |\n| `alarm` | `test\u002Fe2e-v2\u002Fcases\u002Falarm\u002F` |\n| `log` | `test\u002Fe2e-v2\u002Fcases\u002Flog\u002F` |\n| `profiling\u002Ftrace` | `test\u002Fe2e-v2\u002Fcases\u002Fprofiling\u002Ftrace\u002F` |\n","# Run SkyWalking E2E Test\n\nRun an E2E test case using `skywalking-infra-e2e`. The user provides a test case path (e.g., `simple\u002Fjdk`, `storage\u002Fbanyandb`, `alarm`).\n\n## Prerequisites\n\nAll tools require **Go** installed. Check `.github\u002Fworkflows\u002F` for the exact `e2e` commit used in CI.\n\n### e2e CLI\n\nBuilt from [apache\u002Fskywalking-infra-e2e](https:\u002F\u002Fgithub.com\u002Fapache\u002Fskywalking-infra-e2e), pinned by commit in CI:\n\n```bash\n# Install the pinned commit\ngo install github.com\u002Fapache\u002Fskywalking-infra-e2e\u002Fcmd\u002Fe2e@\u003Ccommit-id>\n\n# Or clone and build locally (useful when debugging the e2e tool itself)\ngit clone https:\u002F\u002Fgithub.com\u002Fapache\u002Fskywalking-infra-e2e.git\ncd skywalking-infra-e2e\ngit checkout \u003Ccommit-id>\nmake build\n# binary is in bin\u002Fe2e — add to PATH or copy to $GOPATH\u002Fbin\n```\n\n### swctl, yq, and other tools\n\nE2E test cases run pre-install steps (see `setup.steps` in each `e2e.yaml`) that install tools into `\u002Ftmp\u002Fskywalking-infra-e2e\u002Fbin`. When running locally, you need these tools on your PATH.\n\n**swctl** — SkyWalking CLI, used in verify cases to query OAP's GraphQL API. Pinned at `SW_CTL_COMMIT` in `test\u002Fe2e-v2\u002Fscript\u002Fenv`:\n\n```bash\n# Option 1: Use the install script (same as CI)\nbash test\u002Fe2e-v2\u002Fscript\u002Fprepare\u002Fsetup-e2e-shell\u002Finstall.sh swctl\nexport PATH=\u002Ftmp\u002Fskywalking-infra-e2e\u002Fbin:$PATH\n\n# Option 2: Build from source\ngo install github.com\u002Fapache\u002Fskywalking-cli\u002Fcmd\u002Fswctl@\u003CSW_CTL_COMMIT>\n```\n\n**yq** — YAML processor, used in verify cases:\n\n```bash\n# Option 1: Use the install script\nbash test\u002Fe2e-v2\u002Fscript\u002Fprepare\u002Fsetup-e2e-shell\u002Finstall.sh yq\nexport PATH=\u002Ftmp\u002Fskywalking-infra-e2e\u002Fbin:$PATH\n\n# Option 2: brew install yq (macOS)\n```\n\n**Other tools** (only needed for specific test cases):\n\n| Tool | Install script | Used by |\n|------|---------------|---------|\n| `kubectl` | `install.sh kubectl` | Kubernetes-based tests |\n| `helm` | `install.sh helm` | Helm chart tests |\n| `istioctl` | `install.sh istioctl` | Istio\u002Fservice mesh tests |\n| `etcdctl` | `install.sh etcdctl` | etcd cluster tests |\n\nAll install scripts are at `test\u002Fe2e-v2\u002Fscript\u002Fprepare\u002Fsetup-e2e-shell\u002F`.\n\n## Steps\n\n### 1. Determine the test case\n\nResolve the user's argument to a full path under `test\u002Fe2e-v2\u002Fcases\u002F`. If ambiguous, list matching directories and ask.\n\n```bash\nls test\u002Fe2e-v2\u002Fcases\u002F\u003Cargument>\u002Fe2e.yaml\n```\n\n### 2. Check if rebuild is needed\n\nCompare source file timestamps against the last build:\n\n```bash\n# OAP server changes since last build\nfind oap-server apm-protocol -type f \\( \\\n  -name \"*.java\" -o -name \"*.yaml\" -o -name \"*.yml\" -o \\\n  -name \"*.json\" -o -name \"*.xml\" -o -name \"*.properties\" -o \\\n  -name \"*.proto\" \\\n\\) -newer dist\u002Fapache-skywalking-apm-bin.tar.gz 2>\u002Fdev\u002Fnull | head -5\n\n# Test service changes since last build\nfind test\u002Fe2e-v2\u002Fjava-test-service -type f \\( \\\n  -name \"*.java\" -o -name \"*.xml\" -o -name \"*.yaml\" -o -name \"*.yml\" \\\n\\) -newer test\u002Fe2e-v2\u002Fjava-test-service\u002Fe2e-service-provider\u002Ftarget\u002F*.jar 2>\u002Fdev\u002Fnull | head -5\n```\n\nIf files are found, warn the user and suggest rebuilding before running.\n\n### 3. Rebuild if needed (only with user confirmation)\n\n```bash\n# Rebuild OAP\n.\u002Fmvnw clean flatten:flatten package -Pall -Dmaven.test.skip && make docker\n\n# Rebuild test services\n.\u002Fmvnw -f test\u002Fe2e-v2\u002Fjava-test-service\u002Fpom.xml clean flatten:flatten package\n```\n\n### 4. Run the E2E test\n\nSet required environment variables and run:\n\n```bash\nexport SW_AGENT_JDK_VERSION=8\ne2e run -c test\u002Fe2e-v2\u002Fcases\u002F\u003Ccase-path>\u002Fe2e.yaml\n```\n\n### 5. If the test fails\n\nDo NOT run cleanup immediately. Instead:\n\n1. Check container logs:\n   ```bash\n   docker compose -f test\u002Fe2e-v2\u002Fcases\u002F\u003Ccase-path>\u002Fdocker-compose.yml logs oap\n   docker compose -f test\u002Fe2e-v2\u002Fcases\u002F\u003Ccase-path>\u002Fdocker-compose.yml logs provider\n   ```\n\n2. Run verify separately (can retry after investigation):\n   ```bash\n   e2e verify -c test\u002Fe2e-v2\u002Fcases\u002F\u003Ccase-path>\u002Fe2e.yaml\n   ```\n\n3. Only cleanup when done debugging:\n   ```bash\n   e2e cleanup -c test\u002Fe2e-v2\u002Fcases\u002F\u003Ccase-path>\u002Fe2e.yaml\n   ```\n\n### 6. Manually fire each verify query (fast triage)\n\nThe `e2e verify` retry loop runs in sequence and stops at the first failing case, so a single bad query hides every case after it. When a verify fails, **run each verify case directly against the still-running OAP** before editing anything — you'll see the real error (bad flag, missing data, wrong expected), not the progress spinner. This is also the right way to author new verify cases: craft the query against live OAP, confirm the actual YAML, then write the expected file.\n\n```bash\n# Find the host-side port that infra-e2e bound to OAP's container port 12800.\n# (Each run picks a new random port; the trigger log prints it too.)\ndocker ps --filter \"name=skywalking_e2e-oap\" --format \"{{.Ports}}\" \\\n  | grep -oE \"[0-9]+->12800\" | head -1\n# => e.g. 56381->12800\n\nURL=http:\u002F\u002Flocalhost:56381\u002Fgraphql\nSWCTL=\u002Ftmp\u002Fskywalking-infra-e2e\u002Fbin\u002Fswctl\n\n# Copy the query from e2e.yaml verbatim, then substitute ${oap_host} → localhost\n# and ${oap_12800} → the port you just found:\n$SWCTL --display yaml --base-url=$URL service ly IOS\n$SWCTL --display yaml --base-url=$URL logs list --service-name=MyiOSApp\n$SWCTL --display yaml --base-url=$URL metrics exec --expression=service_cpm --service-name=MyiOSApp\n```\n\nWhen a `swctl` subcommand rejects a flag (`Incorrect Usage: flag provided but not defined: -layer`), the e2e config is using syntax the pinned `swctl` commit doesn't support. Find the right syntax with `swctl \u003Ccmd> --help` and update the e2e config. Common cases encountered:\n\n| Broken flag\u002Fform | Working form |\n|---|---|\n| `service ls --layer IOS` | `service ly IOS` |\n| `metrics exec ... --is-normal=true` | drop `--is-normal` (default behavior) |\n\nFor queries that *don't* use `swctl` (raw `curl` against `\u002Floki\u002F...`, Zipkin, PromQL), hit the matching exposed port:\n\n```bash\ncurl \"http:\u002F\u002Flocalhost:$(docker ps --filter name=skywalking_e2e-oap --format '{{.Ports}}' | grep -oE '[0-9]+->3100' | head -1 | cut -d'-' -f1)\u002Floki\u002Fapi\u002Fv1\u002Flabels\"\n```\n\n### 7. UI template changes require a fresh DB\n\n`UITemplateInitializer.initTemplate()` (in `oap-server\u002Fserver-core`) calls `uiTemplateManagementService.addIfNotExist(setting)` — keyed by the `id` field in each `ui-initialized-templates\u002F**\u002F*.json`. Same ID → skipped. So edits to an *existing* template JSON (adding widgets, relabeling, changing expressions) will **not** be applied on an already-initialized OAP, even after a container restart, because the old copy still lives in storage.\n\nTo pick up dashboard JSON changes:\n\n```bash\n# Remove both containers — BanyanDB stores state inside the container FS in the\n# e2e compose (no named volume), so removing the container wipes state cleanly.\ndocker rm -f skywalking_e2e-oap-1 skywalking_e2e-banyandb-1\n\n# For compose setups that use a named volume, also:\n# docker volume rm \u003Cvolume-name>\n\n# Then re-run — OAP sees empty storage, loads the new template JSON.\ne2e run -c test\u002Fe2e-v2\u002Fcases\u002F\u003Ccase>\u002Fe2e.yaml\n```\n\nSymptom to watch for: you edit the JSON, rebuild, redeploy — dashboard in the UI still shows the pre-edit layout. That's not a caching bug; that's `addIfNotExist` doing exactly what its name says.\n\n### 8. Author the expected YAML from live output\n\nFor a new verify case, the workflow is:\n\n1. Fire the query manually (see step 6) and capture the YAML.\n2. Pick which fields are *meaningful domain values* (must match exactly) vs *dynamic runtime values* (`notEmpty` \u002F `gt` \u002F `ge`). See `test\u002Fe2e-v2\u002FCLAUDE.md` for the decision guide.\n3. Write the expected file. If the response is a list, wrap the items in `{{- contains . }} ... {{- end }}` so ordering and extra actual items don't fail the match.\n4. Re-run `e2e verify` alone (the containers are still up from the previous run); iterate on the expected file without rebuilding.\n\n### 9. Expected-file authoring traps\n\nThese burn CI cycles and pass locally. Each was learned the hard way.\n\n**Unquoted `content: {{ notEmpty .content }}` with `:` inside the value.** Sim-generated or real log content routinely includes colons (`POST https:\u002F\u002Fapi.example.com\u002Fcart failed: 500`, `HTTP\u002F1.1 500: Internal Server Error`). Without quoting, the template renders to invalid YAML (snakeyaml parses `failed:` as a nested key) and the *whole log entry* marshals to `nil`. Symptom: diff shows `- nil` at *every* position in the expected logs list vs real maps in actual. Fix: wrap in single quotes — `content: '{{ notEmpty .content }}'`. Single-quoted YAML preserves `:` in the scalar; only fails on embedded `'`. Double quotes also work unless the content has `\"`.\n\n**Nested `contains` with multiple per-element pattern assertions against a varied stream.** The template renders the block body once per actual element; when the outer block body has *multiple* inner `contains` patterns asserting specific tag key\u002Fvalue pairs, and only *some* actuals satisfy all the inner patterns, `go-cmp` with `contains` can end up comparing `[rendered_for_A0, nil, nil, ...]` vs `[A0, A1, A2, ...]` and fail despite `contains` being permissive on extras. Specifically: outer `contains .logs` with a single log pattern + inner `contains .tags` asserting two distinct key\u002Fvalue pairs. On a simulator emitting heterogeneous errors (js + promise + ajax + pageNotFound), only a subset satisfy the inner assertion. Passes locally with 1–2 logs, fails in CI with 6+.\n- Keep the outer `contains` body lenient: field-shape checks (`notEmpty`, `gt`), one discriminator tag that *every* element in the stream carries.\n- Cover per-category assertions via separate labeled-metric verify cases, not inside the nested template.\n- Rule of thumb: \"at least one log exists with the right layer routing\" inside the logs expected; per-category coverage via `meter_*_count{label=X}` verify cases.\n\n**Hand-crafted OTLP curl payloads drift from real SDK output.** When the upstream SDK ships a published simulator image (mini-program-monitor's `sim-wechat` \u002F `sim-alipay`, browser-client-js sim, etc.), prefer driving the e2e with that image in `MODE=timed` with a bounded `DURATION_MS` over hand-rolling the OTLP JSON. Hand-crafted payloads miss real-world shape issues: delta-vs-cumulative temporality, label-cardinality surprises, stacktrace formatting variance, attribute key names that changed between SDK versions. Pin to a released tag (`v0.4.0`), not `:latest` or HEAD SHA — reproducibility.\n\n**`timeUnixNano: \"0\"` in an OTLP metric datapoint.** The receiver propagates this into MAL's bucket computation and the metric lands in the 1970 time bucket — `swctl metrics exec` over the \"last N minutes\" window won't find it. Either use `$(date +%s)000000000` at setup time or omit the field if the receiver accepts \"now\" as default.\n\n**Setup-step curl loop with `|| sleep` pattern.** The shell line `for ... do curl && break || sleep 5; done` exits 0 when every attempt connection-refused because the final `sleep 5` returns 0. OAP takes ~50 s to start in CI, so all attempts fail before OAP is ready, and the setup step silently succeeds with zero traffic ingested. Fix: `curl -sS -f --retry 30 --retry-delay 5 --retry-connrefused --retry-all-errors --max-time 10 ...` + `set -e` at step top.\n\n**`swctl` flag rejected.** If a verify case uses a flag the pinned `swctl` commit doesn't support (`service ls --layer` vs `service ly`), the whole case fails 20× before CI gives up. Fire each verify query by hand once before pushing (step 6 above).\n\n**Published image cache miss in CI.** `docker compose pull` sometimes hits rate limits or unreachable registries; the test spins until timeout with \"dependency failed to start\". Look at the CI log for `Error response from daemon: pull access denied` or `manifest unknown`. If you see that, pin a different image tag that's definitely published (check `docker manifest inspect \u003Ctag>` locally), not a floating one.\n\n## Common test cases\n\n| Shorthand | Path |\n|-----------|------|\n| `simple\u002Fjdk` | `test\u002Fe2e-v2\u002Fcases\u002Fsimple\u002Fjdk\u002F` |\n| `storage\u002Fbanyandb` | `test\u002Fe2e-v2\u002Fcases\u002Fstorage\u002Fbanyandb\u002F` |\n| `storage\u002Felasticsearch` | `test\u002Fe2e-v2\u002Fcases\u002Fstorage\u002Felasticsearch\u002F` |\n| `alarm` | `test\u002Fe2e-v2\u002Fcases\u002Falarm\u002F` |\n| `log` | `test\u002Fe2e-v2\u002Fcases\u002Flog\u002F` |\n| `profiling\u002Ftrace` | `test\u002Fe2e-v2\u002Fcases\u002Fprofiling\u002Ftrace\u002F` |\n",{"name":54,"description":55,"argument-hint":56,"disable-model-invocation":57},"run-e2e","Run SkyWalking E2E tests locally","[test-case-path]",true,"master","f4d38fdc21e5a929ef89556a1d7c337957523aa9","config\u002Fpi\u002Fagent\u002Fextensions\u002Floop\u002Fskills\u002Fpi-loop",19,"https:\u002F\u002Fgithub.com\u002Fahmedelgabri\u002Fdotfiles","https:\u002F\u002Fgithub.com\u002Fahmedelgabri","https:\u002F\u002Fgabri.me","…","2026-11-09 00:32:17",{"source":9,"skillName":54,"commands":68,"prompt":78,"zipAvailable":57},[69,72,75],{"tool":70,"command":71},"npx","npx skills add ahmedelgabri\u002Fdotfiles --skill run-e2e",{"tool":73,"command":74},"bunx","bunx skills add ahmedelgabri\u002Fdotfiles --skill run-e2e",{"tool":76,"command":77},"pnpm","pnpm dlx skills add ahmedelgabri\u002Fdotfiles --skill run-e2e","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fahmedelgabri\u002Fdotfiles\u002Fblob\u002Fmain\u002Fconfig\u002Fpi\u002Fagent\u002Fextensions\u002Floop\u002Fskills\u002Fpi-loop\u002FSKILL.md",[],[81,115,134,159,180,205],{"skillNo":82,"name":83,"nameZh":84,"description":85,"descriptionZh":86,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":87,"categories":88,"keywords":95,"publishedAt":49},"01M6BTHRPVBTX8Y3EHQYP5464N","youtube-transcript","YouTube 视频字幕转录获取","Retrieve a YouTube video transcript with yt-dlp using human or automatic captions. Save timestamped text locally. Use when asked for a YouTube transcript, subtitles, captions, or spoken text from a YouTube link.","使用 yt-dlp 通过人工或自动字幕获取 YouTube 视频的转录文本，并在本地保存带时间戳的文本。当用户要求获取 YouTube 视频的转录稿、字幕、说明文字或来自 YouTube 链接的口述内容时使用。","https:\u002F\u002Fgithub.com\u002Fahmedelgabri\u002Fdotfiles\u002Fblob\u002Fmain\u002Fconfig\u002Fagents\u002Fskills\u002Fyoutube-transcript\u002FSKILL.md",[89,92],{"categoryNo":90,"categoryName":91,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRP9HTCQJVTBV9WC1A6N5B","多媒体素材检索与处理",{"categoryNo":93,"categoryName":94,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8C55A3R2M9C8CAKG3W16HTA","内容创作者",[96,97,98,99,100,36,101,102,103,104,105,106,107,45,108,109,110,111,112,113,114],"youtube","transcript","youtube transcript","when","yt-dlp","video transcript","URL","with","output","link","id","human","text","save","Captions","Video","dlp","file","subtitles",{"skillNo":116,"name":117,"nameZh":118,"description":119,"descriptionZh":120,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":121,"categories":122,"keywords":129,"publishedAt":49},"01M6BTHPAGHJ9KK6MB8HDC97Q8","unslop","非代码文本去 AI 痕迹","Cut AI tells from any writing NOT code. Must always apply.","从任何非代码文字中去除 AI 痕迹。必须始终应用。","https:\u002F\u002Fgithub.com\u002Fahmedelgabri\u002Fdotfiles\u002Fblob\u002Fmain\u002Fconfig\u002Fagents\u002Fskills\u002Funslop\u002FSKILL.md",[123,126],{"categoryNo":124,"categoryName":125,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TRAEZFJ43R95HPEBJYG","知识工作者",{"categoryNo":127,"categoryName":128,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C1YEW2680C003GGBD6QCKB","回复风格与输出控制",[117,130,131,132,133],"cut","code","writing","apply",{"skillNo":135,"name":136,"nameZh":137,"description":138,"descriptionZh":139,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":140,"categories":141,"keywords":148,"publishedAt":49},"01M6BTHKTB6SB3JEY6667PXKYP","shannon","Neovim 代码标注与导航","Interact with Neovim via RPC to annotate code, navigate files, and do walkthroughs","通过 RPC 与 Neovim 交互，为代码添加标注、在文件间导航并进行代码走查讲解。","https:\u002F\u002Fgithub.com\u002Fahmedelgabri\u002Fdotfiles\u002Fblob\u002Fmain\u002Fconfig\u002Fagents\u002Fskills\u002Fshannon\u002FSKILL.md",[142,145],{"categoryNo":143,"categoryName":144,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师",{"categoryNo":146,"categoryName":147,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSTR9G4A4GZ0VB2DFN9490","开发环境与工具链管理",[136,149,150,103,151,152,153,154,131,155,156,157,158],"neovim","navigate","rpc","via","Bash","annotate","do","files","read","grep",{"skillNo":160,"name":161,"nameZh":162,"description":163,"descriptionZh":164,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":165,"categories":166,"keywords":169,"publishedAt":49},"01M6BTHHFSD5H7XR3ZRBSVFVPK","rex","Rex 终端会话管理","Use the rex CLI to manage Rex sessions, open tabs, arrange panes, run commands, inspect terminal output, and control connected Rex apps.","使用 rex CLI 管理 Rex 会话、打开标签页、排列窗格、运行命令、查看终端输出，并控制已连接的 Rex 应用。","https:\u002F\u002Fgithub.com\u002Fahmedelgabri\u002Fdotfiles\u002Fblob\u002Fmain\u002Fconfig\u002Fagents\u002Fskills\u002Frex\u002FSKILL.md",[167,168],{"categoryNo":143,"categoryName":144,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":146,"categoryName":147,"taxonomyType":28,"taxonomyTypeDesc":29},[161,48,104,170,171,172,173,41,45,174,175,176,177,178,179],"apps","control","commands","arrange","panes","open","inspect","sessions","terminal","cli",{"skillNo":181,"name":182,"nameZh":183,"description":184,"descriptionZh":185,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":186,"categories":187,"keywords":192,"publishedAt":49},"01M6BTHF5G2K3Q990PFD7BEMZ9","pr-review","GitHub PR 审查","Review a GitHub pull request, examining the summary, linked resources, and diff","审查 GitHub 拉取请求（PR），检查其摘要、关联资源和代码差异（diff）。","https:\u002F\u002Fgithub.com\u002Fahmedelgabri\u002Fdotfiles\u002Fblob\u002Fmain\u002Fconfig\u002Fagents\u002Fskills\u002Fpr-review\u002FSKILL.md",[188,189],{"categoryNo":143,"categoryName":144,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":190,"categoryName":191,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BR5V701HCN066VEP7H4812","代码仓库协作管理",[193,194,195,196,157,158,153,197,198,199,200,201,202,102,203,204],"pr","pr review","review","webfetch","pull","pull request","github","diff","request","number","resources","summary",{"skillNo":206,"name":207,"nameZh":208,"description":209,"descriptionZh":210,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":211,"categories":212,"keywords":215,"publishedAt":49},"01M6BTHC9YP08V0S9HXH78R9FT","pr-create","GitHub PR 草稿创建","Create a GitHub pull request as a draft, auto-generating title and body from commits","创建 GitHub 拉取请求（PR）草稿，根据提交记录自动生成标题和正文。","https:\u002F\u002Fgithub.com\u002Fahmedelgabri\u002Fdotfiles\u002Fblob\u002Fmain\u002Fconfig\u002Fagents\u002Fskills\u002Fpr-create\u002FSKILL.md",[213,214],{"categoryNo":143,"categoryName":144,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":190,"categoryName":191,"taxonomyType":28,"taxonomyTypeDesc":29},[193,216,217,199,201,218,219,40,220,221,157,158,153,222,197,198],"pr create","create","body","title","draft","auto","commits"]