Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.
HTML agent-skillsai-agentsarchitecture-diagramclaude-codeclaude-skillscodexcoding-agentsdeepseek-harnessdeveloper-toolsdiagramsdiagrams-as-codedsh-pluginflowchartllmmermaidopencodesequence-diagramsoftware-architecturesystem-designvisualization
perf: rank endpoint repair candidates and cap supportedFixes at top three
momoyeyu42e729330bca
diff --git a/archify/renderers/architecture/render-architecture.mjs b/archify/renderers/architecture/render-architecture.mjsindex 201e7ace..0c3e9462 100644--- a/archify/renderers/architecture/render-architecture.mjs+++ b/archify/renderers/architecture/render-architecture.mjs@@ -625,6 +625,16 @@ function validateArchitecture() {for (const [field, endpoint] of [['from', 'source'], ['to', 'target']]) {if (components.has(conn[field])) continue;const message = `Connection "${conn.label || conn[field]}" references unknown ${endpoint} "${conn[field]}".`;+ const otherId = conn[field === 'from' ? 'to' : 'from'];+ const neighbors = new Set();+ for (const edge of connectionList) {+ if (edge === conn) continue;+ if (edge.from === otherId) neighbors.add(edge.to);+ if (edge.to === otherId) neighbors.add(edge.from);+ }+ const candidates = knownComponentIds+ .filter((id) => id !== otherId)+ .sort((a, b) => (neighbors.has(b) - neighbors.has(a)) || a.localeCompare(b));diagnostics.push({code: 'architecture/unknown-endpoint', severity: 'error', message,subject: {@@ -635,7 +645,7 @@ function validateArchitecture() {to: conn.to,},evidence: { endpoint, unknownNodeId: conn[field], availableNodeIds: knownComponentIds },- supportedFixes: knownComponentIds.map((id) => `set /connections/${connIndex}/${field} to verified node id "${id}"`),+ supportedFixes: candidates.slice(0, 3).map((id) => `set /connections/${connIndex}/${field} to verified node id "${id}"`),});problems.push(message);problems.push(`Connection "${conn.label || conn[field]}" endpoint "${conn[field]}" does not name a declared component.`);diff --git a/archify/renderers/dataflow/render-dataflow.mjs b/archify/renderers/dataflow/render-dataflow.mjsindex 28fe2c40..6203044b 100644--- a/archify/renderers/dataflow/render-dataflow.mjs+++ b/archify/renderers/dataflow/render-dataflow.mjs@@ -204,7 +204,7 @@ function validateDataflow() {to: flow.to,},evidence: { endpoint, unknownNodeId: flow[field], availableNodeIds: candidates },- supportedFixes: candidates.map((id) => `set /flows/${flowIndex}/${field} to verified node id "${id}"`),+ supportedFixes: candidates.slice(0, 3).map((id) => `set /flows/${flowIndex}/${field} to verified node id "${id}"`),});problems.push(problem);}diff --git a/archify/renderers/lifecycle/render-lifecycle.mjs b/archify/renderers/lifecycle/render-lifecycle.mjsindex b385f3b8..70f6fb2f 100644--- a/archify/renderers/lifecycle/render-lifecycle.mjs+++ b/archify/renderers/lifecycle/render-lifecycle.mjs@@ -449,7 +449,7 @@ function validateLifecycle() {to: transition.to,},evidence: { endpoint, unknownNodeId: transition[field], availableNodeIds: knownStateIds },- supportedFixes: knownStateIds.map((id) => `set /transitions/${transitionIndex}/${field} to verified node id "${id}"`),+ supportedFixes: knownStateIds.slice(0, 3).map((id) => `set /transitions/${transitionIndex}/${field} to verified node id "${id}"`),});problems.push(problem);}diff --git a/archify/renderers/sequence/render-sequence.mjs b/archify/renderers/sequence/render-sequence.mjsindex 0773056a..ea2b1f94 100644--- a/archify/renderers/sequence/render-sequence.mjs+++ b/archify/renderers/sequence/render-sequence.mjs@@ -242,7 +242,7 @@ function validateSequence() {to: message.to,},evidence: { endpoint, unknownNodeId: message[field], availableNodeIds: candidates },- supportedFixes: candidates.map((id) => `set /messages/${messageIndex}/${field} to verified node id "${id}"`),+ supportedFixes: candidates.slice(0, 3).map((id) => `set /messages/${messageIndex}/${field} to verified node id "${id}"`),});problems.push(problem);}diff --git a/archify/renderers/workflow/workflow-compiler.mjs b/archify/renderers/workflow/workflow-compiler.mjsindex b7161069..8e231b7d 100644--- a/archify/renderers/workflow/workflow-compiler.mjs+++ b/archify/renderers/workflow/workflow-compiler.mjs@@ -2805,11 +2805,10 @@ function validateWorkflow() {availableNodeIds: candidates,fixVerification: 'each candidate was verified by applying every listed repoint together and recompiling',},- supportedFixes: candidates.flatMap((nodeId) => (- acceptsFix((document) => repointReferences(document, id, nodeId))- ? unknownIdReferenceFixes(id, nodeId)- : []- )),+ supportedFixes: candidates+ .filter((nodeId) => acceptsFix((document) => repointReferences(document, id, nodeId)))+ .slice(0, 3)+ .flatMap((nodeId) => unknownIdReferenceFixes(id, nodeId)),});}}@@ -2962,11 +2961,10 @@ function validateReadableInputsBeforeRouting() {for (const [field, endpoint] of [['from', 'source'], ['to', 'target']]) {if (nodes.has(edge[field])) continue;const message = `Workflow edge "${workflowEdgeName(edge)}" references unknown ${endpoint} "${edge[field]}".`;- const supportedFixes = availableNodeIds.flatMap((nodeId) => (- acceptsFix((document) => repointReferences(document, edge[field], nodeId))- ? unknownIdReferenceFixes(edge[field], nodeId)- : []- ));+ const supportedFixes = availableNodeIds+ .filter((nodeId) => acceptsFix((document) => repointReferences(document, edge[field], nodeId)))+ .slice(0, 3)+ .flatMap((nodeId) => unknownIdReferenceFixes(edge[field], nodeId));fail({code: 'workflow/unknown-edge-endpoint',severity: 'error',