🔧 chore(sync_standards): create AGENTS.md on sync
This commit is contained in:
@@ -120,6 +120,16 @@ if not exist "%AGENTS_ROOT%\index.md" (
|
||||
echo Created .agents\index.md
|
||||
)
|
||||
|
||||
if not exist "%ROOT%\AGENTS.md" (
|
||||
> "%ROOT%\AGENTS.md" echo # Agent Instructions
|
||||
>> "%ROOT%\AGENTS.md" echo.
|
||||
>> "%ROOT%\AGENTS.md" echo 请以 `.agents/` 下的规则为准:
|
||||
>> "%ROOT%\AGENTS.md" echo.
|
||||
>> "%ROOT%\AGENTS.md" echo - 入口:`.agents/index.md`
|
||||
>> "%ROOT%\AGENTS.md" echo - 语言规则:`.agents/tsl/index.md`、`.agents/cpp/index.md`、`.agents/python/index.md`
|
||||
echo Created AGENTS.md
|
||||
)
|
||||
|
||||
:SyncGitAttr
|
||||
if exist "%GITATTR_SRC%" (
|
||||
if /I "%SYNC_GITATTR_MODE%"=="skip" (
|
||||
|
||||
@@ -121,6 +121,19 @@ if (-not (Test-Path $AgentsIndex)) {
|
||||
Write-Host "Created .agents/index.md"
|
||||
}
|
||||
|
||||
$AgentsMd = Join-Path $Root "AGENTS.md"
|
||||
if (-not (Test-Path $AgentsMd)) {
|
||||
@'
|
||||
# Agent Instructions
|
||||
|
||||
请以 `.agents/` 下的规则为准:
|
||||
|
||||
- 入口:`.agents/index.md`
|
||||
- 语言规则:`.agents/tsl/index.md`、`.agents/cpp/index.md`、`.agents/python/index.md`
|
||||
'@ | Set-Content -Path $AgentsMd -Encoding UTF8
|
||||
Write-Host "Created AGENTS.md"
|
||||
}
|
||||
|
||||
$GitAttrDst = Join-Path $Root ".gitattributes"
|
||||
if (Test-Path $GitAttrSrc) {
|
||||
$mode = $env:SYNC_GITATTR_MODE
|
||||
|
||||
@@ -125,6 +125,19 @@ EOF
|
||||
echo "Created .agents/index.md"
|
||||
fi
|
||||
|
||||
AGENTS_MD="$ROOT/AGENTS.md"
|
||||
if [ ! -f "$AGENTS_MD" ]; then
|
||||
cat >"$AGENTS_MD" <<'EOF'
|
||||
# Agent Instructions
|
||||
|
||||
请以 `.agents/` 下的规则为准:
|
||||
|
||||
- 入口:`.agents/index.md`
|
||||
- 语言规则:`.agents/tsl/index.md`、`.agents/cpp/index.md`、`.agents/python/index.md`
|
||||
EOF
|
||||
echo "Created AGENTS.md"
|
||||
fi
|
||||
|
||||
echo "Synced agents ruleset to $AGENTS_DST."
|
||||
|
||||
GITATTR_DST="$ROOT/.gitattributes"
|
||||
|
||||
Reference in New Issue
Block a user