Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Grafema Uri Semantic Id Parsing

ASecurity

Fix silent failures when parsing Grafema semantic IDs that are in URI format instead of legacy arrow format. Use when: (1) code splits semantic IDs by "->" but gets the whole string back because IDs are grafema:// URIs, (2) file path extraction from semantic IDs returns empty or wrong values, (3) derived edges (DEPENDS_ON, etc.) produce 0 results despite source edges existing, (4) any code that processes semantic IDs after the analysis pipeline's to_uri_format() has run. The grafema:// URI fo...

36 stars
0 votes
0 copies
0 views
Added 9/20/2026
developmentrustreactnodegit

Works with

claude code

Security Analysis

A100/100

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add Disentinel/grafema --skill grafema-uri-semantic-id-parsing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Grafema Uri Semantic Id Parsing?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Grafema Uri Semantic Id Parsing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/disentinel-grafema-uri-semantic-id-parsing/badge)](https://www.skillsdirectory.com/skills/disentinel-grafema-uri-semantic-id-parsing)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: grafema-uri-semantic-id-parsing
description: |
  Fix silent failures when parsing Grafema semantic IDs that are in URI format
  instead of legacy arrow format. Use when: (1) code splits semantic IDs by "->"
  but gets the whole string back because IDs are grafema:// URIs, (2) file path
  extraction from semantic IDs returns empty or wrong values, (3) derived edges
  (DEPENDS_ON, etc.) produce 0 results despite source edges existing, (4) any
  code that processes semantic IDs after the analysis pipeline's to_uri_format()
  has run. The grafema:// URI format uses # fragments with percent-encoded
  characters instead of -> separators.
author: Claude Code
version: 1.0.0
date: 2026-03-16
---

# Grafema URI Semantic ID Parsing

## Problem
Code that processes semantic IDs using `split("->")` silently fails when the
analysis pipeline has converted IDs to `grafema://` URI format. The URI format
uses `#` fragments with percent-encoded characters (`%3E` instead of `>`),
so `->` never appears and `split("->")` returns the entire string as element 0.

## Context / Trigger Conditions
- Derived edges (e.g., MODULE->MODULE DEPENDS_ON from IMPORTS_FROM) produce 0 results
- File path extraction from semantic IDs returns the whole URI string
- Any Rust code in the orchestrator that processes semantic IDs from RFDB after
  `to_uri_format()` has been called during analysis
- Lookups into `file_to_module` or similar file-keyed maps always miss

## The Two Formats

**Legacy compact format** (before `to_uri_format`):
```
src/components/App.tsx->IMPORT_BINDING->react
MODULE#src/components/App.tsx
```

**URI format** (after `to_uri_format`, stored in RFDB):
```
grafema://github.com/owner/repo/src/components/App.tsx#IMPORT_BINDING%3Ereact
grafema://github.com/owner/repo/src/components/App.tsx#MODULE
```

**Virtual nodes** (no file path):
```
grafema://github.com/owner/repo/_/EXTERNAL_MODULE%3Elodash
grafema://github.com/owner/repo/_/GLOBAL%3A%3Aconsole
```

## Solution

Always handle both formats when extracting file paths from semantic IDs:

```rust
// Pre-compute URI prefix (authority is known from resolve_authority())
let uri_prefix = format!("grafema://{authority}/");

let extract_file = |id: &str| -> &str {
    if let Some(rest) = id.strip_prefix(&uri_prefix) {
        // URI format: take path up to '#'
        rest.split('#').next().unwrap_or("")
    } else {
        // Legacy format: take path up to first '->'
        id.split("->").next().unwrap_or("")
    }
};
```

Key points:
- `authority` is always available via `resolve_authority(&cfg)` in main.rs
- Virtual nodes have `_/` as the file path component — these won't match real files (correct behavior)
- `node.file` fields stay as **relative paths** (not URI-formatted), so `file_to_module` maps use relative paths as keys
- Edge `src`/`dst` fields ARE URI-formatted (they reference node IDs which were converted)

## Verification

After fixing, check:
1. `all_imports_from_edges.len()` > 0 (edges are collected)
2. `depends_on_pairs.len()` > 0 (file paths extracted and matched)
3. Tracing output shows "Module dependency edges derived" with non-zero count

## Example: The DEPENDS_ON Bug

The `to_uri_format()` method in analyzer.rs converts node IDs but keeps `node.file` as-is:
```rust
pub fn to_uri_format(&mut self, authority: &str) {
    for node in &mut self.nodes {
        node.id = convert(&node.id);  // → grafema://authority/path#FRAGMENT
        // node.file stays as relative path
    }
    for edge in &mut self.edges {
        edge.src = convert(&edge.src);  // → URI format
        edge.dst = convert(&edge.dst);  // → URI format
    }
}
```

So IMPORTS_FROM edges in RFDB have URI-formatted src/dst, but MODULE nodes have
relative file paths. The derivation code must parse URIs to extract relative paths
for the `file_to_module` lookup.

## Notes
- This affects ALL code that processes semantic IDs from RFDB in the orchestrator
- The `compact_to_uri` function in analyzer.rs defines the exact URI structure
- Fragment encoding: `>` → `%3E`, `[` → `%5B`, `]` → `%5D`, `#` → `%23`
- If `authority` changes between runs, old and new URIs won't match

Attribution

DisentinelDisentinel
View sourceMore from Disentinel →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

281612 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2132 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →