ソース情報
- リポジトリ
- TuYv/ccpm
- ソースの最終更新活動
- 2026年8月14日 19:45
- 検出された SKILL.md の言語
- 英語
- スター
- 1
- フォーク
- 2
インストール方法
デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。
ソースファイルを確認
インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。
メニュー
デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。
インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
直接コマンドでは確認用 Prompt が省略されます。実行前にソースを確認してください。
npx skills add https://github.com/TuYv/ccpm --skill agent-quorum-managerコマンドは1行のまま表示されます。コピー前に横へスクロールして全体を確認してください。
ローカルで確認しますか?SkillsMP が現在取得できるファイルをダウンロードできます。
Use when auditing a paid ad account for incremental contribution, wasted spend, or measurement integrity before scaling; runs a typed 20-item ROAS profile with verified vetoes and a SHIP/FIX/BLOCK/UNDECIDED gate on own exported data. Not for campaign structure design — use campaign-architect; not for creative production — use ad-creative-builder. 付费广告账户审计/ROAS评分
Use when the user asks to "write ad copy", "generate RSA headlines", or "build ad creative at volume"; produces ad units — RSA headlines/descriptions, hooks, and an angle matrix — message-matched to the destination landing page. Not for scoring an ad account — use ad-account-auditor; not for the post-click page — use landing-optimizer; not for organic articles — use content-writer. 广告创意/广告文案/RSA标题
Use when the user asks to "design an A/B test", "set up a creative/landing test", "run an incrementality test", or "is this result statistically and practically material?"; produces a hypothesis, variant matrix, sample-size/duration/power plan, and a documented effect/uncertainty read from own exported results. It applies only a precommitted owner-approved action rule; the statistical helper never chooses a business action. Not for producing variants — use ad-creative-builder; not for reading back one shipped change — use paid-measurement-loop. 广告AB测试设计/实验设计/显著性判定/增效测试
SOC 職業分類に基づく
SKILL.md を表示中
| name | agent-quorum-manager |
| description | Agent skill for quorum-manager - invoke with $agent-quorum-manager |
name: quorum-manager type: coordinator color: "#673AB7" description: Implements dynamic quorum adjustment and intelligent membership management capabilities:
Implements dynamic quorum adjustment and intelligent membership management for distributed consensus protocols.
class QuorumManager {
constructor(nodeId, consensusProtocol) {
this.nodeId = nodeId;
this.protocol = consensusProtocol;
this.currentQuorum = new Map(); // nodeId -> QuorumNode
this.quorumHistory = [];
this.networkMonitor = new NetworkConditionMonitor();
this.membershipTracker = new MembershipTracker();
this.faultToleranceCalculator = new FaultToleranceCalculator();
this.adjustmentStrategies = new Map();
this.initializeStrategies();
}
// Initialize quorum adjustment strategies
initializeStrategies() {
this.adjustmentStrategies.set('NETWORK_BASED', new NetworkBasedStrategy());
this.adjustmentStrategies.set('PERFORMANCE_BASED', new PerformanceBasedStrategy());
this.adjustmentStrategies.set('FAULT_TOLERANCE_BASED', new FaultToleranceStrategy());
this.adjustmentStrategies.set('HYBRID', new HybridStrategy());
}
// Calculate optimal quorum size based on current conditions
async calculateOptimalQuorum(context = {}) {
const networkConditions = await this.networkMonitor.getCurrentConditions();
const membershipStatus = await this.membershipTracker.getMembershipStatus();
const performanceMetrics = context.performanceMetrics || await this.getPerformanceMetrics();
const analysisInput = {
networkConditions: networkConditions,
membershipStatus: membershipStatus,
performanceMetrics: performanceMetrics,
currentQuorum: this.currentQuorum,
protocol: this.protocol,
faultToleranceRequirements: context.faultToleranceRequirements || this.getDefaultFaultTolerance()
};
// Apply multiple strategies and select optimal result
const strategyResults = new Map();
for (const [strategyName, strategy] of this.adjustmentStrategies) {
try {
const result = await strategy.calculateQuorum(analysisInput);
strategyResults.set(strategyName, result);
} catch (error) {
console.warn(`Strategy ${strategyName} failed:`, error);
}
}
// Select best strategy result
const optimalResult = this.selectOptimalStrategy(strategyResults, analysisInput);
return {
recommendedQuorum: optimalResult.quorum,
strategy: optimalResult.strategy,
confidence: optimalResult.confidence,
reasoning: optimalResult.reasoning,
expectedImpact: optimalResult.expectedImpact
};
}
// Apply quorum changes with validation and rollback capability
async adjustQuorum(newQuorumConfig, options = {}) {
const adjustmentId = `adjustment_${Date.now()}`;
try {
// Validate new quorum configuration
await this.validateQuorumConfiguration(newQuorumConfig);
// Create adjustment plan
const adjustmentPlan = await this.createAdjustmentPlan(
this.currentQuorum, newQuorumConfig
);
// Execute adjustment with monitoring
const adjustmentResult = await this.executeQuorumAdjustment(
adjustmentPlan, adjustmentId, options
);
// Verify adjustment success
await this.verifyQuorumAdjustment(adjustmentResult);
// Update current quorum
this.currentQuorum = newQuorumConfig.quorum;
// Record successful adjustment
this.recordQuorumChange(adjustmentId, adjustmentResult);
return {
success: true,
adjustmentId: adjustmentId,
previousQuorum: adjustmentPlan.previousQuorum,
newQuorum: this.currentQuorum,
impact: adjustmentResult.impact
};
} catch (error) {
console.error(`Quorum adjustment failed:`, error);
// Attempt rollback
await this.rollbackQuorumAdjustment(adjustmentId);
throw error;
}
}
async executeQuorumAdjustment(adjustmentPlan, adjustmentId, options) {
const startTime = Date.now();
// Phase 1: Prepare nodes for quorum change
await this.prepareNodesForAdjustment(adjustmentPlan.affectedNodes);
// Phase 2: Execute membership changes
const membershipChanges = await this.executeMembershipChanges(
adjustmentPlan.membershipChanges
);
// Phase 3: Update voting weights if needed
if (adjustmentPlan.weightChanges.length > 0) {
await this.updateVotingWeights(adjustmentPlan.weightChanges);
}
// Phase 4: Reconfigure consensus protocol
await this.reconfigureConsensusProtocol(adjustmentPlan.protocolChanges);
// Phase 5: Verify new quorum is operational
const verificationResult = await this.verifyQuorumOperational(adjustmentPlan.newQuorum);
const endTime = Date.now();
return {
adjustmentId: adjustmentId,
duration: endTime - startTime,
membershipChanges: membershipChanges,
verificationResult: verificationResult,
impact: await this.measureAdjustmentImpact(startTime, endTime)
};
}
}
class NetworkBasedStrategy {
constructor() {
this.networkAnalyzer = new NetworkAnalyzer();
this.connectivityMatrix = new ConnectivityMatrix();
this.partitionPredictor = new PartitionPredictor();
}
async calculateQuorum(analysisInput) {
const { networkConditions, membershipStatus, currentQuorum } = analysisInput;
// Analyze network topology and connectivity
const topologyAnalysis = await this.analyzeNetworkTopology(membershipStatus.activeNodes);
// Predict potential network partitions
const partitionRisk = await this.assessPartitionRisk(networkConditions, topologyAnalysis);
// Calculate minimum quorum for fault tolerance
const minQuorum = this.calculateMinimumQuorum(
membershipStatus.activeNodes.length,
partitionRisk.maxPartitionSize
);
// Optimize for network conditions
const optimizedQuorum = await this.optimizeForNetworkConditions(
minQuorum,
networkConditions,
topologyAnalysis
);
{
: optimizedQuorum,
: ,
: .(networkConditions, topologyAnalysis),
: .(optimizedQuorum, partitionRisk, networkConditions),
: {
: .(optimizedQuorum),
: .(optimizedQuorum, networkConditions)
}
};
}
() {
topology = {
: activeNodes.,
: ,
: [],
: ,
: ()
};
( node activeNodes) {
connections = .(node);
topology..(node., connections);
topology. += connections.;
}
topology. = .(topology.);
topology. = .(topology.);
topology;
}
() {
riskFactors = {
: .(networkConditions),
: .(topologyAnalysis),
: .(networkConditions),
: .()
};
overallRisk = .(riskFactors);
maxPartitionSize = .(
topologyAnalysis,
riskFactors
);
{
: overallRisk,
: maxPartitionSize,
: riskFactors,
: .(riskFactors)
};
}
() {
byzantineMinimum = .( * totalNodes / ) + ;
partitionMinimum = .((totalNodes - maxPartitionSize) / ) + ;
.(byzantineMinimum, partitionMinimum);
}
() {
optimization = {
: minQuorum,
: (),
:
};
nodeScores = .(networkConditions, topologyAnalysis);
sortedNodes = .(nodeScores.())
.( scoreB - scoreA);
selectedCount = ;
( [nodeId, score] sortedNodes) {
(selectedCount < minQuorum) {
weight = .(nodeId, score, networkConditions);
optimization..(nodeId, {
: weight,
: score,
: selectedCount === ? :
});
optimization. += weight;
selectedCount++;
}
}
optimization;
}
() {
scores = ();
( [nodeId, connections] topologyAnalysis.) {
score = ;
score += (connections. / topologyAnalysis.) * ;
centrality = .(nodeId, topologyAnalysis);
score += centrality * ;
reliability = .(nodeId, networkConditions);
score += reliability * ;
geoScore = .(nodeId, topologyAnalysis);
score += geoScore * ;
scores.(nodeId, score);
}
scores;
}
() {
weight = ;
normalizedScore = score / ;
weight *= ( + normalizedScore);
nodeLatency = networkConditions..(nodeId) || ;
latencyFactor = .(, - (nodeLatency / ));
weight *= latencyFactor;
.(, .(, weight));
}
}
class PerformanceBasedStrategy {
constructor() {
this.performanceAnalyzer = new PerformanceAnalyzer();
this.throughputOptimizer = new ThroughputOptimizer();
this.latencyOptimizer = new LatencyOptimizer();
}
async calculateQuorum(analysisInput) {
const { performanceMetrics, membershipStatus, protocol } = analysisInput;
// Analyze current performance bottlenecks
const bottlenecks = await this.identifyPerformanceBottlenecks(performanceMetrics);
// Calculate throughput-optimal quorum size
const throughputOptimal = await this.calculateThroughputOptimalQuorum(
performanceMetrics, membershipStatus.activeNodes
);
// Calculate latency-optimal quorum size
const latencyOptimal = await this.calculateLatencyOptimalQuorum(
performanceMetrics, membershipStatus.activeNodes
);
// Balance throughput and latency requirements
const balancedQuorum = await this.balanceThroughputAndLatency(
throughputOptimal, latencyOptimal, performanceMetrics.
);
{
: balancedQuorum,
: ,
: .(performanceMetrics),
: .(
balancedQuorum, throughputOptimal, latencyOptimal, bottlenecks
),
: {
: .(balancedQuorum),
: .(balancedQuorum)
}
};
}
() {
currentThroughput = performanceMetrics.;
targetThroughput = performanceMetrics..;
throughputCurve = .(activeNodes);
optimalSize = .(activeNodes. / ) + ;
maxThroughput = ;
( size = optimalSize; size <= activeNodes.; size++) {
projectedThroughput = .(size, throughputCurve);
(projectedThroughput > maxThroughput && projectedThroughput >= targetThroughput) {
maxThroughput = projectedThroughput;
optimalSize = size;
} (projectedThroughput < maxThroughput * ) {
;
}
}
.(activeNodes, optimalSize, );
}
() {
currentLatency = performanceMetrics.;
targetLatency = performanceMetrics..;
latencyCurve = .(activeNodes);
minViableQuorum = .(activeNodes. / ) + ;
( size = minViableQuorum; size <= activeNodes.; size++) {
projectedLatency = .(size, latencyCurve);
(projectedLatency <= targetLatency) {
.(activeNodes, size, );
}
}
.();
.(activeNodes, minViableQuorum, );
}
() {
nodeScores = ();
( node availableNodes) {
score = ;
(optimizationTarget === ) {
score = .(node);
} (optimizationTarget === ) {
score = .(node);
}
nodeScores.(node., score);
}
sortedNodes = availableNodes.(
nodeScores.(b.) - nodeScores.(a.)
);
selectedNodes = ();
( i = ; i < .(targetSize, sortedNodes.); i++) {
node = sortedNodes[i];
selectedNodes.(node., {
: .(node, nodeScores.(node.)),
: nodeScores.(node.),
: i === ? : ,
: optimizationTarget
});
}
{
: selectedNodes,
: .(selectedNodes.())
.( sum + node., ),
: optimizationTarget
};
}
() {
score = ;
cpuCapacity = .(node);
score += (cpuCapacity / ) * ;
bandwidth = .(node);
score += (bandwidth / ) * ;
memory = .(node);
score += (memory / ) * ;
historicalPerformance = .(node);
score += (historicalPerformance / ) * ;
.(, score);
}
() {
score = ;
avgLatency = .(node);
score -= (avgLatency / );
cpuLoad = .(node);
score -= (cpuLoad / );
geoLatency = .(node);
score -= (geoLatency / );
consistencyScore = .(node);
score *= consistencyScore;
.(, score);
}
}
class FaultToleranceStrategy {
constructor() {
this.faultAnalyzer = new FaultAnalyzer();
this.reliabilityCalculator = new ReliabilityCalculator();
this.redundancyOptimizer = new RedundancyOptimizer();
}
async calculateQuorum(analysisInput) {
const { membershipStatus, faultToleranceRequirements, networkConditions } = analysisInput;
// Analyze fault scenarios
const faultScenarios = await this.analyzeFaultScenarios(
membershipStatus.activeNodes, networkConditions
);
// Calculate minimum quorum for fault tolerance requirements
const minQuorum = this.calculateFaultTolerantQuorum(
faultScenarios, faultToleranceRequirements
);
// Optimize node selection for maximum fault tolerance
const faultTolerantQuorum = await this.optimizeForFaultTolerance(
membershipStatus.activeNodes, minQuorum, faultScenarios
);
return {
quorum: faultTolerantQuorum,
strategy: 'FAULT_TOLERANCE_BASED',
confidence: this.(faultScenarios),
: .(
faultTolerantQuorum, faultScenarios, faultToleranceRequirements
),
: {
: .(faultTolerantQuorum),
: .(faultTolerantQuorum)
}
};
}
() {
scenarios = [];
( node activeNodes) {
scenario = .(node, activeNodes, networkConditions);
scenarios.(scenario);
}
multiFailureScenarios = .(
activeNodes, networkConditions
);
scenarios.(...multiFailureScenarios);
partitionScenarios = .(
activeNodes, networkConditions
);
scenarios.(...partitionScenarios);
correlatedFailureScenarios = .(
activeNodes, networkConditions
);
scenarios.(...correlatedFailureScenarios);
.(scenarios);
}
() {
maxRequiredQuorum = ;
( scenario faultScenarios) {
(scenario. >= requirements.) {
requiredQuorum = .(scenario, requirements);
maxRequiredQuorum = .(maxRequiredQuorum, requiredQuorum);
}
}
maxRequiredQuorum;
}
() {
totalNodes = scenario.;
failedNodes = scenario.;
availableNodes = totalNodes - failedNodes;
(requirements.) {
maxByzantineNodes = .((totalNodes - ) / );
.( * totalNodes / ) + ;
}
.(availableNodes / ) + ;
}
() {
optimizedQuorum = {
: (),
: ,
: {
: ,
: ,
:
}
};
nodeScores = .(
activeNodes, faultScenarios
);
selectedNodes = .(
activeNodes, minQuorum, nodeScores, faultScenarios
);
( [nodeId, nodeData] selectedNodes) {
optimizedQuorum..(nodeId, {
: nodeData.,
: nodeData.,
: nodeData.,
: nodeData.
});
optimizedQuorum. += nodeData.;
}
optimizedQuorum. = .(
selectedNodes, faultScenarios
);
optimizedQuorum;
}
() {
scores = ();
( node activeNodes) {
score = ;
independenceScore = .(node, activeNodes);
score += independenceScore * ;
reliabilityScore = .(node);
score += reliabilityScore * ;
diversityScore = .(node, activeNodes);
score += diversityScore * ;
recoveryScore = .(node);
score += recoveryScore * ;
scores.(node., score);
}
scores;
}
() {
selectedNodes = ();
remainingNodes = [...activeNodes];
(selectedNodes. < minQuorum && remainingNodes. > ) {
bestNode = ;
bestScore = -;
bestIndex = -;
( i = ; i < remainingNodes.; i++) {
node = remainingNodes[i];
additionalCoverage = .(
node, selectedNodes, faultScenarios
);
combinedScore = nodeScores.(node.) + (additionalCoverage * );
(combinedScore > bestScore) {
bestScore = combinedScore;
bestNode = node;
bestIndex = i;
}
}
(bestNode) {
selectedNodes.(bestNode., {
: .(bestNode, nodeScores.(bestNode.)),
: nodeScores.(bestNode.),
: selectedNodes. === ? : ,
: .(bestNode)
});
remainingNodes.(bestIndex, );
} {
;
}
}
selectedNodes;
}
}
// Store quorum configuration and history
await this.mcpTools.memory_usage({
action: 'store',
key: `quorum_config_${this.nodeId}`,
value: JSON.stringify({
currentQuorum: Array.from(this.currentQuorum.entries()),
strategy: this.activeStrategy,
networkConditions: this.lastNetworkAnalysis,
adjustmentHistory: this.quorumHistory.slice(-10)
}),
namespace: 'quorum_management',
ttl: 3600000 // 1 hour
});
// Coordinate with swarm for membership changes
const swarmStatus = await this.mcpTools.swarm_status({
swarmId: this.swarmId
});
await this.mcpTools.coordination_sync({
swarmId: this.
});
// Track quorum adjustment performance
await this.mcpTools.metrics_collect({
components: [
'quorum_adjustment_latency',
'consensus_availability',
'fault_tolerance_coverage',
'network_partition_recovery_time'
]
});
// Neural learning for quorum optimization
await this.mcpTools.neural_patterns({
action: 'learn',
operation: 'quorum_optimization',
outcome: JSON.stringify({
adjustmentType: adjustment.strategy,
performanceImpact: measurementResults,
networkConditions: currentNetworkState,
faultToleranceImprovement: faultToleranceMetrics
})
});
// Orchestrate complex quorum adjustments
await this.mcpTools.task_orchestrate({
task: 'quorum_adjustment',
strategy: 'sequential',
priority: 'high',
dependencies: [
'network_analysis',
'membership_validation',
'performance_assessment'
]
});
This Quorum Manager provides intelligent, adaptive quorum management that optimizes for network conditions, performance requirements, and fault tolerance needs while maintaining the safety and liveness properties of distributed consensus protocols.