en un clic
xlings-contributing
// xlings 项目贡献规范流程 — 从 issue 到 PR 合入的完整 agent 开发工作流。Use when implementing features, fixing bugs, or contributing code to xlings. Covers environment setup, branching, coding, testing, PR creation, and CI verification.
// xlings 项目贡献规范流程 — 从 issue 到 PR 合入的完整 agent 开发工作流。Use when implementing features, fixing bugs, or contributing code to xlings. Covers environment setup, branching, coding, testing, PR creation, and CI verification.
xlings 项目文档编写规范 — 面向人的 docs/ 目录文档应遵循的风格、格式和组织约定。Use when creating or modifying documents in the docs/ directory.
xlings 包管理器完整使用指南 — 安装、多版本管理、SubOS 隔离环境、项目模式、Agent 集成、包索引生态。Use when tasks involve xlings install/use/search/remove flows, subos lifecycle (new/use/fork/stop/remove), project-mode .xlings.json setup, agent sandbox workflows, or custom index/resource-server configuration.
构建 xlings 项目的三平台操作指南,覆盖 Linux、macOS、Windows 上的工具链准备、`xmake` 配置、release 脚本构建和构建后验证。Use this skill when Codex needs to build, package, or verify xlings locally or in CI, especially when aligning with `.github/workflows/*` and `tools/*_release.*`, or when setting up musl-gcc / LLVM / MSVC toolchains for this repository.
使用 xlings (XLINGS Quickstart) 进行工具安装、版本管理、包索引扩展和 subos 环境隔离的操作指南。When tasks involve `xlings`/`xim` package install-search-update-remove flows, namespace package handling, self-hosted/custom index repo setup, or multi-version/subos troubleshooting, use this skill.
| name | xlings-contributing |
| description | xlings 项目贡献规范流程 — 从 issue 到 PR 合入的完整 agent 开发工作流。Use when implementing features, fixing bugs, or contributing code to xlings. Covers environment setup, branching, coding, testing, PR creation, and CI verification. |
This skill defines the standard contribution flow for AI agents working on the xlings codebase. Follow this process for any code change — feature, bugfix, or refactoring.
# Install xlings itself (bootstrap)
curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh | bash
# From repo root — install build dependencies
xlings install # reads .xlings.json → xmake, cmake, ninja, toolchain
# Switch to the correct dev toolchain
xlings use gcc@16.1.0 # Linux dev build (avoids musl/glibc link conflicts)
xmake f --local_libxpkg=/path/to/libxpkg -y # only if modifying upstream libxpkg
xmake build xlings # ~15s on warm cache
src/
├── main.cpp # entry point
├─��� cli.cppm # CLI command dispatch
├── core/
│ ├── config.cppm # 3-layer config (.xlings.json)
│ ├── subos.cppm # SubOS management (create/use/remove/fork)
│ ├── subos/keeper.cppm # Auto-keeper primitives
│ ├── xself.cppm # Self-install/update
│ ├── xim/
│ │ ├── installer.cppm # Package install orchestration
│ │ ├── resolver.cppm # DAG dependency resolution
│ │ ├── downloader.cppm # Parallel download + SHA256
│ │ └── libxpkg/types/ # Per-type handlers (script.cppm, subos.cppm)
│ └── xvm/ # Version management (shim, db, commands)
├── interface.cppm # NDJSON programmatic interface
└── platform.cppm # Cross-platform abstractions
tests/
├── e2e/ # End-to-end shell tests
│ ├── project_test_lib.sh # Shared test helpers
│ └── fixtures/ # Test fixture packages
└── (unit tests via xmake build xlings_tests)
gh issue listgh issue create --title "feat/fix: <description>" --body "<details>"
git fetch origin main
git switch -c <type>/<short-description> origin/main
Branch naming: feat/xxx, fix/xxx, chore/xxx, docs/xxx
import std;)installer.cppm for pkgType == N patternsubos.cppm run() function for manual arg parsing patternE2E tests (preferred for user-facing features):
# Create test file
touch tests/e2e/<feature>_test.sh
chmod +x tests/e2e/<feature>_test.sh
Test template:
#!/usr/bin/env bash
set -euo pipefail
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/project_test_lib.sh"
# Setup
RUNTIME_DIR="$ROOT_DIR/tests/e2e/runtime/<test_name>"
HOME_DIR="$RUNTIME_DIR/home"
cleanup() { rm -rf "$RUNTIME_DIR"; }
trap cleanup EXIT
cleanup
mkdir -p "$HOME_DIR/subos/default/bin"
cp "$(find_xlings_bin)" "$HOME_DIR/xlings"
# ... write .xlings.json, set up index, etc.
# Test
log "Testing <feature>..."
run_xlings "$HOME_DIR" "$ROOT_DIR" <command> || fail "<what failed>"
# Assertions
[[ <condition> ]] || fail "<what's wrong>"
log "PASS: <feature> works"
Key helpers from project_test_lib.sh:
find_xlings_bin — locates the built binaryrun_xlings "$HOME_DIR" "$ROOT_DIR" <args> — runs xlings with isolated XLINGS_HOMErequire_fixture_index — ensures test pkgindex is availablelog / fail — logging with consistent prefix# Build
xmake build xlings
# Run your test
XLINGS_BIN=$(find build -path '*/release/xlings' -type f | head -1) \
bash tests/e2e/<feature>_test.sh
# Run existing tests to check for regressions
for t in tests/e2e/subos_xpkg_*.sh; do
XLINGS_BIN=$XLINGS_BIN bash "$t" | tail -1
done
git add <files>
git commit -m "<type>(<scope>): <short description>
<optional body explaining why>
Refs: #<issue-number>"
Commit message convention:
feat(subos): add --from flag for forkfix(xim): resolver handles empty namespacechore(0.4.37): bump version for releasedocs: update READMEtest(subos): cover --cmd exit code propagationgit push -u origin <branch>
gh pr create --draft --title "<type>(<scope>): <description>" --body "..."
PR body should include:
Closes #N or Refs #N)# Check CI status
gh pr checks <pr-number>
# If failing, read logs:
gh run view <run-id> --log-failed | tail -50
CI runs on 3 platforms (Linux + macOS + Windows). All must pass.
Common CI failures:
#if defined(_WIN32) guards for POSIX-only code.gh pr merge <number> --squash --delete-branch --admin
After feature PRs merge, if a release is planned:
# On main:
# Edit src/core/config.cppm VERSION
git commit -m "chore(0.4.XX): bump version for release"
git push origin main
# Trigger release
gh workflow run release.yml --ref main
# Monitor
gh run list --workflow=release.yml --limit 1
xlings install + xlings use gcc@16.1.0 for dev envxlings install <tool> (dogfood the project)XLINGS_HOME (never touches real user env)