.agents/skills/create-repo-agent/references/workflow-blueprint.md
Use this blueprint when implementing or changing a scheduled/manual repo agent in .github/workflows/**.
name: explicit maintenance task name.on.schedule: use a predictable low-noise cadence.on.workflow_dispatch.inputs: keep inputs small and validate every input before interpolation into agent args.permissions: default to contents: read.concurrency: one stable group per agent, usually cancel-in-progress: true.env: branch names and PR titles only; do not put secrets in top-level env.The audit job is the only job that invokes the LLM agent.
if: github.repository == 'langfuse/langfuse' for repo-owned automations.timeout-minutes.actions/checkout with persist-credentials: false and the minimum required fetch-depth.workflow_dispatch inputs before they are used in prompts or CLI args.--check commands in a clean Actions checkout.${{ github.token }} to the LLM action.--no-session-persistence unless session reuse is required and reviewed.--allowedTools list.type: choice for model names, modes, environments, or other enumerations.disabled, no_changes, and mock_allowlisted_diff. Avoid boolean-like YAML tokens such as off, on, yes, no, true, and false; GitHub may parse or render them as booleans. Dry runs must skip the LLM action and must not publish a PR.Include these sections in the prompt:
You are running Langfuse's scheduled <task> audit.
Read and follow:
- <domain skill>
- <domain references>
Allowed edit surface:
- <exact file>
- <restricted glob>
Task:
1. <business audit goal>
2. Make only surgical edits with official evidence.
3. Report uncertainty without changing code.
4. Update approved skill references when durable learnings are discovered.
5. Optionally update this workflow only for future prompt/tool/domain/validation improvements.
6. Run deterministic validation before finishing.
Hard constraints:
- Do not change generated files.
- Do not change package manager files.
- Do not run git push or create a PR.
- Do not add broad wildcard behavior.
- Preserve security invariants for workflow self-improvement.
Final response:
- No diff: report no changes and unresolved findings.
- Diff: list changed business objects, source URLs, calculations, self-improvements, and validation commands.
Tailor the business rules to the domain skill. Do not leave vague permissions such as "update relevant files".
Start with no shell or network tools, then add only what the task requires:
Read paths for source files, skill docs, and the workflow if self-improvement is enabled.Edit paths for mutable files.Write only for approved new files under a narrow path, such as skill reference markdown files.WebFetch for official provider documentation and pricing pages.Do not add broad shell, package-manager, GitHub CLI, git write, curl/wget, or interpreter access to the LLM step.
After the LLM step:
mapfile -t changed_files < <(
{
git diff --name-only
git ls-files --others --exclude-standard
} | sort -u
)
Then:
git diff --check -- "${changed_files[@]}".Prepare the PR artifact inside the audit job only after diff validation:
changed_files.git diff --check.changed_files.git diff --cached --name-only against the allowlist.git show ":path".git diff --cached --check.git -c core.hooksPath=/dev/null commit --no-verify.The publish job owns GitHub writes:
GH_ACCESS_TOKEN or another reviewed bot secret.main.|| true.The publish job must not run the LLM or process new untrusted web content.
If self-improvement is enabled:
Read and Edit tools for that workflow file.workflowUpdates.Reasonable self-improvements:
Do not use self-improvement for:
Use dry-run mode to debug the workflow machinery around an agent without invoking the model:
workflow_dispatch choice input with a YAML-safe disabled value as the default.if: <dry-run-mode> == 'off'.