Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions .github/workflows/daily-skill-optimizer.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions .github/workflows/daily-skill-optimizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ jobs:
exit 1
fi

- name: Stash any uncommitted changes
shell: bash
run: |
git stash --include-untracked || true
Comment on lines +45 to +48
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git stash --include-untracked step happens before the optimizer’s init, but the reported clean-tree failure occurs because init itself modifies the workspace before run executes. If the intent is to keep the tree clean for run (when requireCleanGit is enabled), this stash needs to happen after init and immediately before the run invocation (or init needs to be redirected to a temp worktree) so the changes introduced by init don’t trigger the clean-git guard.

This issue also appears on line 121 of the same file.

Copilot uses AI. Check for mistakes.

- name: Run skill-optimizer
id: run_skill_optimizer
shell: bash
Expand All @@ -68,8 +73,8 @@ jobs:
"models": [
"openrouter/anthropic/claude-sonnet-4.6"
],
"maxTasks": 10,
"maxIterations": 1
"maxTasks": 20,
"maxIterations": 3
}
EOF

Expand Down Expand Up @@ -113,6 +118,12 @@ jobs:
echo "run_mode=$RUN_MODE" >> "$GITHUB_OUTPUT"
echo "run_status=$RUN_STATUS" >> "$GITHUB_OUTPUT"

- name: Restore stashed changes
if: always()
shell: bash
run: |
git stash pop || true

- name: Upload skill-optimizer artifact
if: always()
uses: actions/upload-artifact@v7.0.1
Expand Down
5 changes: 3 additions & 2 deletions .skill-optimizer/skill-optimizer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"timeout": 240000,
"taskGeneration": {
"enabled": true,
"maxTasks": 10,
"maxTasks": 20,
"outputDir": "."
},
"models": [
Expand All @@ -32,6 +32,7 @@
"model": "openrouter/anthropic/claude-sonnet-4.6",
"allowedPaths": ["SKILL.md"],
"validation": [],
"maxIterations": 1
"maxIterations": 3,
"requireCleanGit": false
}
}
12 changes: 12 additions & 0 deletions .skill-optimizer/task-ansi-escape-prevention.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "ansi-escape-prevention",
"input": "I'm editing a compiled workflow YAML file in .github/workflows/ and some terminal output I pasted seems to have broken the YAML parser. How do I avoid ANSI escape codes in workflow YAML files, and how do I check for them?",
"ideal": "ANSI escape codes (e.g. \\x1b[31m, \\x1b[0m) are terminal color codes that break YAML parsing. To avoid them: (1) never copy-paste from colored terminal output into YAML files; use --no-color flags or pipe through `| cat` to strip colors before saving; (2) run `make recompile` to regenerate clean .lock.yml files from .md sources—the workflow compiler automatically strips ANSI codes during compilation via stringutil.StripANSI(); (3) detect existing ANSI codes with: `find .github/workflows -name '*.yml' -o -name '*.yaml' | xargs grep -P '\\x1b\\[[0-9;]*[a-zA-Z]'`; (4) after fixing the source .md file, always run `make recompile` rather than hand-editing .lock.yml files.",
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Phrasing nit: piping through | cat doesn’t actually strip ANSI escape sequences; it just forces non-TTY output, which often disables auto-color for commands that honor it. To avoid misleading guidance in the task’s ideal answer, consider rewording this to “force non-TTY output to disable auto-color” (or suggest an explicit ANSI-stripping filter if you truly mean stripping).

Suggested change
"ideal": "ANSI escape codes (e.g. \\x1b[31m, \\x1b[0m) are terminal color codes that break YAML parsing. To avoid them: (1) never copy-paste from colored terminal output into YAML files; use --no-color flags or pipe through `| cat` to strip colors before saving; (2) run `make recompile` to regenerate clean .lock.yml files from .md sources—the workflow compiler automatically strips ANSI codes during compilation via stringutil.StripANSI(); (3) detect existing ANSI codes with: `find .github/workflows -name '*.yml' -o -name '*.yaml' | xargs grep -P '\\x1b\\[[0-9;]*[a-zA-Z]'`; (4) after fixing the source .md file, always run `make recompile` rather than hand-editing .lock.yml files.",
"ideal": "ANSI escape codes (e.g. \\x1b[31m, \\x1b[0m) are terminal color codes that break YAML parsing. To avoid them: (1) never copy-paste from colored terminal output into YAML files; use --no-color flags or pipe through `| cat` to force non-TTY output and often disable auto-color before saving; (2) run `make recompile` to regenerate clean .lock.yml files from .md sources—the workflow compiler automatically strips ANSI codes during compilation via stringutil.StripANSI(); (3) detect existing ANSI codes with: `find .github/workflows -name '*.yml' -o -name '*.yaml' | xargs grep -P '\\x1b\\[[0-9;]*[a-zA-Z]'`; (4) after fixing the source .md file, always run `make recompile` rather than hand-editing .lock.yml files.",

Copilot uses AI. Check for mistakes.
"criteria": [
"Mentions that ANSI escape codes break YAML parsing",
"Recommends using --no-color or piping through `| cat` when generating terminal output",
"Mentions `make recompile` to regenerate clean workflow files",
"Notes that the compiler automatically strips ANSI codes",
"Provides a command to detect ANSI codes in YAML files"
]
}
12 changes: 12 additions & 0 deletions .skill-optimizer/task-sanitized-outputs-migration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "sanitized-outputs-migration",
"input": "I have a workflow that uses `${{ needs.activation.outputs.text }}` and `${{ needs.activation.outputs.title }}` in the agent prompt to get the issue body and title. I'm seeing a deprecation warning during compilation. What should I change, and why?",
"ideal": "Replace `needs.activation.outputs.text`, `needs.activation.outputs.title`, and `needs.activation.outputs.body` with `steps.sanitized.outputs.text`, `steps.sanitized.outputs.title`, and `steps.sanitized.outputs.body` respectively. The reason: the agent prompt is generated inside the activation job itself, and a job cannot reference its own needs outputs via `needs.activation.outputs.*` in GitHub Actions. The `sanitized` step within the activation job computes sanitized versions of the triggering content and exposes them as `steps.sanitized.outputs.*`. The compiler still accepts the old form and auto-rewrites it (emitting a deprecation warning), but you should use `steps.sanitized.outputs.*` directly in all new and updated workflows. Note: only `text`, `title`, and `body` are affected—continue using `needs.activation.outputs.*` for other outputs like `comment_id`, `comment_repo`, and `slash_command` in downstream jobs.",
"criteria": [
"Identifies the correct replacement: steps.sanitized.outputs.text/title/body",
"Explains why needs.activation.outputs.* doesn't work inside the activation job",
"Mentions that the compiler auto-rewrites the old form with a deprecation warning",
"Notes that only text, title, body are affected (not comment_id, slash_command, etc.)",
"Clarifies that needs.activation.outputs.* still works in downstream jobs"
]
}
12 changes: 12 additions & 0 deletions .skill-optimizer/task-skill-optimizer-clean-git.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"id": "skill-optimizer-clean-git",
"input": "Our daily skill-optimizer CI job keeps failing with the error: `target.repoPath: target repo has uncommitted changes (optimize.requireCleanGit is enabled)`. The init step runs fine but the run step fails every time. How should I fix this so the optimizer can run successfully in CI?",
"ideal": "There are two complementary fixes: (1) Add requireCleanGit set to false in the optimize section of .skill-optimizer/skill-optimizer.json — this disables the clean-git guard so the optimizer can run even when the workspace has uncommitted files (e.g. from a previous make recompile or init step that modifies config files). (2) In the workflow YAML, add a git stash --include-untracked step before invoking the optimizer and a corresponding git stash pop step (with if: always()) after the run to restore any stashed changes. Using requireCleanGit: false is the simplest fix for CI environments where the checkout is ephemeral; adding the stash step is a belt-and-suspenders approach that also works if the flag is not available in your version of the tool.",
"criteria": [
"Identifies setting requireCleanGit: false in .skill-optimizer/skill-optimizer.json as a fix",
"Mentions the optimize section of the config file",
"Suggests git stash --include-untracked before the optimizer run",
"Mentions git stash pop (with always() condition) to restore changes afterward",
Comment on lines +4 to +9
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the scenario described (init modifies the workspace, then run fails due to a dirty tree), “stash before invoking the optimizer” won’t keep the tree clean for run because init will re-introduce changes after the stash. If you want the stash approach to address the clean-git guard, the guidance should indicate stashing after init and immediately before run (or running init in a separate worktree/temp clone), then restoring afterward.

Suggested change
"ideal": "There are two complementary fixes: (1) Add requireCleanGit set to false in the optimize section of .skill-optimizer/skill-optimizer.json — this disables the clean-git guard so the optimizer can run even when the workspace has uncommitted files (e.g. from a previous make recompile or init step that modifies config files). (2) In the workflow YAML, add a git stash --include-untracked step before invoking the optimizer and a corresponding git stash pop step (with if: always()) after the run to restore any stashed changes. Using requireCleanGit: false is the simplest fix for CI environments where the checkout is ephemeral; adding the stash step is a belt-and-suspenders approach that also works if the flag is not available in your version of the tool.",
"criteria": [
"Identifies setting requireCleanGit: false in .skill-optimizer/skill-optimizer.json as a fix",
"Mentions the optimize section of the config file",
"Suggests git stash --include-untracked before the optimizer run",
"Mentions git stash pop (with always() condition) to restore changes afterward",
"ideal": "There are two complementary fixes: (1) Add requireCleanGit set to false in the optimize section of .skill-optimizer/skill-optimizer.json — this disables the clean-git guard so the optimizer can run even when the workspace has uncommitted files (e.g. from a previous make recompile or an init step that modifies config files). (2) If you want a stash-based workaround in the workflow YAML, do not stash before init; instead, run init first, then add a git stash --include-untracked step immediately before the optimizer run step, and a corresponding git stash pop step (with if: always()) afterward to restore any stashed changes. An alternative is to run init in a separate worktree or temporary clone. Using requireCleanGit: false is the simplest fix for CI environments where the checkout is ephemeral; the post-init stash approach is a belt-and-suspenders option if the flag is not available in your version of the tool.",
"criteria": [
"Identifies setting requireCleanGit: false in .skill-optimizer/skill-optimizer.json as a fix",
"Mentions the optimize section of the config file",
"Suggests git stash --include-untracked after init and immediately before the optimizer run",
"Mentions git stash pop (with always() condition) afterward to restore changes",

Copilot uses AI. Check for mistakes.
"Explains that uncommitted changes can come from init or recompile steps"
]
}
Loading