How `build‑iterated‑agentic‑loop` Explores a Target Repository: A Deep‑Dive into Automated Repo Analysis

The build‑iterated‑agentic‑loop skill explores a target repository by scanning GitHub Actions workflows, detecting the package manager from lock files, identifying validation scripts, and inspecting existing skill definitions to generate a tailored agentic loop.

The build-iterated-agentic-loop skill automates the creation of agentic loops—combining skills, workflows, and memory files—by first understanding the codebase it will operate on. This exploration phase is critical: without accurate context about dependencies, CI conventions, and existing tooling, the generated automation would fail in practice.

What the Exploration Phase Discovers

When you run skills run build-iterated-agentic-loop /path/to/target-repo, the skill executes a five‑step discovery process defined in SKILL.md【/cache/repos/github.com/humanlayer/skills/main/plugins/build-iterated-agentic-loop/skills/build-iterated-agentic-loop/SKILL.md#L22-L33】.

1. GitHub Actions Workflow Inspection

The skill reads .github/workflows/*.yml and any custom actions in .github/actions/** to extract:

  • Runner environment (Ubuntu version, container images)
  • Checkout steps and token permissions
  • Caching strategies for dependencies
  • PR‑handling conventions (branch naming, auto‑merge rules)

This ensures the generated workflow matches the repository's existing CI patterns rather than clashing with them.

2. Package Manager Detection

The skill scans for standard lock and manifest files to determine how dependencies are managed:

File Detected Package Manager Install Command
package-lock.json npm npm ci
yarn.lock Yarn yarn install --frozen-lockfile
pnpm-lock.yaml pnpm pnpm install
bun.lock Bun bun install
pyproject.toml Poetry/PDM/pip pip install -e . or poetry install
go.mod Go modules go mod download
Cargo.toml Cargo cargo build

From this detection, the skill constructs the exact install command needed for the generated workflow.

3. Validation Script Discovery

The skill searches for quality‑assurance commands that must pass before automation creates pull requests. Common patterns include:

  • Lint commands: npm run lint, pylint, gofmt
  • Type checking: tsc --noEmit, mypy
  • Test suites: npm test, pytest, go test
  • Format checks: prettier --check, black --check

These become gating checks in the generated agentic workflow.

4. Existing Skill Audit

To avoid collisions and maintain consistency, the skill checks .claude/skills/ and .agents/skills/ directories for previously defined skills. This prevents:

  • Duplicate naming conventions
  • Conflicting file layouts
  • Overlapping responsibilities

5. Structured Summary Output

The exploration concludes with a machine‑parseable summary containing:

  • Detected workflow files and their purposes
  • Identified package manager and install command
  • List of applicable validation scripts
  • References to existing skill directories

Running the Skill: Complete Example

Install and execute the skill against any repository:


# One-time installation

npx skills add humanlayer/skills --skill build-iterated-agentic-loop

# Execute exploration and loop generation

skills run build-iterated-agentic-loop /path/to/target-repo

Sample Exploration Output


🕵️  Exploring repository...
• Detected workflow files: .github/workflows/ci.yml, .github/workflows/release.yml
• Package manager: npm (package.json present)
• Install command: npm ci
• Validation scripts found:
   - npm run lint
   - npm run test --if-present
   - npm run build
• Existing skill directories: .claude/skills/fix-eslint-issues

This output feeds directly into template population for the skill, workflow, and memory files.

How Exploration Data Powers Template Generation

The build-iterated-agentic-loop skill uses three template files that are dynamically populated based on exploration findings:

Template File Purpose Location
skill-template.md Base skill skeleton with repo‑specific commands plugins/build-iterated-agentic-loop/skills/build-iterated-agentic-loop/references/skill-template.md
workflow-template.yml GitHub Actions workflow using detected install/validation steps plugins/build-iterated-agentic-loop/skills/build-iterated-agentic-loop/references/workflow-template.yml
memory-template.md .github/agent-memory/<task>.md structure for persisting state plugins/build-iterated-agentic-loop/skills/build-iterated-agentic-loop/references/memory-template.md

The exploration phase ensures these templates contain working commands rather than placeholders. For example, if the skill detects pnpm-lock.yaml, the workflow template receives pnpm install and pnpm run lint instead of generic npm equivalents.

Key Implementation Files

File Role
plugins/build-iterated-agentic-loop/skills/build-iterated-agentic-loop/SKILL.md Primary specification defining exploration steps and completion criteria【/cache/repos/github.com/humanlayer/skills/main/plugins/build-iterated-agentic-loop/skills/build-iterated-agentic-loop/SKILL.md#L22-L33】
plugins/build-iterated-agentic-loop/references/workflow-template.yml CI/CD workflow template populated after repo analysis
plugins/build-iterated-agentic-loop/references/memory-template.md Agent memory file skeleton
plugins/build-iterated-agentic-loop/references/skill-template.md Skill definition template

Summary

  • build-iterated-agentic-loop performs automated repository exploration before generating any automation code
  • Five discovery steps: workflow inspection, package manager detection, validation script gathering, existing skill audit, and structured summary
  • Detection covers npm, Yarn, pnpm, Bun, Python, Go, and Rust ecosystems through lock file analysis
  • Output feeds three templates (skill, workflow, memory) to create working, repo‑specific automation
  • Primary specification resides in SKILL.md with detailed exploration criteria at lines 22‑33

Frequently Asked Questions

What triggers the exploration phase in build-iterated-agentic-loop?

The exploration phase runs automatically when you execute skills run build-iterated-agentic-loop <path>. It is the first of multiple phases defined in SKILL.md, executing before any template generation or user questioning occurs.

How does the skill handle monorepos with multiple package managers?

The skill detects all present lock files and prioritizes based on prevalence and workflow context. If multiple package managers exist—such as package.json at root and Cargo.toml in a subdirectory—the exploration summary includes both, and the generated skill can reference context‑specific install commands for each workspace.

Can the exploration phase be customized or skipped?

No. The exploration phase is mandatory as defined in the current SKILL.md specification. The completion criterion explicitly requires naming the repo's package manager, install command, validation commands, and workflow conventions before proceeding to skill generation.

Where does the skill store its findings after exploration?

Findings are held in memory during execution and used to populate the three reference templates. The generated skill, workflow, and memory files are then written to the target repository's .github/ or .claude/skills/ directories as persistent artifacts.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →