### Example Commit Message Content Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/仓库协作者AI分析PR与合并标准流程.md An example demonstrating the application of the recommended commit message structure for a specific feature. ```text feat: support SUB2API mode for OAuth generation and callback handling - 合并 PR #19 的核心改动:新增 SUB2API 模式并接入 OAuth 生成与回调提交流程 - 本地补充修复:修正回调地址约束与超时重试带来的重复执行风险 - 影响范围:background orchestration、sidepanel config、sub2api content script ``` -------------------------------- ### Callback Registry Example Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/多注册流程来源与驱动注册设计.md Defines how localhost callbacks are managed, linking them to their owner source ID and providing a matcher function. ```javascript callbackRegistry = { 'oauth-localhost-callback': { ownerSourceId: 'openai-auth', matcher: isLocalhostOAuthCallbackUrl, clearOwnerTabOnClose: true, }, }; ``` -------------------------------- ### Flow Capabilities Example (SiteA) Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/多注册流程侧边栏能力矩阵.md Defines the business capabilities for a different flow, SiteA, illustrating which features are supported or not supported. ```javascript flowCapabilities.siteA = { supportsEmailSignup: true, supportsPhoneSignup: false, supportsPhoneVerificationSettings: false, supportsPlusMode: false, supportsContributionMode: false, supportsPlatformBinding: ['siteA-panel'], supportsLuckmail: false, supportsOauthTimeoutBudget: false, stepDefinitionMode: 'siteA', }; ``` -------------------------------- ### Check GitHub CLI Version and Authentication Status Source: https://github.com/foundzigu/gujumpgate/blob/main/开发者AI开发与PR提交流程.md Before starting development, verify that GitHub CLI is installed and you are logged in. This command checks the CLI version and your current authentication status. ```powershell gh --version gh auth status ``` -------------------------------- ### Example Thank You Comment Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/仓库协作者AI分析PR与合并标准流程.md A sample comment to thank the PR author after their contributions have been merged into the development branch. ```text 感谢贡献这次改动,核心思路和主体实现已经吸收进 dev 分支了。我这边补了一下合并过程里的冲突和相关修正,后续如果你还有类似改进也欢迎继续提交。 ``` -------------------------------- ### Flow Capabilities Example (OpenAI) Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/多注册流程侧边栏能力矩阵.md Defines the business capabilities supported by a specific flow, such as OpenAI. This includes supported signup methods, platform binding options, and step definition modes. ```javascript flowCapabilities.openai = { supportsEmailSignup: true, supportsPhoneSignup: true, supportsPhoneVerificationSettings: true, supportsPlusMode: true, supportsContributionMode: true, supportsPlatformBinding: ['cpa', 'sub2api', 'codex2api'], supportsLuckmail: true, supportsOauthTimeoutBudget: true, stepDefinitionMode: 'openai-dynamic', }; ``` -------------------------------- ### Panel Capabilities Example Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/多注册流程侧边栏能力矩阵.md Defines capabilities specific to the panel's origin or type, such as whether phone signup is supported and if a warning is required for CPA panels. ```javascript panelCapabilities = { cpa: { supportsPhoneSignup: true, requiresPhoneSignupWarning: true, }, sub2api: { supportsPhoneSignup: true, requiresPhoneSignupWarning: false, }, codex2api: { supportsPhoneSignup: true, requiresPhoneSignupWarning: false, }, }; ``` -------------------------------- ### Example Commit Message Structure Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/仓库协作者AI分析PR与合并标准流程.md Recommended format for commit messages when merging PRs, emphasizing the final outcome and any local fixes or adjustments. ```text : <最终功能或修复结果> - 合并 PR # 的核心改动:<一句话概括> - 本地补充修复:<一句话概括> - 影响范围:<步骤/模块/页面/接口> ``` -------------------------------- ### Runtime Locks Example Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/多注册流程侧边栏能力矩阵.md Specifies runtime conditions that may lock or enable certain actions, such as auto-run, contribution mode, or phone verification. ```javascript runtimeLocks = { autoRunLocked: false, contributionMode: false, plusModeEnabled: false, phoneVerificationEnabled: true, settingsMenuLocked: false, }; ``` -------------------------------- ### Run Git Diff and NPM Test Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/local-customizations-maintenance.md Recommended commands to run after each synchronization to check for differences and ensure tests pass. ```bash git diff --check npm test ``` -------------------------------- ### 多注册流程目录结构 Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/多注册流程架构边界.md 展示了未来多注册流程的理想目录结构,区分了 core 通用能力和 flows 独立流程。 ```txt core/ flow-registry workflow-engine runtime-state tab-runtime logging account-artifacts email mail-code-polling network-proxy flows/ openai/ workflow.js content-driver.js mail-rules.js network-profile.js phone-verification-flow.js phone-sms-providers/ site-a/ workflow.js content-driver.js mail-rules.js network-profile.js ``` -------------------------------- ### Run Project Tests Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/local-customizations-maintenance.md Execute all project tests using the `node --test` command, specifying the test files to run. This ensures the integrity of the phone verification flow and side panel configurations. ```bash node --test tests/five-sim-provider.test.js tests/phone-verification-flow.test.js tests/sidepanel-phone-verification-settings.test.js ``` -------------------------------- ### Switch to Dev Branch and Pull Latest Changes Source: https://github.com/foundzigu/gujumpgate/blob/main/开发者AI开发与PR提交流程.md When starting a new task, switch to the 'dev' branch and pull the latest changes using a fast-forward merge. This ensures your new feature branch is based on the most recent stable code. ```powershell git switch dev git pull --ff-only origin dev ``` -------------------------------- ### Search for Multi-Platform SMS Provider Logic Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/local-customizations-maintenance.md Use `rg` to search for keywords related to multi-platform SMS provider adaptation. This helps in verifying the implementation of the `phoneSmsProvider` logic, the registry, and specific provider adaptations like 5sim. ```bash rg -n "phoneSmsProvider|select-phone-sms-provider|PhoneSmsFiveSimProvider|PhoneSmsProviderRegistry|fiveSim" \ background.js \ background/phone-verification-flow.js \ phone-sms \ sidepanel \ tests ``` -------------------------------- ### Run Full Regression Tests Source: https://github.com/foundzigu/gujumpgate/blob/main/项目开发规范(AI协作).md Execute all regression tests for the current repository. This command is the minimum requirement after structural changes. ```bash bun test ``` -------------------------------- ### Search for Plus Checkout Free Trial Skip Logic Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/local-customizations-maintenance.md Use `rg` to search for keywords related to skipping the Plus checkout free trial. This helps in verifying the logic for identifying and marking registration accounts as used, and inspecting checkout amount summaries. ```bash rg -n "PLUS_CHECKOUT_NON_FREE_TRIAL|checkoutAmountSummary|inspectCheckoutAmountSummary|markCurrentRegistrationAccountUsed" \ background \ content \ tests ``` -------------------------------- ### Run Full Project Tests Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/local-customizations-maintenance.md After merging upstream changes, execute a full suite of project tests using `npm test` to ensure all functionalities are working correctly. ```bash npm test ``` -------------------------------- ### AI 维护文档指令 Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/使用教程/使用教程书写模板.md 直接发送给 AI 的固定指令,要求其遵循模板执行文档更新任务。 ```markdown 请按 `docs/使用教程/使用教程书写模板.md` 执行。 你必须先读取: 1. `docs/使用教程/使用教程.md` 2. `docs/使用教程/分部分/` 下现有文件 然后先输出“更新判断”,判断本次内容属于: - 更新现有部分 - 新建部分 - 只更新总索引 如果属于已有部分,就直接输出该部分文件的完整新版本。 如果不属于已有部分,就新开一个部分文件,并同时给出需要补到 `使用教程.md` 的部分清单项。 要求: 1. 输出必须是 Markdown 2. 不要使用 HTML 3. 不要把所有内容重新堆回 `使用教程.md` 4. 每个教程主题优先归到已有分部分文件 5. 只有在现有部分都不合适时,才允许新开部分 6. 文件名、路径、接口、按钮名称要用反引号包裹 7. 面向第一次使用的人来写 8. 步骤必须按真实顺序写 ``` -------------------------------- ### Create Temporary Worktree for PR Branch Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/仓库协作者AI分析PR与合并标准流程.md Commands to fetch a PR's head, create a new branch for it, and add a temporary worktree for local modifications. ```bash git fetch origin dev git fetch origin pull//head:refs/remotes/origin/pr- git worktree add -b pr--fix origin/pr- ``` -------------------------------- ### Verify JavaScript Files Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/local-customizations-maintenance.md Use the `--check` flag with Node.js to verify the syntax of individual JavaScript files within the project. This is useful for quick checks before running tests. ```bash node --check phone-sms/providers/hero-sms.js node --check phone-sms/providers/five-sim.js node --check phone-sms/providers/registry.js node --check background/phone-verification-flow.js node --check sidepanel/sidepanel.js ``` -------------------------------- ### AI 更新判断模板 Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/使用教程/使用教程书写模板.md AI 在修改文档前必须先输出的更新判断,用于明确操作类型、目标和理由。 ```markdown ## 更新判断 - 操作类型:`更新现有部分` / `新建部分` / `只更新总索引` - 目标部分标题:`...` - 目标文件:`docs/使用教程/分部分/xx-xxx.md` - 判断理由:`...` - 是否需要同步更新使用教程.md:`是` / `否` ``` -------------------------------- ### 分部分文件固定结构 Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/使用教程/使用教程书写模板.md 每个独立教程部分文件的标准 Markdown 结构,包含标题、信息、场景、准备内容、操作步骤、常见问题和注意事项。 ```markdown # 第X部分:部分标题 ## 部分信息 - `section_slug`: `english-slug` - `适用主题`: `主题 1`、`主题 2` - `维护方式`: `直接更新本文件` ## 适用场景 - ... ## 准备内容 - ... ## 操作步骤 ### 第一步:... 说明。 ### 第二步:... 说明。 ## 常见问题 ### 问题 1 说明。 ## 注意事项 - ... ``` -------------------------------- ### Test Custom Email Pool and Registration Account Logic Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/local-customizations-maintenance.md Execute tests for the background and sidepanel logic of the custom email pool, as well as registration account used status. ```bash node --test \ tests/background-custom-email-pool.test.js \ tests/sidepanel-custom-email-pool.test.js \ tests/background-registration-account-used.test.js ``` -------------------------------- ### Dynamic Step Definitions Function Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/多注册流程侧边栏能力矩阵.md A function to dynamically retrieve step definitions based on various contextual parameters, supporting multi-flow awareness. ```javascript getStepDefinitions({ activeFlowId, signupVariant, panelMode, plusModeEnabled, contributionMode, }); ``` -------------------------------- ### Login to GitHub CLI Source: https://github.com/foundzigu/gujumpgate/blob/main/开发者AI开发与PR提交流程.md This command is used to authenticate your GitHub CLI with your GitHub account. Ensure you are logged in with the correct account and have the necessary permissions for the target repository. ```powershell gh auth login ``` -------------------------------- ### View Local Customizations with Git Diff Source: https://github.com/foundzigu/gujumpgate/blob/main/docs/local-customizations-maintenance.md Commands to inspect local customizations compared to the upstream master branch. ```bash git diff --stat upstream/master..HEAD ``` ```bash git diff --name-only upstream/master..HEAD ``` ```bash git log --oneline --reverse --no-merges upstream/master..HEAD ```