# Reference File for CI Agent Runs in narrow-react-prop-types: Complete Guide

> Discover the reference file for CI agent runs in narrow-react-prop-types. Learn how the agent-narrow-component-props.yml file details GitHub Actions workflows for agent execution.

- Repository: [HumanLayer/skills](https://github.com/humanlayer/skills)
- Tags: api-reference
- Published: 2026-09-07

---

**The reference file for CI agent runs in the `narrow-react-prop-types` plugin is [`plugins/narrow-react-prop-types/skills/narrow-react-prop-types/references/agent-narrow-component-props.yml`](https://github.com/humanlayer/skills/blob/main/plugins/narrow-react-prop-types/skills/narrow-react-prop-types/references/agent-narrow-component-props.yml), which defines the complete GitHub Actions workflow for scheduled, manual, and `/iterate` agent execution.**

This workflow file serves as the single source of truth for how the CodeLayer agent orchestrates React prop-type narrowing tasks. Located in the humanlayer/skills repository, it handles environment setup, agent execution, and pull request management for this AI-powered code improvement skill.

## Understanding the Reference File Structure

The reference file for CI agent runs controls every aspect of the agent's lifecycle. It combines multiple trigger types, concurrency controls, and post-execution automation into one declarative configuration.

### Workflow Triggers and Execution Modes

The [`agent-narrow-component-props.yml`](https://github.com/humanlayer/skills/blob/main/agent-narrow-component-props.yml) workflow supports three distinct invocation patterns:

- **Scheduled runs**: Daily at 13:00 UTC via `schedule: "0 13 * * *"`
- **Manual dispatch**: Triggered from GitHub UI or API with optional `target_path` input
- **Issue comment iteration**: Responds to `/iterate` comments on existing agent-generated PRs

Each mode shares the same core execution logic but diverges in branch handling and PR creation strategy.

```yaml

# Excerpt from agent-narrow-component-props.yml

on:
  schedule:
    - cron: "0 13 * * *"
  workflow_dispatch:
    inputs:
      target_path:
        description: "Path to a React component or package (optional)"
        required: false
        type: string
  issue_comment:
    types: [created]

```

### Permission and Concurrency Configuration

The workflow explicitly requests **write permissions** for contents, pull requests, and issues. This enables autonomous PR creation and comment management:

```yaml
permissions:
  contents: write
  pull-requests: write
  issues: write

concurrency:
  group: agent-react-component-props
  cancel-in-progress: true

```

The concurrency block prevents overlapping runs of the same agent, ensuring clean state management when multiple triggers occur close together.

## The `/iterate` Feedback Loop

A distinctive feature of this reference file for CI agent runs is its support for iterative refinement through PR comments.

### How the Pre-flight Check Works

Before executing the agent, the workflow verifies that a `/iterate` comment was posted on a valid agent-generated PR. It searches for a hidden marker in the PR body:

```bash

# From the workflow's pre-flight step

if [[ "$COMMENT_BODY" == "/iterate"* ]]; then
  PR_BODY=$(gh pr view $PR_NUMBER --json body -q .body)
  if [[ "$PR_BODY" == *"<-- codelayer-agent:workflow=agent-narrow-component-props;"* ]]; then
    echo "valid_iterate=true" >> $GITHUB_OUTPUT
  fi
fi

```

This marker—`<-- codelayer-agent:workflow=agent-narrow-component-props;`—acts as a signature proving the PR originated from this specific agent workflow.

### Memory Persistence Across Iterations

When `/iterate` is triggered, the agent loads its memory file before execution:

```bash
MEMORY_CONTENT=$(cat .github/agent-memory/narrow-component-props.md 2>/dev/null || echo "")

```

This markdown file stores learned patterns, validation results, and user feedback, enabling progressive improvement across multiple agent runs.

## Agent Prompt Construction

The reference file for CI agent runs dynamically assembles a structured prompt that combines static instructions with runtime context:

```bash
PROMPT="$(cat <<EOF

# Context

You are narrowing React component prop types in this repository. Begin by using the \`narrow-react-prop-types\` skill.

# Instructions

1. Find components whose props are wider than their live non‑test, non‑Storybook call sites require.
2. Pick a small, reviewable set of high‑confidence prop narrowing changes.
3. Run the validation command specified in SKILL.md before declaring success.

${TARGET_INSTRUCTIONS}
${MEMORY_CONTENT}

EOF
)"

```

The `TARGET_INSTRUCTIONS` variable injects component-specific guidance when `workflow_dispatch` includes a `target_path` input.

## PR Lifecycle Management

The reference file for CI agent runs handles two distinct PR workflows depending on trigger type.

### New PR Creation (Scheduled/Manual)

```bash

# Branch naming with timestamp for uniqueness

BRANCH="agent/narrow-props-$(date +%Y%m%d-%H%M%S)"
git checkout -b $BRANCH

# Generate structured PR body via helper script

bun ci-scripts/codelayer-output.ts > "$PR_BODY_FILE"
bun ci-scripts/agent-iteration.ts --command footer \
  --workflow agent-narrow-component-props \
  --memory .github/agent-memory/narrow-component-props.md >> "$PR_BODY_FILE"

git push --set-upstream origin $BRANCH
gh pr create \
  --title "[$(date +%m/%d)] React Component Prop Narrowing" \
  --body-file "$PR_BODY_FILE"

```

### Existing PR Update (/iterate)

```bash

# For iterations, commit to current branch and update in place

git add -A
git commit -m "chore: iterate narrow props agent feedback"
git push origin HEAD:${HEAD_REF}

# Append iteration summary as PR comment

gh pr comment $PR_NUMBER --body-file "$PR_BODY_FILE"

```

In both cases, the workflow uploads raw agent output as a build artifact for debugging:

```yaml
- uses: actions/upload-artifact@v4
  with:
    name: agent-output
    path: agent-output/

```

## Supporting Files in the CI Pipeline

| File | Purpose |
|------|---------|
| [`plugins/narrow-react-prop-types/skills/narrow-react-prop-types/SKILL.md`](https://github.com/humanlayer/skills/blob/main/plugins/narrow-react-prop-types/skills/narrow-react-prop-types/SKILL.md) | Skill documentation with validation commands and usage guidelines |
| [`plugins/narrow-react-prop-types/skills/narrow-react-prop-types/references/agent-narrow-component-props.yml`](https://github.com/humanlayer/skills/blob/main/plugins/narrow-react-prop-types/skills/narrow-react-prop-types/references/agent-narrow-component-props.yml) | **Reference file for CI agent runs** — the GitHub Actions workflow itself |
| [`ci-scripts/agent-iteration.ts`](https://github.com/humanlayer/skills/blob/main/ci-scripts/agent-iteration.ts) | Helper for prompt building and PR footer generation |
| [`ci-scripts/codelayer-output.ts`](https://github.com/humanlayer/skills/blob/main/ci-scripts/codelayer-output.ts) | Parses CodeLayer CLI output into clean markdown |
| [`.github/agent-memory/narrow-component-props.md`](https://github.com/humanlayer/skills/blob/main/.github/agent-memory/narrow-component-props.md) | Persistent memory across agent executions |

## Triggering the Agent Manually

To run the agent outside its schedule, use the GitHub CLI or web interface:

```bash

# Trigger with default scope

gh workflow run agent-narrow-component-props.yml

# Target a specific component directory

gh workflow run agent-narrow-component-props.yml \
  -f target_path="packages/ui-core/src/components/Button"

```

For iterative refinement, post a comment on any agent-generated PR:

```markdown
/iterate

The Button component changes look good, but please also check the TextInput component in the same package.

```

## Summary

- The **reference file for CI agent runs** in `narrow-react-prop-types` is [`plugins/narrow-react-prop-types/skills/narrow-react-prop-types/references/agent-narrow-component-props.yml`](https://github.com/humanlayer/skills/blob/main/plugins/narrow-react-prop-types/skills/narrow-react-prop-types/references/agent-narrow-component-props.yml)
- It orchestrates **three execution modes**: scheduled daily runs, manual dispatch with optional targeting, and `/iterate` comment-driven refinement
- **Memory persistence** via [`.github/agent-memory/narrow-component-props.md`](https://github.com/humanlayer/skills/blob/main/.github/agent-memory/narrow-component-props.md) enables learning across iterations
- The workflow manages **full PR lifecycles**: branch creation, agent execution, output formatting, and automated commenting
- **Artifact retention** preserves raw agent output for debugging and audit purposes

## Frequently Asked Questions

### What permissions does the CI agent workflow require?

The reference file for CI agent runs requests `contents: write`, `pull-requests: write`, and `issues: write` permissions. These allow the workflow to create branches, open and update pull requests, and post comments without requiring a separate bot account.

### How does the agent know whether to create a new PR or update an existing one?

The workflow inspects the trigger type and PR body markers. Scheduled and manual `workflow_dispatch` runs always create new branches and PRs. `issue_comment` triggers check for the hidden `codelayer-agent:workflow` marker in the PR body—if present, the agent commits to the existing branch and posts a comment rather than opening a new PR.

### Can I restrict the agent to specific components or directories?

Yes. When triggering via `workflow_dispatch`, provide the optional `target_path` input. This value injects into the agent prompt as `TARGET_INSTRUCTIONS`, directing the agent to focus its analysis on the specified path rather than scanning the entire repository.