Architecture Impact by openshift-hyperfleet/hyperfleet-claude-plugins
npx skills add https://github.com/openshift-hyperfleet/hyperfleet-claude-plugins --skill 'Architecture Impact'此技能分析 HyperFleet 组件仓库中的代码变更,并确定是否需要更新 openshift-hyperfleet/architecture 仓库中的架构文档。
当用户进行以下操作时,此技能会自动激活:
无需任何设置!
此技能会自动管理架构仓库:
架构仓库缓存位置:
~/.claude/plugins/cache/hyperfleet-devtools/architecture/
支持的组件:
分析范围:
main..HEAD)广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
分析方法:
参数:
--range <git-range>:分析指定 git 范围内的提交(例如 --range main..HEAD)--last <n>:分析最近 N 次提交(例如 --last 5)验证执行环境和前提条件:
检测当前仓库和组件类型
REPO_URL=$(git remote get-url origin)
COMPONENT=$(echo "$REPO_URL" | grep -oE "hyperfleet-(api|sentinel|adapter|broker)")
# 根据检测到的组件设置组件类型
case $COMPONENT in
hyperfleet-api) COMPONENT_TYPE="API Service" ;;
hyperfleet-sentinel) COMPONENT_TYPE="Sentinel" ;;
hyperfleet-adapter) COMPONENT_TYPE="Adapter" ;;
hyperfleet-broker) COMPONENT_TYPE="Broker" ;;
esac
要求: * 必须在 HyperFleet 组件仓库中(api、sentinel、adapter 或 broker) * 如果不在支持的仓库中,显示错误:
❌ 错误:不支持的组件
当前仓库:{detected_repo}
此技能支持以下 HyperFleet 组件:
- hyperfleet-api (API 服务)
- hyperfleet-sentinel (Sentinel)
- hyperfleet-adapter (Adapter)
- hyperfleet-broker (Broker)
请导航到支持的仓库并重试。
2. 解析参数并确定分析范围
# 解析可选参数
RANGE=""
LAST=""
# 检查 --range 参数
if [[ "$@" =~ --range[[:space:]]+([^[:space:]]+) ]]; then
RANGE="${BASH_REMATCH[1]}"
SCOPE="range:$RANGE"
fi
# 检查 --last 参数
if [[ "$@" =~ --last[[:space:]]+([0-9]+) ]]; then
LAST="${BASH_REMATCH[1]}"
SCOPE="last:$LAST"
fi
# 默认:未提交的变更
if [ -z "$SCOPE" ]; then
SCOPE="uncommitted"
fi
3. 验证 Git 状态
# 检查是否在 git 仓库中
git rev-parse --git-dir
# 根据范围检查是否有变更
if [ "$SCOPE" == "uncommitted" ]; then
git status --porcelain
# 如果没有变更,显示友好消息
elif [[ "$SCOPE" =~ ^range: ]]; then
# 验证 git 范围
git rev-parse "$RANGE" 2>/dev/null || {
echo "❌ 错误:无效的 git 范围:$RANGE"
exit 1
}
elif [[ "$SCOPE" =~ ^last: ]]; then
# 验证是否有足够的提交
COMMIT_COUNT=$(git rev-list --count HEAD)
if [ "$COMMIT_COUNT" -lt "$LAST" ]; then
echo "⚠️ 警告:只有 $COMMIT_COUNT 次提交可用,请求了最近 $LAST 次"
fi
fi
要求: * 必须在有效的 git 仓库中 * 对于未提交的分析:必须有变更(修改、添加或删除的文件) * 对于范围分析:git 范围必须有效 * 如果没有变更(未提交模式),显示友好消息:
ℹ️ 未检测到代码变更
没有未提交的变更可供分析。
选项:
- 进行代码变更并再次运行此技能
- 使用 --range 分析提交范围(例如 --range main..HEAD)
- 使用 --last 分析最近的提交(例如 --last 5)
4. 确保架构仓库存在
使用 ensure_arch_repo.sh 脚本克隆/更新架构仓库:
ARCH_REPO=$(bash {skill_base_directory}/ensure_arch_repo.sh)
if [ $? -ne 0 ] || [ -z "$ARCH_REPO" ]; then
echo "❌ 错误:无法确保架构仓库存在"
exit 1
fi
echo "✅ 架构仓库准备就绪:$ARCH_REPO"
此操作的作用:
* 检查缓存的架构仓库是否存在于 ~/.claude/plugins/cache/hyperfleet-devtools/architecture/
* 如果不存在:从 GitHub 克隆
* 如果存在:使用 git pull origin main 更新
* 返回架构仓库路径
环境验证通过后,启动专门的架构影响分析器代理:
Use Task tool with:
- subagent_type: "hyperfleet-devtools:architecture-impact-analyzer:architecture-impact-analyzer"
- description: "Analyze architecture impact"
- prompt: "Analyze code changes in {repo_name} and determine architecture documentation impact.
Repository: {repo_name}
Component Type: {component_type}
Analysis Scope: {scope}
Git Range: {range} (if applicable)
Last N Commits: {last} (if applicable)
Please provide a detailed impact analysis report."
传递给代理的上下文:
预期的代理输出: 代理将返回一个结构化的 markdown 报告,包含:
格式化并向用户显示代理的分析报告:
如果需要文档更新:
📋 后续步骤:
提示:您可以使用 hyperfleet-jira:jira-ticket-creator 技能为文档更新创建跟踪工单。
如果不需要更新:
✅ 无需更新架构文档
您的变更不影响现有的架构文档。 您可以继续您的 PR。
❌ 错误:不是 HyperFleet 仓库
当前目录:{cwd}
检测到的仓库:{repo_name}
此技能仅在 HyperFleet 组件仓库中有效。
支持的仓库:
- hyperfleet-api (API 服务)
- hyperfleet-sentinel (Sentinel)
- hyperfleet-adapter (Adapter)
- hyperfleet-broker (Broker)
请导航到 HyperFleet 仓库并重试。
❌ 错误:不支持的组件
当前仓库:{repo_name}
此技能支持以下 HyperFleet 组件:
- hyperfleet-api (API 服务)
- hyperfleet-sentinel (Sentinel)
- hyperfleet-adapter (Adapter)
- hyperfleet-broker (Broker)
请导航到支持的 HyperFleet 仓库并重试。
ℹ️ 没有变更可供分析
仓库中没有未提交的变更。
使用此技能的方法:
1. 对您的仓库进行代码变更
2. 在提交前再次运行此技能
或使用替代分析模式:
- --range main..HEAD :分析分支中的提交
- --last 5 :分析最近 5 次提交
示例:
analyze impact --range main..HEAD
analyze impact --last 5
❌ 错误:无效的 git 范围
指定的范围:{range}
git 范围无效。请检查:
- 两个引用都存在(例如 main、HEAD、分支名称、提交哈希)
- 范围语法正确(例如 main..HEAD、abc123..def456)
有效范围的示例:
--range main..HEAD
--range feature-branch..HEAD
--range abc1234..def5678
❌ 错误:无法设置架构仓库
无法克隆或更新架构仓库。
可能的原因:
- 网络连接问题
- 需要 GitHub 身份验证
- 磁盘空间问题
请检查您的网络连接并重试。
❌ 错误:分析代理失败
architecture-impact-analyzer 代理遇到错误:
{error_message}
请重试,如果问题持续存在,请联系 HyperFleet DevTools 团队。
调试信息:
- 仓库:{repo_name}
- 组件:{component_type}
- 分析范围:{scope}
提交 PR 前:
最佳实践:
与其他技能的集成:
hyperfleet-jira:jira-ticket-creator 为文档更新创建跟踪工单hyperfleet-architecture 了解现有文档结构每周安装次数
–
仓库
GitHub 星标数
5
首次出现时间
–
安全审计
This skill analyzes code changes in HyperFleet component repositories and determines whether architecture documentation in the openshift-hyperfleet/architecture repository needs to be updated.
This skill activates automatically when users:
Zero setup required!
This skill automatically manages the architecture repository:
The architecture repository is cached at:
~/.claude/plugins/cache/hyperfleet-devtools/architecture/
Supported Components:
Analysis Scope:
main..HEAD)Analysis Method:
Parameters:
--range <git-range>: Analyze commits in a git range (e.g., --range main..HEAD)--last <n>: Analyze last N commits (e.g., --last 5)Verify the execution environment and prerequisites:
Detect Current Repository and Component Type
REPO_URL=$(git remote get-url origin)
COMPONENT=$(echo "$REPO_URL" | grep -oE "hyperfleet-(api|sentinel|adapter|broker)")
# Set component type based on detected component
case $COMPONENT in
hyperfleet-api) COMPONENT_TYPE="API Service" ;;
hyperfleet-sentinel) COMPONENT_TYPE="Sentinel" ;;
hyperfleet-adapter) COMPONENT_TYPE="Adapter" ;;
hyperfleet-broker) COMPONENT_TYPE="Broker" ;;
esac
Requirements:
* Must be in a HyperFleet component repository (api, sentinel, adapter, or broker)
* If not in a supported repository, show error:
❌ Error: Component not supported
Current repository: {detected_repo}
This skill supports the following HyperFleet components:
- hyperfleet-api (API Service)
- hyperfleet-sentinel (Sentinel)
- hyperfleet-adapter (Adapter)
- hyperfleet-broker (Broker)
Navigate to a supported repository and try again.
2. Parse Parameters and Determine Analysis Scope
# Parse optional parameters
RANGE=""
LAST=""
# Check for --range parameter
if [[ "$@" =~ --range[[:space:]]+([^[:space:]]+) ]]; then
RANGE="${BASH_REMATCH[1]}"
SCOPE="range:$RANGE"
fi
# Check for --last parameter
if [[ "$@" =~ --last[[:space:]]+([0-9]+) ]]; then
LAST="${BASH_REMATCH[1]}"
SCOPE="last:$LAST"
fi
# Default: uncommitted changes
if [ -z "$SCOPE" ]; then
SCOPE="uncommitted"
fi
3. Verify Git Status
# Check if we're in a git repository
git rev-parse --git-dir
# Check if there are changes based on scope
if [ "$SCOPE" == "uncommitted" ]; then
git status --porcelain
# If no changes, show friendly message
elif [[ "$SCOPE" =~ ^range: ]]; then
# Validate git range
git rev-parse "$RANGE" 2>/dev/null || {
echo "❌ Error: Invalid git range: $RANGE"
exit 1
}
elif [[ "$SCOPE" =~ ^last: ]]; then
# Validate we have enough commits
COMMIT_COUNT=$(git rev-list --count HEAD)
if [ "$COMMIT_COUNT" -lt "$LAST" ]; then
echo "⚠️ Warning: Only $COMMIT_COUNT commits available, requested last $LAST"
fi
fi
Requirements:
* Must be in a valid git repository
* For uncommitted analysis: must have changes (modified, added, or deleted files)
* For range analysis: git range must be valid
* If no changes (uncommitted mode), show friendly message:
ℹ️ No code changes detected
There are no uncommitted changes to analyze.
Options:
- Make code changes and run this skill again
- Use --range to analyze a commit range (e.g., --range main..HEAD)
- Use --last to analyze recent commits (e.g., --last 5)
4. Ensure Architecture Repository Exists
Use the ensure_arch_repo.sh script to clone/update the architecture repository:
ARCH_REPO=$(bash {skill_base_directory}/ensure_arch_repo.sh)
if [ $? -ne 0 ] || [ -z "$ARCH_REPO" ]; then
echo "❌ Error: Failed to ensure architecture repository"
exit 1
fi
echo "✅ Architecture repository ready: $ARCH_REPO"
What this does:
* Checks if cached architecture repository exists at `~/.claude/plugins/cache/hyperfleet-devtools/architecture/`
* If not exists: clones from GitHub
* If exists: updates with `git pull origin main`
* Returns the architecture repository path
Once environment validation passes, launch the specialized architecture-impact-analyzer agent:
Use Task tool with:
- subagent_type: "hyperfleet-devtools:architecture-impact-analyzer:architecture-impact-analyzer"
- description: "Analyze architecture impact"
- prompt: "Analyze code changes in {repo_name} and determine architecture documentation impact.
Repository: {repo_name}
Component Type: {component_type}
Analysis Scope: {scope}
Git Range: {range} (if applicable)
Last N Commits: {last} (if applicable)
Please provide a detailed impact analysis report."
Context Passed to Agent:
Expected Agent Output: The agent will return a structured markdown report containing:
Format and display the agent's analysis report to the user:
Display Report
Provide Next Steps
If documentation updates are needed:
📋 Next Steps:
Tip: You can use the hyperfleet-jira:jira-ticket-creator skill to create tracking tickets for documentation updates.
If no updates needed:
✅ No architecture documentation updates required
Your changes don't impact existing architecture documentation. You can proceed with your PR.
❌ Error: Not a HyperFleet repository
Current directory: {cwd}
Detected repository: {repo_name}
This skill only works in HyperFleet component repositories.
Supported repositories:
- hyperfleet-api (API Service)
- hyperfleet-sentinel (Sentinel)
- hyperfleet-adapter (Adapter)
- hyperfleet-broker (Broker)
Navigate to a HyperFleet repository and try again.
❌ Error: Component not supported
Current repository: {repo_name}
This skill supports the following HyperFleet components:
- hyperfleet-api (API Service)
- hyperfleet-sentinel (Sentinel)
- hyperfleet-adapter (Adapter)
- hyperfleet-broker (Broker)
Please navigate to a supported HyperFleet repository and try again.
ℹ️ No changes to analyze
There are no uncommitted changes in the repository.
To use this skill:
1. Make code changes to your repository
2. Run this skill again before committing
Or use alternative analysis modes:
- --range main..HEAD : Analyze commits in a branch
- --last 5 : Analyze last 5 commits
Examples:
analyze impact --range main..HEAD
analyze impact --last 5
❌ Error: Invalid git range
Range specified: {range}
The git range is not valid. Please check:
- Both refs exist (e.g., main, HEAD, branch names, commit hashes)
- The range syntax is correct (e.g., main..HEAD, abc123..def456)
Examples of valid ranges:
--range main..HEAD
--range feature-branch..HEAD
--range abc1234..def5678
❌ Error: Failed to setup architecture repository
The architecture repository could not be cloned or updated.
Possible causes:
- Network connectivity issues
- GitHub authentication required
- Disk space issues
Please check your network connection and try again.
❌ Error: Analysis agent failed
The architecture-impact-analyzer agent encountered an error:
{error_message}
Please try again or contact the HyperFleet DevTools team if the issue persists.
Debug information:
- Repository: {repo_name}
- Component: {component_type}
- Analysis scope: {scope}
Before submitting a PR:
For best results:
Integration with other skills:
hyperfleet-jira:jira-ticket-creator to create tracking tickets for doc updateshyperfleet-architecture to understand existing documentation structureWeekly Installs
–
Repository
GitHub Stars
5
First Seen
–
Security Audits
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
114,200 周安装