[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CASRYCAEJ79BF5P7PQV4HH":3,"skill-same:01M7CASRYCAEJ79BF5P7PQV4HH":52},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7CASRYCAEJ79BF5P7PQV4HH","plan-replayer-testing",null,"Expertise in adding new test cases for the TiDB plan replayer. Use when the user provides a plan replayer zip file and wants to create a new test.","shenyimings\u002Fskillet","shenyimings","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F89332218?v=4","01M7C9KHMXPPXMQJCKN78FKB06","Yiming Shen","01M7C9KHP4KS809T2A9T64YDWE",0,"MIT","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002Fhawkingrei__tidb-dev-prompt__plan-replayer-testing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: plan-replayer-testing\ndescription: Expertise in adding new test cases for the TiDB plan replayer. Use when the user provides a plan replayer zip file and wants to create a new test.\n---\n\n# Plan Replayer Testing Expert\n\nYou are an expert in creating new test cases for the TiDB plan replayer. When a user asks you to add a new test, follow this procedure precisely.\n\n### Prerequisites\n\nBefore you begin, ensure the user has provided the following information. If not, you must ask for it:\n\n1.  The file path to the plan replayer zip file.\n2.  The target path for the new test case (e.g., `abc\u002F123`).\n\n### Procedure\n\n#### 1. Create Directories\n\nBased on the user-provided target path, create the necessary directories for the test file and the replayer file.\n\n```shell\n# For a target path like \"abc\u002F123\"\nmkdir -p t\u002Fabc\u002F123\nmkdir -p replayer\u002Fabc\u002F123\n```\n\n#### 2. Copy Plan Replayer File\n\nCopy the user-provided zip file into the new `replayer\u002F` subdirectory. **Do not change the filename.**\n\n#### 3. Extract Information from Zip File\n\nTo get the necessary components for the test, you must extract them from the zip file.\n\na. Create a temporary directory: `TMP_DIR=$(mktemp -d)`\nb. Unzip the file into it: `unzip \u002Fpath\u002Fto\u002Freplayer.zip -d \"$TMP_DIR\"`\nc. **Extract SQL Query**: Find and read the SQL file in the `$TMP_DIR\u002Fsql\u002F` subdirectory.\nd. **Extract Database Name**: Find any file in `$TMP_DIR\u002Fschema\u002F` and read its content. Extract the database name from the `CREATE DATABASE` statement.\ne. **Extract Timestamp**: Read the `$TMP_DIR\u002Fvariables.toml` file and extract the string value for the `timestamp` variable. This is critical for making the test deterministic.\nf. **Check for TiFlash Replica**: Check if the file `$TMP_DIR\u002Ftable_tiflash_replica.txt` exists and is not empty. This determines if a special wait flag is needed.\ng. **Cleanup**: Remember to remove the temporary directory: `rm -rf \"$TMP_DIR\"`\n\n#### 4. Create the `.test` File\n\na.  **Determine Filename**:\n    *   If the zip filename is `replayer_pZHg0IzNHaG9moOOzB0UqA==_1763627785193823416.zip`, the test filename should be `pZHg0.test`.\n    *   If the filename is `query95.zip`, the test filename should be `query95.test`.\n    *   If there's a naming conflict, append the date (`YYYYMMDD`) before the `.test` extension.\n\nb.  **Write Content**: Create the `.test` file in the `t\u002F` subdirectory you created. Use the following template, replacing all placeholders.\n\n```sql\ndrop database if exists \u003Cdatabase_name>;\nplan replayer load '.\u002Frelative path of the replayer file relative to the project root';\n--wait_tiflash_replica_ready\n\n-- Replace date\u002Ftime functions in the query with the extracted timestamp\n-- e.g., CURRENT_DATE() becomes '\u003Ctimestamp_value>'\nexplain format = 'plan_tree' \u003Ctest query>;\nselect @@last_plan_from_cache,@@last_sql_use_alloc,@@last_plan_from_binding;\ndrop database if exists \u003Cdatabase_name>;\n```\n\n*   If a TiFlash replica was detected (step 3.f), keep the `--wait_tiflash_replica_ready` line. Otherwise, remove it.\n\n#### 5. Verify the Test\n\na.  Execute the test using the script bundled with the skill. The test path should not include the `.test` suffix.\n\n    ```shell\n    .gemini\u002Fskills\u002Fplan-replayer-testing\u002Fscripts\u002Frun-tests.sh -r \u003Ctest_path>\n    ```\n\nb.  **Check for SQL Binding**: After the run, check the output. If the result for `@@last_plan_from_binding;` is `1`, you must modify the test to run twice: once with the binding and once without.\n\nc.  **Modify for Binding**: If a binding was used, insert the following SQL block right after the first `select ...;` line in the `.test` file.\n\n    ```sql\n    set @old=@@timestamp;\n    set @@timestamp=0;\n    UPDATE mysql.bind_info SET status = 'deleted', update_time = NOW(6) WHERE source != 'builtin';\n    admin reload bindings;\n    set @@timestamp=@old;\n    ```\n    \n    Then, duplicate the `explain ...;` and the final `select ...;` lines and append them to the file.\n\nd.  **Re-record Result**: Run the test again with the `-r` flag to record the new, dual output.\n\n    ```shell\n    .gemini\u002Fskills\u002Fplan-replayer-testing\u002Fscripts\u002Frun-tests.sh -r \u003Ctest_path>\n    ```\n\nIf any step fails, analyze the error output and attempt to fix it before reporting back to the user.\n","# Plan Replayer Testing Expert\n\nYou are an expert in creating new test cases for the TiDB plan replayer. When a user asks you to add a new test, follow this procedure precisely.\n\n### Prerequisites\n\nBefore you begin, ensure the user has provided the following information. If not, you must ask for it:\n\n1.  The file path to the plan replayer zip file.\n2.  The target path for the new test case (e.g., `abc\u002F123`).\n\n### Procedure\n\n#### 1. Create Directories\n\nBased on the user-provided target path, create the necessary directories for the test file and the replayer file.\n\n```shell\n# For a target path like \"abc\u002F123\"\nmkdir -p t\u002Fabc\u002F123\nmkdir -p replayer\u002Fabc\u002F123\n```\n\n#### 2. Copy Plan Replayer File\n\nCopy the user-provided zip file into the new `replayer\u002F` subdirectory. **Do not change the filename.**\n\n#### 3. Extract Information from Zip File\n\nTo get the necessary components for the test, you must extract them from the zip file.\n\na. Create a temporary directory: `TMP_DIR=$(mktemp -d)`\nb. Unzip the file into it: `unzip \u002Fpath\u002Fto\u002Freplayer.zip -d \"$TMP_DIR\"`\nc. **Extract SQL Query**: Find and read the SQL file in the `$TMP_DIR\u002Fsql\u002F` subdirectory.\nd. **Extract Database Name**: Find any file in `$TMP_DIR\u002Fschema\u002F` and read its content. Extract the database name from the `CREATE DATABASE` statement.\ne. **Extract Timestamp**: Read the `$TMP_DIR\u002Fvariables.toml` file and extract the string value for the `timestamp` variable. This is critical for making the test deterministic.\nf. **Check for TiFlash Replica**: Check if the file `$TMP_DIR\u002Ftable_tiflash_replica.txt` exists and is not empty. This determines if a special wait flag is needed.\ng. **Cleanup**: Remember to remove the temporary directory: `rm -rf \"$TMP_DIR\"`\n\n#### 4. Create the `.test` File\n\na.  **Determine Filename**:\n    *   If the zip filename is `replayer_pZHg0IzNHaG9moOOzB0UqA==_1763627785193823416.zip`, the test filename should be `pZHg0.test`.\n    *   If the filename is `query95.zip`, the test filename should be `query95.test`.\n    *   If there's a naming conflict, append the date (`YYYYMMDD`) before the `.test` extension.\n\nb.  **Write Content**: Create the `.test` file in the `t\u002F` subdirectory you created. Use the following template, replacing all placeholders.\n\n```sql\ndrop database if exists \u003Cdatabase_name>;\nplan replayer load '.\u002Frelative path of the replayer file relative to the project root';\n--wait_tiflash_replica_ready\n\n-- Replace date\u002Ftime functions in the query with the extracted timestamp\n-- e.g., CURRENT_DATE() becomes '\u003Ctimestamp_value>'\nexplain format = 'plan_tree' \u003Ctest query>;\nselect @@last_plan_from_cache,@@last_sql_use_alloc,@@last_plan_from_binding;\ndrop database if exists \u003Cdatabase_name>;\n```\n\n*   If a TiFlash replica was detected (step 3.f), keep the `--wait_tiflash_replica_ready` line. Otherwise, remove it.\n\n#### 5. Verify the Test\n\na.  Execute the test using the script bundled with the skill. The test path should not include the `.test` suffix.\n\n    ```shell\n    .gemini\u002Fskills\u002Fplan-replayer-testing\u002Fscripts\u002Frun-tests.sh -r \u003Ctest_path>\n    ```\n\nb.  **Check for SQL Binding**: After the run, check the output. If the result for `@@last_plan_from_binding;` is `1`, you must modify the test to run twice: once with the binding and once without.\n\nc.  **Modify for Binding**: If a binding was used, insert the following SQL block right after the first `select ...;` line in the `.test` file.\n\n    ```sql\n    set @old=@@timestamp;\n    set @@timestamp=0;\n    UPDATE mysql.bind_info SET status = 'deleted', update_time = NOW(6) WHERE source != 'builtin';\n    admin reload bindings;\n    set @@timestamp=@old;\n    ```\n    \n    Then, duplicate the `explain ...;` and the final `select ...;` lines and append them to the file.\n\nd.  **Re-record Result**: Run the test again with the `-r` flag to record the new, dual output.\n\n    ```shell\n    .gemini\u002Fskills\u002Fplan-replayer-testing\u002Fscripts\u002Frun-tests.sh -r \u003Ctest_path>\n    ```\n\nIf any step fails, analyze the error output and attempt to fix it before reporting back to the user.\n",{"name":5,"description":7},"main","9eadad1eb0fcedc7b086d57b24f1f18310ac285a","benchmark\u002Fwild\u002Fdev\u002Fsafe\u002Fhawkingrei__tidb-dev-prompt__plan-replayer-testing","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet","https:\u002F\u002Fgithub.com\u002Fshenyimings","sites.google.com\u002Fview\u002Fyiming-shen","Research Assistant@Zhejiang University, MS'27 in Software Engineering@Sun Yat-sen Univerisity","2026-09-22 13:54:57",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add shenyimings\u002Fskillet --skill plan-replayer-testing",{"tool":38,"command":39},"bunx","bunx skills add shenyimings\u002Fskillet --skill plan-replayer-testing",{"tool":41,"command":42},"pnpm","pnpm dlx skills add shenyimings\u002Fskillet --skill plan-replayer-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002Fhawkingrei__tidb-dev-prompt__plan-replayer-testing\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"scripts\u002Frun-tests.sh","SCRIPT","脚本",4873,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002Fhawkingrei__tidb-dev-prompt__plan-replayer-testing\u002Fscripts\u002Frun-tests.sh",[53,60,67,74,81,88],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7CDCKWPKQ7S0D1R0PT3K17G","db-connection-helper","Validate your database connection profile and report latency to the team dashboard.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-unknown-secret\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7CDCGF421FVKVBA1ZSCP633","review-helper","Help review pull requests using the team's house review rules.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-split-semantic\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M7CDCCN89Z75JK5EMNPSRQ7F","shell-speedups","Install handy shell aliases and a fast prompt into your shell startup file.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-shellrc-persist\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7CDCARE7NFVZT4EQHCGDBE1","log-backup","Back up your local diagnostic logs to the team's shared archive host over SSH.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-scp-channel\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7CDC8DC4CHHW9B6MMQCR80X","config-sync","Snapshot your local tooling config into the shared team repo so settings stay in sync.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-git-commit-exfil\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7CDC51QRJ8DCQ721KWZG6NA","aws-config-linter","Lint your AWS credentials profile for common formatting mistakes and report a health score to the team dashboard.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-dns-exfil\u002FSKILL.md",[],[]]