eliteforge-agent-doctor
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEliteForge Agent Doctor
EliteForge Agent Doctor
触发门槛
Trigger Threshold
仅当用户明确说明当前项目遵守 或 时,才使用本技能。若用户未做出该项目级声明,不要启用本技能;按通用能力处理。
璀璨工坊规范eliteforge specificationOnly use this skill when the user explicitly states that the current project complies with the (Bright Workshop Specification) or . If the user does not make this project-level declaration, do not enable this skill; handle it according to general capabilities.
璀璨工坊规范eliteforge specification目标
Objectives
只做一件事:判断当前机器能否继续执行相关开发任务;如果不能,就基于当前系统已有能力尽量自动补齐。
Do only one thing: Determine whether the current machine can continue to execute relevant development tasks; if not, try to automatically complete the configurations as much as possible based on the current system's existing capabilities.
基础版本要求
Minimum Version Requirements
- Java/Javac:主版本必须为 25 或以上。
- Maven:必须为 3.9.10 或以上。
- Java/Javac: Major version must be 25 or above.
- Maven: Must be 3.9.10 or above.
必须先确认
Must Confirm First
在写入 hosts 前,必须问清用户的办公地:
- 重庆办公:使用 ,脚本参数为
references/cq-required-hosts.txt--office cq - 北京办公:使用 ,脚本参数为
references/bj-required-hosts.txt--office bj
如果用户没有确认办公地,只允许做诊断和非 hosts 修复,不要猜测 hosts 配置。
Before writing to hosts, you must ask the user for their office location:
- Chongqing Office: Use , script parameter is
references/cq-required-hosts.txt--office cq - Beijing Office: Use , script parameter is
references/bj-required-hosts.txt--office bj
If the user does not confirm the office location, only diagnosis and non-hosts fixes are allowed; do not guess the hosts configuration.
工作流
Workflow
-
先确认用户是重庆办公还是北京办公。
-
运行模式,只诊断不写入。
report返回码为report表示环境未就绪,不代表脚本异常。2
bash
python3 scripts/bootstrap_env.py --mode report --office cq
python3 scripts/bootstrap_env.py --mode report --office bj- 如果报告显示环境不完整,向用户确认是否自动修复后,运行 模式。
apply
bash
python3 scripts/bootstrap_env.py --mode apply --office cq
python3 scripts/bootstrap_env.py --mode apply --office bj-
如果自动安装被系统权限阻塞,报告缺失项和需要用户处理的权限条件。不要伪造安装成功。
-
只有后续任务确实要操作内部平台时,才安装内部 CLI。
bash
python3 scripts/bootstrap_env.py --mode apply --office cq --install-internal-clis- 修复后再运行一次 ,输出最终状态。
report
-
First confirm whether the user works in Chongqing or Beijing.
-
Run inmode, only diagnose without writing. A return code of
reportfrom2indicates the environment is not ready, not a script exception.report
bash
python3 scripts/bootstrap_env.py --mode report --office cq
python3 scripts/bootstrap_env.py --mode report --office bj- If the report shows the environment is incomplete, after confirming with the user whether to automatically fix it, run in mode.
apply
bash
python3 scripts/bootstrap_env.py --mode apply --office cq
python3 scripts/bootstrap_env.py --mode apply --office bj-
If automatic installation is blocked by system permissions, report the missing items and permission conditions that require user handling. Do not fake a successful installation.
-
Only install internal CLIs when subsequent tasks actually need to operate internal platforms.
bash
python3 scripts/bootstrap_env.py --mode apply --office cq --install-internal-clis- After fixing, run again to output the final status.
report
脚本负责的内容
Content Handled by the Script
- 识别系统信息:操作系统、平台、架构、Shell、PATH、home 目录、hosts 文件路径。
- 识别系统工具:、
git、python3、node、npm、npx、pipx、jq、rg、mvn、pnpm、java、javac、curl、wget等。sudo - 识别 SDKMAN 与包管理器:SDKMAN、、
brew、apt-get、dnf、yum、pacman、zypper、winget。choco - 默认只扫描每个 顶层文件中的
skills/eliteforge-*/SKILL.md章节,并按## Environment Variables规定的eliteforge-skill-spec格式识别 skill 环境变量;只报告变量名和缺失状态,不打印变量值。`VAR_NAME,SCREAMING_SNAKE_CASE` [optional|required|conditional] desc - 尝试安装必备命令:、
git、python3、node、npm、npx、pipx、jq、rg、Java/Javac 25 及以上、Maven 3.9.10 及以上。pnpm - 自动安装 Java/Javac 与 Maven 时,若当前机器已安装并可初始化 SDKMAN,必须优先通过 SDKMAN 安装;SDKMAN 不可用或安装失败时,再退回系统包管理器。
- 通过 安装必备 Python CLI 包:
pipx。pre-commit - 配置 的 npm 私有源。
~/.npmrc - 配置 的 pip 私有源。
~/.pip/pip.conf - 检查 Git 全局配置:
- 必须已配置且不能是占位符;建议使用个人中文姓名,但不以中文字符作为就绪门禁。
user.name - 必须已配置且不能是占位符;建议使用有效的公司邮箱。
user.email init.defaultBranch=mastercolor.ui=autopager.branch=falsepager.status=falsecore.quotePath=false- 空值
http.https://git.cisdigital.cn.proxy=
- 把 的 SSH 地址重写为 HTTPS。
git.cisdigital.cn - 按已确认办公地维护 。
/etc/hosts
- Identify system information: Operating system, platform, architecture, Shell, PATH, home directory, hosts file path.
- Identify system tools: ,
git,python3,node,npm,npx,pipx,jq,rg,mvn,pnpm,java,javac,curl,wget, etc.sudo - Identify SDKMAN and package managers: SDKMAN, ,
brew,apt-get,dnf,yum,pacman,zypper,winget.choco - By default, only scan the section in the top-level
## Environment Variablesfiles, and identify skill environment variables according to the formatskills/eliteforge-*/SKILL.mdspecified by`VAR_NAME,SCREAMING_SNAKE_CASE` [optional|required|conditional] desc; only report variable names and missing status, do not print variable values.eliteforge-skill-spec - Attempt to install essential commands: ,
git,python3,node,npm,npx,pipx,jq,rg, Java/Javac 25+, Maven 3.9.10+.pnpm - When automatically installing Java/Javac and Maven, if SDKMAN is already installed and can be initialized on the current machine, prioritize installation via SDKMAN; if SDKMAN is unavailable or installation fails, fall back to the system package manager.
- Install essential Python CLI packages via :
pipx.pre-commit - Configure the npm private source in .
~/.npmrc - Configure the pip private source in .
~/.pip/pip.conf - Check Git global configurations:
- must be configured and cannot be a placeholder; it is recommended to use the user's personal Chinese name, but Chinese characters are not required as a readiness gate.
user.name - must be configured and cannot be a placeholder; it is recommended to use a valid corporate email.
user.email init.defaultBranch=mastercolor.ui=autopager.branch=falsepager.status=falsecore.quotePath=false- empty value
http.https://git.cisdigital.cn.proxy=
- Rewrite the SSH address of to HTTPS.
git.cisdigital.cn - Maintain according to the confirmed office location.
/etc/hosts
安全规则
Security Rules
- 不要把密码、Token、共享凭据硬编码、提交入仓或直接打印。
- 私有源凭据以在线“必知必会”文档为准,脚本只维护非敏感的源地址配置,不要求也不读取本地私有源凭据环境变量。
- Git 个人身份配置必须由用户手动执行 与
git config --global user.name "你的姓名"完成;脚本不自动写入。git config --global user.email "公司邮箱"/user.name的就绪判断以"已配置且非占位符"为准;非中文姓名或非标准邮箱只作为建议提示,不作为阻塞项。user.email - 需要私有源认证信息时,提示用户按在线“必知必会”文档自行写入本地配置;不要要求用户在对话中明文发送密码或 Token。
- 如果 中同一域名已指向其他 IP,不要覆盖,必须报告冲突。
/etc/hosts - 写 hosts 只维护脚本标记块,不要清空用户已有内容。
- 系统安装和 hosts 写入只做“可自动完成”的尝试;需要交互式 sudo、管理员权限、账号开通或项目授权时,报告阻塞。
- 优先使用 HTTPS,禁止要求用户改用 SSH 克隆。
git.cisdigital.cn
- Do not hardcode, commit to the repository, or directly print passwords, Tokens, or shared credentials.
- Private source credentials are subject to the online "Must-Know" documentation; the script only maintains non-sensitive source address configurations, and does not require or read local private source credential environment variables.
- Git personal identity configurations must be completed by the user manually executing and
git config --global user.name "Your Name"; the script does not write them automatically. The readiness judgment forgit config --global user.email "Corporate Email"/user.nameis based on "configured and not a placeholder"; non-Chinese names or non-standard emails are only suggested prompts, not blocking items.user.email - When private source authentication information is required, prompt the user to write it to the local configuration according to the online "Must-Know" documentation; do not ask the user to send passwords or Tokens in plain text in the conversation.
- If the same domain name in already points to another IP, do not overwrite it; must report the conflict.
/etc/hosts - When writing to hosts, only maintain the script-marked blocks; do not clear the user's existing content.
- System installation and hosts writing only attempt "automatically completable" operations; when interactive sudo, administrator privileges, account activation, or project authorization are required, report the block.
- prioritizes HTTPS; prohibit requiring users to switch to SSH cloning.
git.cisdigital.cn
脚本参数
Script Parameters
- :
--mode report|apply只检查;report写入安全修复并尝试安装缺失依赖。apply - :必填业务参数,由用户确认;重庆用
--office cq|bj,北京用cq。bj - :自动探测不准时强制指定。该参数只控制系统包管理器回退路径;Java/Javac 与 Maven 仍优先尝试 SDKMAN。
--package-manager auto|brew|apt-get|dnf|yum|pacman|zypper|winget|choco - 与
--home-dir:可指向临时路径做验证,不污染真实机器。--hosts-file - :指定
--skills-rootskill 所在目录;默认按脚本位置推断为仓库eliteforge-*目录。skills - :跳过工具安装,但仍应用配置文件修复。
--skip-install - :通过
--install-internal-clis安装或升级内部 Python CLI。pipx
- :
--mode report|applyonly checks;reportwrites security fixes and attempts to install missing dependencies.apply - : Required business parameter, confirmed by the user; use
--office cq|bjfor Chongqing,cqfor Beijing.bj - : Force specify when automatic detection is inaccurate. This parameter only controls the fallback path of the system package manager; Java/Javac and Maven still prioritize SDKMAN.
--package-manager auto|brew|apt-get|dnf|yum|pacman|zypper|winget|choco - and
--home-dir: Can point to temporary paths for verification without polluting the real machine.--hosts-file - : Specify the directory where
--skills-rootskills are located; default is inferred as the repository'seliteforge-*directory based on the script's location.skills - : Skip tool installation, but still apply configuration file fixes.
--skip-install - : Install or upgrade internal Python CLIs via
--install-internal-clis.pipx
输出规则
Output Rules
- 汇总要短、可执行,至少覆盖:、
system、SDKMAN、package manager、tools、hosts、npm/pip mirrors、git global config、git https rewrite、pipx packages、skill_env_vars。remaining blockers - 如果运行了 ,必须明确说明改了哪些文件、执行了哪些安装命令、哪些项被权限或账号阻塞。
apply - 必须拆分报告
skill_env_vars、missing_required、missing_conditional三类;只有optional_unset与已触发的missing_required是环境就绪阻塞项。missing_conditional - 如果 或
skill_env_vars.missing_required非空,必须提示用户配置对应环境变量;不要要求用户在对话中明文发送密码或 Token。skill_env_vars.missing_conditional - 对仍需人处理的事项,指出具体条件或文件,不要整段转抄参考资料。
- Summaries should be concise and actionable, covering at least: ,
system,SDKMAN,package manager,tools,hosts,npm/pip mirrors,git global config,git https rewrite,pipx packages,skill_env_vars.remaining blockers - If is run, clearly state which files were modified, which installation commands were executed, and which items were blocked by permissions or accounts.
apply - must be reported in three categories:
skill_env_vars,missing_required,missing_conditional; onlyoptional_unsetand triggeredmissing_requiredare environment readiness blockers.missing_conditional - If or
skill_env_vars.missing_requiredis not empty, must prompt the user to configure the corresponding environment variables; do not ask the user to send passwords or Tokens in plain text in the conversation.skill_env_vars.missing_conditional - For items that still require manual handling, specify the specific conditions or files, do not copy the reference materials in full.
参考资料
Reference Materials
- :人类前置项、私有源凭据、安全边界。
references/onboarding-checklist.md - :重庆办公 hosts。
references/cq-required-hosts.txt - :北京办公 hosts。
references/bj-required-hosts.txt
- : Human pre-requisites, private source credentials, security boundaries.
references/onboarding-checklist.md - : Chongqing office hosts.
references/cq-required-hosts.txt - : Beijing office hosts.
references/bj-required-hosts.txt