repo-metadata

This skill should be used when the user asks to "generate repository metadata", "create catalog-info.yaml", "add repo metadata", "document repository structure", or mentions generating structured metadata for service catalog or architecture documentation.

242 stars

Best use case

repo-metadata is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. This skill should be used when the user asks to "generate repository metadata", "create catalog-info.yaml", "add repo metadata", "document repository structure", or mentions generating structured metadata for service catalog or architecture documentation.

This skill should be used when the user asks to "generate repository metadata", "create catalog-info.yaml", "add repo metadata", "document repository structure", or mentions generating structured metadata for service catalog or architecture documentation.

Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.

Practical example

Example input

Use the "repo-metadata" skill to help with this workflow task. Context: This skill should be used when the user asks to "generate repository metadata", "create catalog-info.yaml", "add repo metadata", "document repository structure", or mentions generating structured metadata for service catalog or architecture documentation.

Example output

A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.

When to use this skill

  • Use this skill when you want a reusable workflow rather than writing the same prompt again and again.

When not to use this skill

  • Do not use this when you only need a one-off answer and do not need a reusable workflow.
  • Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/repo-metadata/SKILL.md --create-dirs "https://raw.githubusercontent.com/aiskillstore/marketplace/main/skills/astrabit-cpt/repo-metadata/SKILL.md"

Manual Installation

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

How repo-metadata Compares

Feature / Agentrepo-metadataStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

This skill should be used when the user asks to "generate repository metadata", "create catalog-info.yaml", "add repo metadata", "document repository structure", or mentions generating structured metadata for service catalog or architecture documentation.

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

# Repository Metadata

Generate structured `catalog-info.yaml` metadata for repositories using industry-standard conventions (based on Backstage catalog format). This metadata enables cross-repository architecture analysis and service catalog functionality.

## Purpose

Create and maintain `catalog-info.yaml` files that describe a repository's role in the broader architecture. This metadata feeds into architectural views, dependency graphs, and service groupings across the entire organization.

## When to Use

Trigger this skill when:
- User asks to "generate repo metadata" or "create catalog-info.yaml"
- User wants to document a repository for a service catalog
- User needs to prepare a repository for cross-repo architecture analysis
- User mentions "service catalog" or "component metadata"

## Metadata Schema

The `catalog-info.yaml` file follows Backstage conventions with Astrabit-specific extensions:

```yaml
apiVersion: astrabit.io/v1
kind: Component
metadata:
  name: service-name          # Required: Unique identifier
  description: Brief description
  tags:
    - backend
    - user-management
spec:
  # Service Classification
  type: service               # Required: service, gateway, worker, library, frontend, database
  category: backend           # Broader category
  domain: trading             # Business domain
  owner: platform-team        # Team responsible

  # Dependencies (Upstream)
  dependsOn:
    - component: auth-service
      type: service
    - component: user-db
      type: database

  # APIs Provided
  providesApis:
    - name: User API
      type: REST
      definition: ./openapi.yaml

  # APIs Consumed
  consumesApis:
    - name: Auth API
      providedBy: auth-service

  # Events Produced
  eventProducers:
    - name: user-events
      type: kafka
      topic: user.created
      schema: avro

  # Events Consumed
  eventConsumers:
    - name: order-events
      type: kafka
      topic: order.placed
      group: user-service-group

  # HTTP Routes (for gateways/services)
  routes:
    - path: /api/users/*
      methods: [GET, POST, PUT, DELETE]
      handler: this
    - path: /api/auth/*
      methods: [POST]
      forwardsTo: auth-service

  # Infrastructure
  runtime: nodejs             # nodejs, python, go, java, etc.
  framework: nestjs           # nestjs, fastapi, spring, etc.
```

## Generation Workflow

### Phase 1: Analyze Repository

Gather information about the repository:

1. **Use existing analysis scripts:**
   ```bash
   python skills/repo-docs/scripts/analyze-repo-structure.py /path/to/repo
   python skills/repo-docs/scripts/find-integration-points.py /path/to/repo
   ```

2. **Read existing documentation:**
   - Check for `INTEGRATIONS.md` - contains upstream/downstream relationships
   - Check for `ARCHITECTURE.md` - contains service role and dependencies
   - Check for `README.md` - contains basic description and tech stack

3. **Detect from code:**
   - Language from file extensions and package files
   - Framework from dependencies
   - Integration points from import patterns

### Phase 2: Generate Metadata

Based on analysis, generate `catalog-info.yaml` with detected values:

| Field | Detection Method |
|-------|------------------|
| `name` | Repo name or `package.json` `name` field |
| `description` | README title/description or generated from code |
| `type` | Inferred from code patterns (gateway has routes, worker has consumers only) |
| `runtime` | From package files (`package.json`, `pyproject.toml`, `go.mod`) |
| `framework` | From dependencies (`nestjs`, `fastapi`, `spring-boot`, etc.) |
| `dependsOn` | From integration point scanning |
| `eventProducers` | From `kafka.producer` or similar patterns |
| `eventConsumers` | From `@KafkaListener`, `@EventListener`, or similar patterns |
| `routes` | From `@Controller`, `@GetMapping`, router definitions |

### Phase 3: Present and Refine

Present the generated metadata to the user in a table format:

```markdown
Generated catalog-info.yaml:

| Field | Value | Source |
|-------|-------|--------|
| name | user-service | repo name |
| type | service | detected: has routes and consumers |
| runtime | nodejs | package.json |
| framework | nestjs | dependencies |
| domain | unknown | ❌ needs input |
| owner | unknown | ❌ needs input |
| dependsOn | auth-service, user-db | integration scan |
```

Prompt user to review and fill in missing fields (marked with ❌).

### Phase 4: Write Metadata File

Write `catalog-info.yaml` to the repository root.

### Phase 5: Update Related Documentation

Offer to update related docs to reference the new metadata file:
- Add link to `catalog-info.yaml` in `README.md`
- Update `INTEGRATIONS.md` to be consistent with metadata

## Service Type Detection

| Type | Indicators |
|------|------------|
| **gateway** | Has `routes` with `forwardsTo`, handles external requests, minimal business logic |
| **service** | Has both `providesApis` and `consumesApis`, business logic |
| **worker** | Only `eventConsumers`, no HTTP routes, background processing |
| **library** | No APIs consumed, only provides, shared utilities |
| **frontend** | `type: frontend` in package.json, has build artifacts |
| **database** | Contains migrations, schemas, no application code |

## Script Usage

Use `scripts/generate-metadata.py` to automate metadata generation:

```bash
# Generate from current directory
python skills/repo-metadata/scripts/generate-metadata.py

# Generate from specific repo
python skills/repo-metadata/scripts/generate-metadata.py /path/to/repo

# Output as JSON for inspection
python skills/repo-metadata/scripts/generate-metadata.py --format json
```

The script:
1. Runs repo structure analysis
2. Scans for integration points
3. Reads existing docs
4. Outputs `catalog-info.yaml` content

## Additional Resources

### Reference Files

- **`references/schema.md`** - Complete catalog-info.yaml schema reference
- **`references/detection-patterns.md`** - Patterns for detecting service characteristics

### Example Templates

- **`examples/catalog-info-template.yaml`** - Full template with all fields
- **`examples/catalog-info-gateway.yaml`** - Example gateway service
- **`examples/catalog-info-worker.yaml`** - Example worker service
- **`examples/catalog-info-library.yaml`** - Example shared library

## Quality Checklist

Before finalizing metadata, verify:

- [ ] `name` is unique across the organization
- [ ] `type` correctly classifies the service
- [ ] `domain` and `owner` are filled (not auto-detected)
- [ ] `dependsOn` lists all upstream dependencies
- [ ] `eventProducers` and `eventConsumers` are complete
- [ ] Routes are documented if this is a gateway/service
- [ ] File is valid YAML
- [ ] File is at repository root (`catalog-info.yaml`)

Related Skills

weekly-report

242
from aiskillstore/marketplace

帮助用户梳理周报,按照完整逻辑展示工作价值和边界。当用户说"写周报"、"周报"、"梳理周报"、"整理工作"时触发。

github-repo-search

242
from aiskillstore/marketplace

帮助用户搜索和筛选 GitHub 开源项目,输出结构化推荐报告。当用户说"帮我找开源项目"、"搜一下GitHub上有什么"、"找找XX方向的仓库"、"开源项目推荐"、"github搜索"、"/github-search"时触发。

turborepo-caching

242
from aiskillstore/marketplace

Configure Turborepo for efficient monorepo builds with local and remote caching. Use when setting up Turborepo, optimizing build pipelines, or implementing distributed caching.

monorepo-management

242
from aiskillstore/marketplace

Master monorepo management with Turborepo, Nx, and pnpm workspaces to build efficient, scalable multi-package repositories with optimized builds and dependency management. Use when setting up monorepos, optimizing builds, or managing shared dependencies.

monorepo-architect

242
from aiskillstore/marketplace

Expert in monorepo architecture, build systems, and dependency management at scale. Masters Nx, Turborepo, Bazel, and Lerna for efficient multi-project development. Use PROACTIVELY for monorepo setup,

daily-news-report

242
from aiskillstore/marketplace

Scrapes content based on a preset URL list, filters high-quality technical information, and generates daily Markdown reports.

repo-intake-and-plan

242
from aiskillstore/marketplace

Narrow helper skill for README-first AI repo reproduction. Use when the task is specifically to scan a repository, read the README and common project files, extract documented commands, classify inference, evaluation, and training candidates, and return the smallest trustworthy reproduction plan to the main orchestrator. Do not use for environment setup, asset download, command execution, final reporting, paper lookup, or end-to-end orchestration.

lark-workflow-standup-report

242
from aiskillstore/marketplace

日程待办摘要:编排 calendar +agenda 和 task +get-my-tasks,生成指定日期的日程与未完成任务摘要。适用于了解今天/明天/本周的安排。

fixing-metadata

242
from aiskillstore/marketplace

Ship correct, complete metadata.

reporting-sprints

242
from aiskillstore/marketplace

Use this skill when you need to report on a sprint

reporting-issues

242
from aiskillstore/marketplace

Use this skill when you need to report on a troubleshooting session

ghe-report

242
from aiskillstore/marketplace

Generate detailed workflow reports with metrics, health assessments, and epic-specific analysis for GitHub Elements. Covers throughput, cycle times, compliance status, and thread history.