graph-algorithms
Graph Algorithms
Overview
Use this skill to choose and validate graph approaches that are correct for the domain and efficient for expected scale.
Scope Boundaries
- The problem involves reachability, shortest paths, dependencies, connectivity, matching, or flow.
- Algorithm choice materially affects correctness guarantees or runtime cost.
- Teams need explicit trade-off rationale between multiple graph approaches.
Shared References
- Algorithm selection rules:
references/graph-algorithm-selection-rules.md
Templates And Assets
- Problem framing template:
assets/graph-problem-framing-template.md
- Algorithm comparison template:
assets/graph-algorithm-comparison-template.md
Inputs To Gather
- Entity/relationship model and graph directionality assumptions.
- Constraints (weighted/unweighted, cyclic/acyclic, static/dynamic updates).
- Scale expectations (nodes, edges, update/query ratio, latency budget).
- Correctness requirements and acceptable approximation/error policy.
Deliverables
- Graph representation choice with invariants and assumptions.
- Candidate algorithm comparison with complexity and fit rationale.
- Validation plan for correctness, complexity, and edge-case handling.
- Residual risk list for scaling or approximation trade-offs.
Workflow
- Frame the problem using
assets/graph-problem-framing-template.md. - Determine representation (adjacency list/matrix/edge list) based on scale and operations.
- Compare candidate algorithms using
assets/graph-algorithm-comparison-template.md. - Select an approach using
references/graph-algorithm-selection-rules.md. - Validate with correctness tests (cycles, disconnected components, degenerate cases).
- Measure complexity behavior under representative and worst-case workloads.
- Publish decision rationale, constraints, and follow-up optimization actions.
Quality Standard
- Representation and algorithm assumptions are explicit and testable.
- Complexity claims are tied to real workload characteristics.
- Edge and failure cases are validated, not inferred.
- Trade-offs between accuracy, latency, and memory are documented.
Failure Conditions
- Stop when representation assumptions conflict with domain behavior.
- Stop when chosen algorithm fails required correctness guarantees.
- Escalate when performance requirements cannot be met with current constraints.
More from kentoshimizu/sw-agent-skills
bash-style-guide
Style, review, and refactoring standards for Bash shell scripting. Trigger when `.sh` files, files with `#!/usr/bin/env bash` or `#!/bin/bash`, or CI workflow blocks with `shell: bash` are created, modified, or reviewed and Bash-specific quality controls (quoting safety, error handling, portability, readability) must be enforced. Do not use for generic POSIX `sh`, PowerShell, or language-specific application style rules. In multi-language pull requests, run together with other applicable `*-style-guide` skills.
11architecture-clean-architecture
Clean Architecture workflow for enforcing dependency direction, stable domain boundaries, and use-case-centered application design. Use when teams must separate business rules from frameworks and delivery mechanisms; do not use for isolated module cleanup without boundary implications.
11powershell-style-guide
Style, review, and refactoring standards for PowerShell scripting. Trigger when `.ps1`, `.psm1`, `.psd1` files, or CI workflow blocks with `shell: pwsh` or `shell: powershell` are created, modified, or reviewed and PowerShell-specific quality controls (error handling, parameter validation, readability, operational safety) must be enforced. Do not use for Bash, generic POSIX `sh`, or language-specific application style rules. In multi-language pull requests, run together with other applicable `*-style-guide` skills.
10github-codeowners-management
Govern CODEOWNERS rules so review routing reflects real ownership and risk boundaries on GitHub. Use when repository ownership mapping or mandatory reviewer rules must be defined, updated, or audited; do not use for non-GitHub runtime architecture or data-layer design.
9security-authentication
Security workflow for authentication architecture, credential lifecycle, and session/token assurance. Use when login, identity proofing, MFA, or session security decisions are required; do not use for authorization policy design or non-security quality tuning.
9redis-caching-patterns
Redis caching workflow for latency improvement with explicit key strategy, TTL/invalidation policy, and correctness bounds. Use when Redis-backed caching decisions are required for application performance; do not use for repository-wide architecture governance or release management policy.
9