Trigger Threshold
Use this skill only when the user explicitly states that the current project follows 璀璨工坊规范 or eliteforge specification . If the user has not made such a project-level declaration, do not enable this skill; handle it as a general capability.
Goal
Do only one thing: determine whether the current machine can continue executing the relevant development tasks; if it cannot, automatically fill in the gaps as much as possible based on the current system's existing capabilities.
Base Version Requirements
- Java/Javac: The major version must be 25 or above.
- Maven: Must be 3.9.10 or above.
Environment Variables
ELITEFORGE_GIT_USER_NAME,SCREAMING_SNAKE_CASE[optional] Gituser.namevalue used only when Git identity is missing and the current shell already provides this value.ELITEFORGE_GIT_USER_EMAIL,SCREAMING_SNAKE_CASE[optional] Gituser.emailvalue used only when Git identity is missing and the current shell already provides this value.
Must First Confirm
Before writing to hosts, you must ask the user for their office location:
- Chongqing office: use
references/cq-required-hosts.txt, script parameter is--office cq - Beijing office: use
references/bj-required-hosts.txt, script parameter is--office bj
If the user has not confirmed their office location, only diagnostics and non-hosts fixes are allowed; do not guess the hosts configuration.
Workflow
-
First confirm whether the user is at the Chongqing office or the Beijing office.
-
Run
reportmode, diagnose only without writing.reportA return code of2means the environment is not ready, and does not indicate a script error.
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 repair it, run
applymode.
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 the permission conditions the user needs to handle. Do not fake a successful installation.
-
Only install the internal CLI when subsequent tasks really do need to operate on the internal platform.
python3 scripts/bootstrap_env.py --mode apply --office cq --install-internal-clis
- After the repair, run
reportonce more to output the final status.
What the Script Is Responsible For
- 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、sudo, etc. - Identify SDKMAN and package managers: SDKMAN,
brew、apt-get、dnf、yum、pacman、zypper、winget、choco。 - By default, only scan the
skills/eliteforge-*/SKILL.mdsection in each## Environment Variablestop-level file, and identify skill environment variables according to theeliteforge-skill-specformat specified by`VAR_NAME,SCREAMING_SNAKE_CASE` [optional|required|conditional] desc; report only variable names and missing status, do not print variable values. - Attempt to install required commands:
git、python3、node、npm、npx、pipx、jq、rg、pnpm, Java/Javac 25 or above, Maven 3.9.10 or above. - When automatically installing Java/Javac and Maven, if the current machine already has SDKMAN installed and it can be initialized, installation must be prioritized through SDKMAN; if SDKMAN is unavailable or installation fails, then fall back to the system package manager.
- Install required Python CLI packages via
pipx:pre-commit。 - Configure the npm private registry for
~/.npmrc. - Configure the pip private registry for
~/.pip/pip.conf. - Check Git global configuration:
user.namemust be configured and must not be a placeholder; using a personal Chinese name is recommended, but Chinese characters are not used as a readiness gate.user.emailmust be configured and must not be a placeholder; using a valid company email is recommended.init.defaultBranch=mastercolor.ui=autopager.branch=falsepager.status=falsecore.quotePath=falsehttp.https://git.cisdigital.cn.proxy=null value
- Rewrite the SSH address of
git.cisdigital.cnto HTTPS. - Maintain per confirmed office location for
/etc/hosts。
Security rules
- Do not hardcode, commit to the repository, or directly print passwords, tokens, or shared credentials.
- For private source credentials, refer to the online "must-know essentials" documentation; scripts only maintain non-sensitive source address configuration and do not require or read local private source credential environment variables.
- Git personal identity configuration must not be written with placeholders.
user.name/user.emailThe readiness check is based on "configured and not a placeholder"; non-Chinese names or non-standard email addresses are only advisory prompts, not blocking items. When missing, first report the user to rungit config --global user.name "你的姓名"andgit config --global user.email "公司邮箱"the script may automatically write these two items only whenELITEFORGE_GIT_USER_NAME、ELITEFORGE_GIT_USER_EMAILis already provided by the current shell. - When private source authentication information is needed, prompt the user to write it to the local configuration themselves according to the online "must-know essentials" documentation; do not ask the user to send passwords or tokens in plaintext in the conversation.
- If
/etc/hoststhe same domain name in the file already points to another IP, do not overwrite it; a conflict must be reported. - Writing hosts only maintains the script-marked block; do not clear the user's existing content.
- System installation and hosts writing only attempt what can be done automatically; when interactive sudo, administrator privileges, account activation, or project authorization is needed, report it as blocked.
git.cisdigital.cnPrefer HTTPS; do not require the user to switch to SSH cloning.
Script parameters
--mode report|apply:reportcheck only;applywrite safe fixes and attempt to install missing dependencies.--office cq|bj: required business parameter, confirmed by the user; for Chongqing usecq, for Beijing usebj。--package-manager auto|brew|apt-get|dnf|yum|pacman|zypper|winget|choco: force specify when automatic detection is inaccurate. This parameter only controls the system package manager fallback path; Java/Javac and Maven still preferentially try SDKMAN.--home-dirand--hosts-file: can point to temporary paths for verification without polluting the real machine.--skills-root: specify the directory where theeliteforge-*skill is located; by default it is inferred from the script location as the repositoryskillsdirectory.--skip-install: skip tool installation, but still apply configuration file fixes.--install-internal-clis: install or upgrade the internal Python CLI viapipx.
Output rules
- The summary must be short 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
applywas run, you must clearly state which files were changed, which installation commands were executed, and which items were blocked by permissions or accounts. skill_env_varsmust be reported separately for the three categoriesmissing_required、missing_conditional、optional_unset; onlymissing_requiredand the already-triggeredmissing_conditionalare environment readiness blockers.- If
skill_env_vars.missing_requiredorskill_env_vars.missing_conditionalis non-empty, you must prompt the user to configure the corresponding environment variables; do not ask the user to send passwords or tokens in plaintext in the conversation. - For matters that still require human handling, point out the specific conditions or files; do not copy reference materials verbatim in full paragraphs.
Reference materials
references/onboarding-checklist.md: human prerequisites, private source credentials, security boundaries.references/cq-required-hosts.txt: Chongqing office hosts.references/bj-required-hosts.txt: Beijing office hosts.