(match)
| 135 | # Pattern 1: Directory-based paths (scripts/, references/, assets/) |
| 136 | # See https://agentskills.io/specification#optional-directories |
| 137 | def replace_dir_path(match): |
| 138 | prefix = match.group(1) # e.g., "python " or "`" |
| 139 | rel_path = match.group(2) # e.g., "scripts/with_server.py" |
| 140 | |
| 141 | abs_path = skill_dir / rel_path |
| 142 | if abs_path.exists(): |
| 143 | return f"{prefix}{abs_path}" |
| 144 | return match.group(0) |
| 145 | |
| 146 | pattern_dirs = r"(python\s+|`)((?:scripts|references|assets)/[^\s`\)]+)" |
| 147 | content = re.sub(pattern_dirs, replace_dir_path, content) |
nothing calls this directly
no outgoing calls
no test coverage detected