nuguardai/nuguard/aibom-extraction
Claude Code and agent skill by nuguardai/nuguard
- community
Checking that the SKILL.md file is still in the repository.
Domain knowledge for NuGuard's AI Bill of Materials (AIBOM) extraction system. Covers the NuGuard SBOM primary schema, NuGuardEnricher pipeline, canonical_id derivation rules, adapter architecture (Python/TypeScript framework adapters), JSONB storage layout, and assessment_service integration. USE FOR: writing or modifying adapters, enricher logic, AIBOM API routes, migration scripts, or assessment integration. DO NOT USE FOR: general FastAPI questions or non-AIBOM backend work.
Install
npx vskill@latest install nuguardai/nuguard/aibom-extractionSKILL.md
NuGuard AIBOM Extraction — Domain Knowledge
Two Extraction Paths
Never mix the two paths. The NuGuard SBOM path stores nuguard_node / nuguard_edge JSONB; the legacy path leaves those columns NULL.
NuGuard SBOM Primary Schema
nuguard (version 0.4.0) is NuGuard's AI SBOM library, installed as nuguard==0.4.0 and imported via nuguard.sbom. Its core type is AiSbomDocument, which contains a list of Node objects and Edge objects.
Key NuGuard SBOM Types
CRITICAL: Where provider Lives
Failing to use extras.get("provider") silently breaks canonical_id derivation for MODEL nodes, causing duplicate entries across scans.
canonical_id Format
Examples:
agent:langchain:CustomerSupportAgentmodel:openai:gpt-4-turbotool:local:search_databaseprompt:openai-agents:triage_instructionsiam:aws:LambdaExecutionRole
Namespace Derivation (_derive_namespace in enricher.py)
Precedence order:
node.metadata.framework(if set and not a known-bad value)node.metadata.extras.get("provider")— this is where provider lives"nuguard"fallback
NodeType → canonical_id prefix
ComponentType → NodeType Mapping
Special Reclassification Rules
- FRAMEWORK → MODEL: If
name.lower()matches_KNOWN_LLM_PROVIDER_NAMES(openai, google, anthropic, mistral, etc.), the node is reclassified toNodeType.MODEL. This prevents bare LLM client imports from appearing as FRAMEWORK nodes.
- CONTAINER_IMAGE / DEPLOYMENT skipped if infra: Node names matching
_CONTAINER_INFRA_SKIP_NAMES(docker, docker-compose, containerd, podman) are dropped entirely.
- Datastore name normalization:
sqlite3→sqliteto prevent duplicates.
DB Storage Layout
aibom_nodes table (SQLAlchemy: AIBOMNode)
`properties` JSONB — flattened for backward compatibility, assessment_service reads from here in Phases 1–2. Key fields:
file_path,line_start,namespacemodel_name,model_family,providerframework,agent_type,rolenuguard_node_id— the original NuGuard SBOM UUID (for cross-reference)
assessment_service Phase 3+ can read directly from nuguard_node.
aibom_edges table
NuGuardEnricher API
`node_rows` — list of dicts ready for DB insert:
`edge_rows` — list of dicts:
Callers are responsible for resolving source_nuguard_id/target_nuguard_id to DB UUIDs after the node insert batch.
Legacy Adapter Architecture
Used only as fallback when NuGuard SBOM extraction fails.
BaseAdapter
Node / Edge dataclasses (for adapters)
Supported Adapters (Python)
autogen— AutoGen v0.2 + v0.4 agents, GroupChatbedrock_agents— AWS Bedrock invoke_agent / InvokeInlineAgentCommandcrewai— CrewAI Crew, Agent, Taskgoogle_adk— Google Agent Development Kitlanggraph— LangGraph StateGraph, agentsllamaindex— LlamaIndex VectorStoreIndex, query enginesopenai_agents— OpenAI Agents SDK (Agent, Runner, handoffs)prompts— Generic PromptTemplate extractionsemantic_kernel— Semantic Kernel Kernel, pluginsllm_clients— Bare LLM API calls (openai, anthropic, google)datastores— Vector store and database connections
TypeScript adapters mirror the Python set under adapters/typescript/.
assessment_service Integration
When assessment_service evaluates an AIBOM scan, it reads node properties JSONB (and nuguard_node for Phase 3+) to generate evidence for each control.
Key property fields consumed by assessment:
The ai_sbom_assessable flag on control_library rows (migration 013) marks which controls should use the AIBOM evidence path vs. requiring manual attestation.
Querying AIBOM from Frontend
Common Pitfalls
| Pitfall | Correct approach | |
|---|---|---|
Reading node.metadata.provider | Read node.metadata.extras.get("provider") | |
Creating a new adapter without updating registry.py | Always register via AdapterRegistry.register(MyAdapter) | |
Using node.id as the DB primary key | NuGuard SBOM node.id is an internal UUID; store in properties.nuguard_node_id; DB gets its own UUID | |
Assuming canonical_id is unique per scan | It's unique per tenant across scans — deduplication intentional | |
Adding a new ComponentType without updating _COMPONENT_TO_NODE_TYPE | Add mapping in enricher.py; also add to NodeType enum in ids.py if it's a new type | |
Storing sensitive data in properties JSONB | Properties are returned in API responses; never store secrets, tokens, or PII there |
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingtests/apps/pinnacle-bank-app/.github/skills/aibom-extraction/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/nuguardai/nuguard/aibom-extraction)