# Cd Repository Discovery

> Discovers Xperience by Kentico deployment context (app path, CI/CD repository paths, and available git tooling) and saves it to a reusable context file for follow-up CD repository configuration.

- **Type:** Skill
- **Install:** `agentstack add skill-kentico-xperience-by-kentico-kenticopilot-cd-repository-discovery`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Kentico](https://agentstack.voostack.com/s/kentico)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Kentico](https://github.com/Kentico)
- **Source:** https://github.com/Kentico/xperience-by-kentico-kenticopilot/tree/main/plugins/configure-cd-repository/skills/cd-repository-discovery

## Install

```sh
agentstack add skill-kentico-xperience-by-kentico-kenticopilot-cd-repository-discovery
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

You are tasked with discovering repository and environment context required to build CD Repository filters.

## Input Parameters

- **Context Folder Path** - User-provided folder where you must write the discovery context file.

## Primary Goal

Create a machine-readable context file named `cd-repository-context.json` in the provided folder.

## Context File Contract

Write a JSON file with this shape (add additional helpful fields when available):

```json
{
  "generatedAtUtc": "ISO-8601 UTC timestamp",
  "repositoryRoot": "absolute path to git repository root",
  "appPath": "absolute path to Xperience by Kentico app",
  "ciRepositoryPath": "{appPath}/App_Data/CIRepository",
  "cdRepositoryConfigPath": "{appPath}/App_Data/CDRepository/repository.config",
  "tooling": {
    "ghAvailable": true,
    "gitAvailable": true,
    "preferredChangeSource": "gh|local-git"
  },
  "discovery": {
    "appPathSource": "user|discovered",
    "ciPathSource": "user|default|discovered",
    "cdConfigSource": "user|default|discovered",
    "repositoryConfigVersion": "2",
    "notes": [
      "optional notes about assumptions or fallbacks"
    ]
  }
}
```

## Steps To Follow

1. Ask the user for optional known values:
   - Xperience app path
   - CI Repository path
   - CD repository.config path
   - Preferred change source (`gh` or `local-git`)

2. Discover missing values automatically:
   - Search for `App_Data/CDRepository/repository.config`.
   - Search for `App_Data/CIRepository`.
   - Infer `appPath` as the parent folder of `App_Data`.
   - If multiple candidates exist, pick the best match by proximity/consistency and note alternatives in `discovery.notes`.

3. Validate all required paths exist:
   - `appPath`
   - `ciRepositoryPath`
   - `cdRepositoryConfigPath`

4. Detect repository.config syntax version:
   - Open the `repository.config` file and check the root `` attribute.
   - Record the version ("1" or "2") in `discovery.repositoryConfigVersion`.
   - If Version attribute is missing, assume v1 and record accordingly.

5. Detect tool availability:
   - Check if `gh` CLI is available.
   - Check if local `git` is available.
   - Set `preferredChangeSource`:
     - Use `gh` when `gh` is available and user did not force local git.
     - Otherwise use `local-git`.

6. Ensure the context folder exists, then write `cd-repository-context.json`.

7. Print a concise summary of what was discovered and where the context file was written.

## Rules

- Do not edit `repository.config` in this skill.
- Do not guess silently. If a critical value cannot be determined, ask a focused follow-up question.
- Keep paths absolute in the context file.
- Preserve user-provided values when valid; only fall back to discovery/defaults when needed.
- If both `gh` and `git` are unavailable, still write context with clear error notes and ask user to resolve tooling.
- If `repository.config` uses v1 syntax, record this in the context file and include a warning in the output summary.

## Output Format

Conclude with:

- Context file path
- App path
- CI repository path
- CD repository.config path
- Repository.config syntax version
- Tooling status (`gh`, `git`, chosen source)
- Any assumptions/fallbacks recorded
- **If v1 syntax detected:** Include this warning in the summary:
  > ⚠️ **Note:** The repository.config file uses the legacy v1 syntax. Before running `cd-repository-configure`, you must upgrade to v2 syntax using the `cd-repository-upgrade` skill. See [Migrate CI/CD repository.config to v2](https://docs.kentico.com/documentation/developers-and-admins/ci-cd/configure-ci-cd-repositories/config-v2-migration) for details.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Kentico](https://github.com/Kentico)
- **Source:** [Kentico/xperience-by-kentico-kenticopilot](https://github.com/Kentico/xperience-by-kentico-kenticopilot)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-kentico-xperience-by-kentico-kenticopilot-cd-repository-discovery
- Seller: https://agentstack.voostack.com/s/kentico
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
