script-lifecycle-manager
Manages the creation, versioning, deprecation, and maintenance of automation scripts across the workspace and templates. Use when: creating new scripts, updating script versions, deprecating scripts, or managing script dependencies in SCRIPTS.md.
- License 许可
- AGPL-3.0
- 最近更新
- 2026-11-14
- Stars
- ★ 25
- Forks
- 9
01 前言 Front Matter
- name
- script-lifecycle-manager
- owner
- pm
- scope
- common
- status
- active
- version
- 1.2.2
- metadata
- { "type": "process", "triggers": [ "create script", "update script", "deprecate script", "script lifecycle", "manage scripts" ] }
- description
- Manages the creation, versioning, deprecation, and maintenance of automation scripts across the workspace and templates. Use when: creating new scripts, updating script versions, deprecating scripts, or managing script dependencies in SCRIPTS.md.
- last_reviewed
- 1794096000000
03 SKILL.md 正文
Overview
This skill provides a systematic approach to managing the lifecycle of automation scripts (scripts/*.sh, scripts/*.ps1, scripts/*.ts) in accordance with workspace standards. It ensures scripts are properly registered in SCRIPTS.md, have strict version bumps, handle dependencies, and follow deprecation protocols (90-day notice).
When to Use This Skill
Create New Script:
- Trigger: "Create a new script for X"
- Action: Generate
.tsor paired.sh/.ps1files, add execution permissions, and register inSCRIPTS.mdasactiveversion1.0.0.
Update Existing Script:
- Trigger: "Update the build script"
- Action: Modify the script, bump the version in
SCRIPTS.md, and updateREADME.mdviagenerate-scripts-readme.ts.
Deprecate Script:
- Trigger: "Deprecate the old sync script"
- Action: Set
status: deprecatedandremoval-date(current date + 90 days) inSCRIPTS.md.
Lifecycle Management Rules
- Ownership Layers:
- L0 (SSOT):
scripts/(workspace root). All development and registry (SCRIPTS.md) live here. - L1 (Template snapshot):
templates/common/scripts/. Publish explicitly:bun run propagate:apply. - L2 (Project):
<project>/scripts/. Snapshot of L1 atnew-projectcreation time. - Never edit L1 directly; edit L0 and publish.
- L0 (SSOT):
- State Management:
active: In production use, bump version on change.deprecated: Scheduled for removal, requiresremoval-date.experimental: Unstable, not auto-propagated.
- Dependency Tracking:
- Must explicitly list dependencies in the
depends_oncolumn ofSCRIPTS.md.
- Must explicitly list dependencies in the
- Encoding & Compatibility:
- All
.ps1files must include UTF-8 encoding safeguard:$OutputEncoding = [Console]::OutputEncoding = [System.Text.Encoding]::UTF8; - This assignment must be placed after the
param()block. PowerShell rejects any executable statement beforeparam()withUnexpectedAttribute, aborting the entire script.
- All
- PS5.1 Error Propagation:
- When a
.ps1script invokes another script with the&operator,ErrorActionPreference=Stopis inherited by the child. Git writes informational output to stderr even on success, which triggersNativeCommandErrorunderStop. Allgitcalls (clone,pull,add,commit,rev-parse, etc.) must use:try { git <command> 2>&1 | Out-Null } catch { }
- When a
Step-by-Step Execution
Step 1: Script Implementation
Implement the requested logic in the appropriate script file. If adding a new script, ensure both .sh and .ps1 pairs are created (or use .ts for cross-platform). Apply the UTF-8 safeguard to .ps1 files.
Step 2: Update Registry
Update the scripts/SCRIPTS.md registry (L0 SSOT) with the new version, status, and any dependencies. After making changes, run bun run propagate:apply to propagate to L1.
Step 3: Auto-generate Documentation
Run the generate-scripts-readme.ts script to ensure README.md is synchronized with SCRIPTS.md.
Step 4: Verification
Run bun scripts/verify-scripts.ts (if available) to ensure dependencies are valid and no circular dependencies exist.
L3 Projects: When registering a new script in an L3 project's
scripts/SCRIPTS.md, usesource: L2(the script's origin layer — the L2 variant template it was scaffolded from) andlayer: L0+L1(notL0). Scripts placed inscripts/<variant>/subdirectories should be registered in the sub-registry atscripts/<variant>/SCRIPTS.md, not the main registry. See §6.5 Script Lifecycle Management for Tier 3 filtering details.
04 同仓库更多 Skills
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.
i18n-layout
Text layout and encoding guidance: character encoding (UTF-8, legacy Korean code pages, BOM hazards), line endings, RTL/bidi handling, and script-specific font selection (Hangul focus). Use when: encoding is corrupted or mojibake appears, an RTL locale must render correctly, fonts must be chosen for a script, or CRLF/BOM issues surface.