zhaoxuya520/reverse-skill / skills
reverse-skill-router
FlaggedRoutes reverse engineering, exploitation, penetration testing, malware, mobile, firmware, browser automation, documentation, and security tasks to the appropriate specialist skill. Use when a task spans modules or the correct reverse-skill entrypoint is unclear.
scripts/tests/test_verify_doc_links.py
View on GitHub"""Exercise Markdown link validation against a real temporary Git index."""
import os
from pathlib import Path
import subprocess
import sys
import tempfile
import unittest
VALIDATOR = Path(__file__).resolve().parents[1] / "verify-doc-links.py"
class VerifyDocLinksTests(unittest.TestCase):
def setUp(self):
self.scratch = tempfile.TemporaryDirectory(prefix="reverse-skill-links-")
self.addCleanup(self.scratch.cleanup)
self.root = Path(self.scratch.name)
self.git("init", "-q")
def git(self, *args):
return subprocess.run(
["git", *args], cwd=self.root, check=True,
capture_output=True, text=True,
)
def stage(self, path, text):
destination = self.root / path
destination.parent.mkdir(parents=True, exist_ok=True)
destination.write_text(text, encoding="utf-8")
self.git("add", "--", path)
def validate(self):
return subprocess.run(
[sys.executable, str(VALIDATOR)], cwd=self.root,
capture_output=True, text=True, encoding="utf-8",
)
def test_percent_encoded_spaces_and_unicode(self):
self.stage("docs/example file.md", "# Example\n")
self.stage("docs/中文.md", "# Unicode\n")
self.stage("README.md", "[Space](docs/example%20file.md)\n"
"[Unicode](docs/%E4%B8%AD%E6%96%87.md)\n")
result = self.validate()
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
@unittest.skipIf(os.name == "nt", "Windows filenames cannot contain question marks")
def test_encoded_filename_delimiters_before_query_and_fragment(self):
self.stage("docs/name#part?query.md", "# Delimiters\n")
self.stage("README.md", "[Example](docs/name%23part%3Fquery.md?download=1#section)\n")
result = self.validate()
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
def test_decodes_once_and_preserves_literal_plus(self):
self.stage("docs/literal%20name.md", "# Literal percent\n")
self.stage("docs/a+b.md", "# Literal plus\n")
self.stage("README.md", "[Percent](docs/literal%2520name.md)\n"
"[Plus](docs/a+b.md)\n")
result = self.validate()
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
def test_relative_root_and_directory_links(self):
self.stage("docs/example file.md", "# Example\n")
self.stage("guides/nested.md", "[Relative](../docs/example%20file.md)\n"
"[Root](/docs/example%20file.md)\n[Directory](../docs/)\n")
result = self.validate()
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
def test_missing_encoded_path_still_fails_with_original_target(self):
self.stage("README.md", "[Missing](docs/missing%20file.md)\n")
result = self.validate()
self.assertEqual(result.returncode, 1)
self.assertIn("README.md:1 -> docs/missing%20file.md", result.stdout)
def test_uses_staged_markdown_and_ignores_external_and_fenced_links(self):
self.stage("docs/example file.md", "# Example\n")
self.stage("README.md", "[Local](docs/example%20file.md)\n"
"[External](https://example.invalid/missing%20file.md)\n"
"[Anchor](#missing)\n```md\n[Code](missing.md)\n```\n")
(self.root / "README.md").write_text("[Unstaged](missing.md)\n", encoding="utf-8")
result = self.validate()
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)
if __name__ == "__main__":
unittest.main()
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |