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

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, 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 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.


# 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:

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:


# 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:

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:

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)


# 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)


# 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:

- 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 Skill documentation with validation commands and usage guidelines
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 Helper for prompt building and PR footer generation
ci-scripts/codelayer-output.ts Parses CodeLayer CLI output into clean markdown
.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:


# 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:

/iterate

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

Summary

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.

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 →