analyze-source-material

Analyze mixed repositories (application code + infrastructure + policies + docs) to extract ALL components for ONE unified threat model. Use when analyzing codebases with multiple source types for threat modeling. Architecture modeling only - do NOT identify vulnerabilities.

16 stars

Best use case

analyze-source-material is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Analyze mixed repositories (application code + infrastructure + policies + docs) to extract ALL components for ONE unified threat model. Use when analyzing codebases with multiple source types for threat modeling. Architecture modeling only - do NOT identify vulnerabilities.

Teams using analyze-source-material should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/analyze-source-material/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/devops/analyze-source-material/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/analyze-source-material/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How analyze-source-material Compares

Feature / Agentanalyze-source-materialStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Analyze mixed repositories (application code + infrastructure + policies + docs) to extract ALL components for ONE unified threat model. Use when analyzing codebases with multiple source types for threat modeling. Architecture modeling only - do NOT identify vulnerabilities.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Source Material Analysis Instructions

## Executive Summary
Analyze mixed repositories (application code + infrastructure + policies + docs) to extract ALL components for ONE unified threat model. Your role: architecture modeling only—extract components, trust zones, and data flows. Do NOT identify vulnerabilities or security flaws; IriusRisk handles that automatically. Create a single comprehensive threat model covering all layers.

## Critical Principle: One Comprehensive Threat Model
Create ONE unified threat model including ALL components from ALL source types. Do NOT create separate models for code vs. infrastructure—IriusRisk works best with a complete, holistic view of the entire system.

## Scope-Aware Analysis for Multi-Repository Projects

**FIRST: Check for repository scope definition** in `.iriusrisk/project.json`:

```json
{
  "name": "E-commerce Platform",
  "reference_id": "ecommerce-platform",
  "scope": "AWS cloud infrastructure via Terraform. Provisions ECS for backend API 
           (api-backend repo), RDS PostgreSQL, ALB, CloudFront for frontend static 
           assets (web-frontend repo). All application components from other repos 
           should run within these AWS services."
}
```

### When Scope is Defined

**Your analysis must be FOCUSED on the scope:**

1. **Understand the scope boundaries:**
   - What is THIS repository responsible for?
   - What components from OTHER repositories are mentioned?
   - What is the architectural relationship to other parts?

2. **Focus your component extraction:**
   - Extract components relevant to THIS repository's scope
   - Note references to components from other repositories
   - Understand how your components relate to the broader system

3. **Scope-specific extraction strategies:**

   **Infrastructure scope** (e.g., "AWS infrastructure", "Kubernetes platform"):
   - **Primary focus**: Cloud resources, networking, compute platforms
   - **Extract**: VPCs, load balancers, container orchestration, managed databases, CDN, storage services
   - **Note**: Application components mentioned in scope (e.g., "backend API from api-backend repo")
   - **Expectation**: Your components will CONTAIN or HOST application components from other repos

   **Application scope** (e.g., "Backend API", "Payment service"):
   - **Primary focus**: Business logic, services, APIs
   - **Extract**: Service endpoints, business logic components, data access layers, auth modules
   - **Note**: Infrastructure mentioned in scope (e.g., "deployed to ECS from terraform repo")
   - **Expectation**: Your components will RUN INSIDE infrastructure components from other repos

   **Frontend scope** (e.g., "React SPA", "Mobile app"):
   - **Primary focus**: Client-side components, UI layers
   - **Extract**: Frontend application, API clients, authentication flows, client-side state management
   - **Note**: Backend services and CDN mentioned in scope
   - **Expectation**: Your components connect to backend APIs and run on CDN/infrastructure

### When Scope is NOT Defined

**Use comprehensive, all-encompassing analysis:**
- Extract ALL components from ALL source types
- Create complete, holistic threat model
- Include application, infrastructure, data, and integration layers
- Standard single-repository analysis approach

## Your Role: Architecture Modeling Only
**Do:** Extract components, trust zones, and data flows  
**Do NOT:** Identify vulnerabilities, threats, security flaws, or speculate about weaknesses  
**Why:** IriusRisk performs all security analysis automatically

## 🚨 CRITICAL: Tags Are For Architecture, NOT Vulnerabilities

When analyzing source code, you will inevitably notice security issues (SQL injection, weak crypto, etc.). **DO NOT add these as tags to components or dataflows.**

### ✅ CORRECT Tag Usage - Architectural Categorization

**Tags describe the NATURE and PURPOSE of components:**

```yaml
components:
  - id: "payment-api"
    name: "Payment Service"
    tags:
      - "payment-processing"      # ✅ Business function
      - "pci-dss-scope"          # ✅ Compliance relevance
      - "customer-data"          # ✅ Data sensitivity
      - "public-facing"          # ✅ Network exposure
```

### ❌ WRONG Tag Usage - Vulnerability Documentation

**NEVER add tags for vulnerabilities you find in code:**

```yaml
# ❌ DO NOT DO THIS - Even if you find these issues in source code
components:
  - id: "flask-app"
    tags:
      - "sql-injection-vulnerable"      # ❌ NO! This is a threat
      - "insecure-deserialization"      # ❌ NO! This is a vulnerability
```

### Why This Rule Exists

1. **IriusRisk finds vulnerabilities** - Its threat library identifies these based on component types
2. **Tags clutter diagrams** - Vulnerability labels make the diagram unreadable
3. **Defeats automation** - If you manually tag all issues, why use IriusRisk?
4. **Mixes concerns** - OTM = architecture (what IS), Threats = security analysis (what's WRONG)

## Component Types to Extract

### 1. Application/Functional Components
**From source code, APIs, microservices:**
- **Business Logic Components**: Payment processing, user authentication, order management
- **Application Services**: User management service, notification service, audit service
- **API Endpoints**: REST APIs, GraphQL endpoints, webhook receivers
- **Background Processes**: Batch jobs, scheduled tasks, data processing pipelines

### 2. Data Components
**From databases, data flows, storage systems:**
- **Data Stores**: SQL databases, NoSQL databases, data warehouses, caches
- **Data Processing**: ETL pipelines, stream processing, data analytics engines
- **Data Storage**: File systems, object storage (S3), content delivery networks

### 3. Infrastructure/Network Components
**From Terraform, cloud configurations, network diagrams:**
- **Compute Resources**: Virtual machines, containers, serverless functions
- **Network Infrastructure**: VPCs, subnets, NAT gateways, internet gateways
- **Load Balancing**: Application load balancers, network load balancers, API gateways

### 4. Cloud Services Components
**From cloud provider configurations:**
- **Serverless**: Lambda functions, Step Functions, EventBridge, SQS, SNS
- **Managed Services**: RDS, DynamoDB, ElastiCache, Elasticsearch
- **Storage Services**: S3 buckets, EFS, EBS volumes, Glacier

### 5. Integration Components
**From API configurations, message queues, external services:**
- **Message Queues**: SQS, RabbitMQ, Kafka, EventBridge
- **External APIs**: Third-party payment processors, social media APIs
- **Integration Platforms**: API management platforms, ESBs

## Source Analysis Strategy

### Phase 1: Repository Scanning and Categorization
1. **Identify all source types** in the repository:
   - Application source code (multiple languages/frameworks)
   - Infrastructure as Code (Terraform, CloudFormation, Kubernetes)
   - Configuration files (Docker, CI/CD, environment configs)
   - Security policies and compliance documentation
   - Architecture documentation and diagrams

2. **Catalog components by source type**:
   - Create inventory of what each source type reveals
   - Note overlaps and relationships between sources
   - Identify gaps where components are referenced but not defined

### Phase 2: Component Extraction and Classification

**From Application Code:** Extract business logic (auth services, business domain services, API endpoints, background jobs). Extract components separately from infrastructure—they'll be nested within infrastructure components (containers, VMs).

**From Infrastructure Code (Terraform/CloudFormation):** Extract cloud resources, security groups/ACLs, load balancers, database instances, monitoring configs, IAM roles.

**From Security Policies/Documentation:** Identify required controls, compliance frameworks, data classification, network segmentation policies.

**From Configuration/Deployment Files:** Discover container definitions, orchestration, environment configs, CI/CD pipelines, monitoring/observability.

### Phase 3: Component Consolidation and Relationship Mapping

**1. Merge overlapping components:** Consolidate same logical component appearing in multiple sources into one with comprehensive properties.

**2. Plan nesting hierarchy:**
- Infrastructure layer → Cloud resources, VMs, containers, managed services
- Business logic layer → Application services nested within infrastructure
- Data layer → Databases/storage (nested or standalone)
- Integration layer → External APIs, message queues, third-party services

**3. Establish relationships:** Nesting (business logic within infrastructure), data flows (between components and data stores), network connections (between infrastructure).

**4. Define trust zones:**
- Internet Zone (trust rating: 1) - Public-facing components, external APIs
- DMZ Zone (3) - Load balancers, web servers, API gateways
- Application Zone (5) - Business logic services, application servers
- Data Zone (7) - Databases, caches, data processing
- Management Zone (8) - Admin interfaces, monitoring, logging

## Workflow Integration

1. Call analyze_source_material() for guidance
2. Call create_threat_model() for OTM creation workflow
3. Execute: **sync() FIRST (mandatory, even if local files exist)** → create OTM → import_otm() → project_status() → sync()

**⚠️ IMPORTANT:** Always call sync() before creating or modifying the OTM, even if `.iriusrisk/current-threat-model.otm` already exists locally. The user may have modified the threat model via the IriusRisk web interface since the last sync. Using a stale local file will overwrite their changes.

Result: Single, comprehensive threat model for holistic IriusRisk analysis across all system layers.

Related Skills

asciinema-analyzer

16
from diegosouzapw/awesome-omni-skill

Semantic analysis of asciinema recordings. TRIGGERS - analyze cast, keyword extraction, find patterns in recordings.

analyzing-source

16
from diegosouzapw/awesome-omni-skill

Conducts in-depth analysis of a specific source or topic, producing comprehensive summaries for research synthesis. Use when you need detailed analysis and documentation of individual sources as part of a larger research effort.

analyze-state

16
from diegosouzapw/awesome-omni-skill

Terraform state を分析・操作する。「state 確認」「state list」「state show」「リソース一覧」「state の移動」「state mv」「state rm」「terraform state」「state 操作」「リソースの状態」「state pull」などで起動。

analyze-malware

16
from diegosouzapw/awesome-omni-skill

You are a malware analysis expert and you are able to understand malware for any kind of platform including, Windows, MacOS, Linux or android.

analyze-high-unemployment-high-gdp-growth-fiscal-deficit-scenarios

16
from diegosouzapw/awesome-omni-skill

在「失業率走高/勞動市場轉弱」但「名目或實質 GDP 仍維持高位(或仍在成長)」的情境下,依據歷史關聯估算美國財政赤字占 GDP(Deficit/GDP)可能擴張的區間,並生成對長天期美債(長久期 UST)供給/利率風險的情境解讀。支援視覺化圖表輸出。

analyze-ci-failure-logs

16
from diegosouzapw/awesome-omni-skill

Parse and analyze CI failure logs to identify root causes and error patterns. Use when CI builds fail to understand what broke.

ack-resources

16
from diegosouzapw/awesome-omni-skill

AWS Controllers for Kubernetes (ACK) for Kubernetes-native AWS resource management. Use when managing AWS resources via kubectl, implementing GitOps for infrastructure, creating self-service developer platforms, integrating AWS services with EKS workloads, or adopting existing AWS resources into Kubernetes.

workflow-analyzer

16
from diegosouzapw/awesome-omni-skill

作業フローや手順を分析し、自動化可能な要素を特定する。ワークフロー分析時、自動化検討時、業務プロセス改善時、またはユーザーが作業フロー分析、自動化要素、業務手順、プロセス最適化に言及した際に使用する。

springboot-architecture-analyzer

16
from diegosouzapw/awesome-omni-skill

系統化分析 Spring Boot 專案並生成完整的企業級架構文件,涵蓋系統概述、架構視圖、技術細節、部署策略等所有關鍵面向。

repository-analyzer

16
from diegosouzapw/awesome-omni-skill

Comprehensive repository analysis using Explore agents, web search, and Context7 to investigate codebase structure, technology stack, configuration, documentation quality, and provide actionable insights. Use this skill when asked to analyze, audit, investigate, or report on a repository or codebase. | Exploreエージェント、Web検索、Context7を用いた包括的なリポジトリ分析。コードベース構造、技術スタック、設定、ドキュメント品質を調査し、実用的な洞察を提供。リポジトリやコードベースの分析、監査、調査、レポート作成を依頼された場合に使用。

project-analyzer

16
from diegosouzapw/awesome-omni-skill

Automated brownfield codebase analysis. Detects project type, frameworks, dependencies, architecture patterns, and generates comprehensive project profile. Essential for Conductor integration and onboarding existing projects.

analyze-project

16
from diegosouzapw/awesome-omni-skill

Use when starting work on an unfamiliar project or needing to understand a codebase - performs comprehensive analysis discovering architecture, patterns, dependencies, testing coverage, and improvement opportunities. Do NOT use on projects you already know well or for targeted questions about specific files - use direct exploration instead for focused queries.