wiring by parcadei/continuous-claude-v3
npx skills add https://github.com/parcadei/continuous-claude-v3 --skill wiring构建基础设施组件时,确保它们在实际执行路径中被调用。
每个模块都需要一个清晰的入口点。死代码比没有代码更糟糕——它会带来维护负担和虚假的信心。
在标记基础设施为"完成"之前,请验证:
# 钩子注册了吗?
grep -r "orchestration" .claude/settings.json
# 技能激活了吗?
grep -r "skill-name" .claude/skill-rules.json
# 脚本可执行吗?
ls -la scripts/orchestrate.py
# 模块导入了吗?
grep -r "from orchestration_layer import" .
# 入口点(钩子)
.claude/hooks/pre-tool-use.sh
↓
# Shell 包装器调用 TypeScript
npx tsx pre-tool-use.ts
↓
# TypeScript 调用 Python 脚本
spawn('scripts/orchestrate.py')
↓
# 脚本导入模块
from orchestration_layer import dispatch
↓
# 模块执行
dispatch(agent_type, task)
# 不要只对模块进行单元测试
pytest tests/unit/orchestration_layer_test.py # 不够
# 测试完整的调用路径
echo '{"tool": "Task"}' | .claude/hooks/pre-tool-use.sh # 验证这个能工作
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
## 接线
- **入口点**: Task 工具上的 PreToolUse 钩子
- **注册**: `.claude/settings.json` 第 45 行
- **调用路径**: 钩子 → pre-tool-use.ts → scripts/orchestrate.py → orchestration_layer.py
- **测试**: `tests/integration/task_orchestration_test.py`
# 不好:创建了 500 行的 orchestration_layer.py
# 但没有任何东西导入或调用它
# 结果:死代码,浪费精力
# 好:从最小接线开始,然后扩展
# 1. 创建钩子(10 行)
# 2. 测试钩子触发
# 3. 添加脚本(20 行)
# 4. 测试脚本执行
# 5. 添加模块逻辑(迭代)
# 不好:代理路由器有分发逻辑
# 同时 skill-rules.json 有代理选择逻辑
# 同时钩子有代理过滤逻辑
# 结果:三个地方需要更新,路由冲突
# 好:路由的单一事实来源
# skill-rules.json 激活技能 → 技能调用路由器 → 路由器分发
# 不好:假设因为你写了代码,它就被导入了
from orchestration_layer import dispatch # 这个路径存在吗?
# 好:在集成测试时验证导入
uv run python -c "from orchestration_layer import dispatch; print('OK')"
# 不好:只做单元测试
pytest tests/unit/ # 全部通过,但端到端什么都不工作
# 好:对接线进行集成测试
pytest tests/integration/ # 验证完整调用路径
// .claude/settings.json - 钩子定义存在但不在 hooks 部分
{
"hooks": {
"PreToolUse": [] // 空的!你的钩子永远不会触发
}
}
修复:添加钩子注册:
{
"hooks": {
"PreToolUse": [{
"matcher": ["Task"],
"hooks": [{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/orchestration.sh"
}]
}]
}
}
# 脚本存在但无法执行
-rw-r--r-- scripts/orchestrate.py
# 修复:使其可执行
chmod +x scripts/orchestrate.py
# 脚本尝试导入但路径错误
from orchestration_layer import dispatch
# ModuleNotFoundError
# 修复:添加到 Python 路径或使用正确的包结构
sys.path.insert(0, str(Path(__file__).parent.parent))
# 不好:路由器有漂亮的映射
AGENT_MAP = {
"implement": ImplementAgent,
"research": ResearchAgent,
# ... 18 种代理类型
}
# 但没有分发函数使用这个映射
def route(task):
return "general-purpose" # 硬编码!映射是死代码
# 好:分发实际使用映射
def route(task):
agent_type = classify(task)
return AGENT_MAP[agent_type]
在标记基础设施为"完成"之前:
构建了什么:
opc/orchestration/orchestration_layer.py(500+ 行)opc/orchestration/dag/(DAG 构建器、验证器、执行器)接线缺失:
修复:
scripts/orchestrate.pyorchestration_layer.dispatch()构建了什么:
接线缺失:
修复:
# 查找 Python 模块
find . -name "*.py" -type f
# 检查每个模块是否被导入
for file in $(find . -name "*.py"); do
module=$(basename $file .py)
grep -r "from.*$module import\|import.*$module" . || echo "ORPHAN: $file"
done
# 列出 .claude/hooks/ 中的所有钩子
ls .claude/hooks/*.sh
# 检查每个钩子是否已注册
for hook in $(ls .claude/hooks/*.sh); do
basename_hook=$(basename $hook)
grep -q "$basename_hook" .claude/settings.json || echo "UNREGISTERED: $hook"
done
# 查找所有 Python 脚本
find scripts/ -name "*.py"
# 测试每个脚本是否能被导入
for script in $(find scripts/ -name "*.py"); do
uv run python -c "import sys; sys.path.insert(0, 'scripts'); import $(basename $script .py)" 2>/dev/null || echo "IMPORT FAIL: $script"
done
每周安装数
190
仓库
GitHub 星标数
3.6K
首次出现时间
2026年1月22日
安全审计
安装于
opencode185
codex183
gemini-cli182
cursor181
github-copilot179
amp176
When building infrastructure components, ensure they're actually invoked in the execution path.
Every module needs a clear entry point. Dead code is worse than no code - it creates maintenance burden and false confidence.
Before marking infrastructure "done", verify:
# Hook registered?
grep -r "orchestration" .claude/settings.json
# Skill activated?
grep -r "skill-name" .claude/skill-rules.json
# Script executable?
ls -la scripts/orchestrate.py
# Module imported?
grep -r "from orchestration_layer import" .
# Entry point (hook)
.claude/hooks/pre-tool-use.sh
↓
# Shell wrapper calls TypeScript
npx tsx pre-tool-use.ts
↓
# TypeScript calls Python script
spawn('scripts/orchestrate.py')
↓
# Script imports module
from orchestration_layer import dispatch
↓
# Module executes
dispatch(agent_type, task)
# Don't just unit test the module
pytest tests/unit/orchestration_layer_test.py # NOT ENOUGH
# Test the full invocation path
echo '{"tool": "Task"}' | .claude/hooks/pre-tool-use.sh # VERIFY THIS WORKS
## Wiring
- **Entry Point**: PreToolUse hook on Task tool
- **Registration**: `.claude/settings.json` line 45
- **Call Path**: hook → pre-tool-use.ts → scripts/orchestrate.py → orchestration_layer.py
- **Test**: `tests/integration/task_orchestration_test.py`
# BAD: Created orchestration_layer.py with 500 lines
# But nothing imports it or calls it
# Result: Dead code, wasted effort
# GOOD: Start with minimal wiring, then expand
# 1. Create hook (10 lines)
# 2. Test hook fires
# 3. Add script (20 lines)
# 4. Test script executes
# 5. Add module logic (iterate)
# BAD: Agent router has dispatch logic
# AND skill-rules.json has agent selection logic
# AND hooks have agent filtering logic
# Result: Three places to update, routing conflicts
# GOOD: Single source of truth for routing
# skill-rules.json activates skill → skill calls router → router dispatches
# BAD: Assume because you wrote the code, it's imported
from orchestration_layer import dispatch # Does this path exist?
# GOOD: Verify imports at integration test time
uv run python -c "from orchestration_layer import dispatch; print('OK')"
# BAD: Only unit test
pytest tests/unit/ # All pass, but nothing works end-to-end
# GOOD: Integration test the wiring
pytest tests/integration/ # Verify full call path
// .claude/settings.json - hook definition exists but not in hooks section
{
"hooks": {
"PreToolUse": [] // Empty! Your hook never fires
}
}
Fix : Add hook registration:
{
"hooks": {
"PreToolUse": [{
"matcher": ["Task"],
"hooks": [{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/orchestration.sh"
}]
}]
}
}
# Script exists but can't execute
-rw-r--r-- scripts/orchestrate.py
# Fix: Make executable
chmod +x scripts/orchestrate.py
# Script tries to import but path is wrong
from orchestration_layer import dispatch
# ModuleNotFoundError
# Fix: Add to Python path or use proper package structure
sys.path.insert(0, str(Path(__file__).parent.parent))
# BAD: Router has beautiful mapping
AGENT_MAP = {
"implement": ImplementAgent,
"research": ResearchAgent,
# ... 18 agent types
}
# But no dispatch function uses the map
def route(task):
return "general-purpose" # Hardcoded! Map is dead code
# GOOD: Dispatch actually uses the map
def route(task):
agent_type = classify(task)
return AGENT_MAP[agent_type]
Before marking infrastructure "complete":
What was built:
opc/orchestration/orchestration_layer.py (500+ lines)opc/orchestration/dag/ (DAG builder, validator, executor)Wiring gap:
Fix:
scripts/orchestrate.pyorchestration_layer.dispatch()What was built:
Wiring gap:
Fix:
# Find Python modules
find . -name "*.py" -type f
# Check if each is imported
for file in $(find . -name "*.py"); do
module=$(basename $file .py)
grep -r "from.*$module import\|import.*$module" . || echo "ORPHAN: $file"
done
# List all hooks in .claude/hooks/
ls .claude/hooks/*.sh
# Check each is registered
for hook in $(ls .claude/hooks/*.sh); do
basename_hook=$(basename $hook)
grep -q "$basename_hook" .claude/settings.json || echo "UNREGISTERED: $hook"
done
# Find all Python scripts
find scripts/ -name "*.py"
# Test each can be imported
for script in $(find scripts/ -name "*.py"); do
uv run python -c "import sys; sys.path.insert(0, 'scripts'); import $(basename $script .py)" 2>/dev/null || echo "IMPORT FAIL: $script"
done
Weekly Installs
190
Repository
GitHub Stars
3.6K
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykPass
Installed on
opencode185
codex183
gemini-cli182
cursor181
github-copilot179
amp176
Azure Data Explorer (Kusto) 查询技能:KQL数据分析、日志遥测与时间序列处理
119,800 周安装
Sanity Agent Context 教程:为AI智能体提供结构化内容访问,实现智能查询与搜索
180 周安装
机器学习流水线 MLOps 编排指南:多智能体协作构建生产级ML系统
180 周安装
PR计划技能:为开源项目贡献制定战略规划与实施指南 | 开源贡献管理
181 周安装
Datadog文档查询技能 - 快速查找官方文档、限制信息及LLM优化索引
181 周安装
2025年Python开发模式与决策指南:FastAPI、Django、Flask框架选择与异步编程
181 周安装
2025漏洞扫描器与安全测试指南 - OWASP Top 10威胁建模与供应链安全
181 周安装