Skip to content

feat(ai): improve imagery workflows and validate asset discovery - #24

Open
RolfMoleman wants to merge 1 commit into
mainfrom
codex/improve-ai-tooling
Open

feat(ai): improve imagery workflows and validate asset discovery#24
RolfMoleman wants to merge 1 commit into
mainfrom
codex/improve-ai-tooling

Conversation

@RolfMoleman

Copy link
Copy Markdown
Collaborator

What and why

Brand imagery requests currently repeat optional questions, default to unlimited iterations, and contain conflicting credit-exhaustion rules. This change makes the skill complete the requested image set with a bounded default, available-provider routing, consistent fallback, image inspection and collision-safe filenames. The Copilot prompt delegates to the skill, and a Codex discovery link exposes the same canonical instructions.

Adds repository guidance and an offline CI gate for asset metadata, local links, discovery drift and regression tests. The documentation explains client discovery and identifies the older image scripts as historical utilities with fixed paths and overwrite assumptions.

Validation

  • 9 offline regression tests passed, including malformed metadata, broken links, relocated organisation-agent links and unexpected existing discovery paths.
  • AI metadata/link/discovery checks, Markdown lint, Python lint and git whitespace checks passed.
  • No-generation scenarios covered subsets, requested variants, missing references/tools, provider exhaustion and org/user filename collisions.

No live image requests were made. Actual model/provider availability and credentials remain client configuration. The existing MegaLinter version update remains in #23.

@RolfMoleman
RolfMoleman marked this pull request as ready for review September 9, 2026 05:19
Copilot AI lite review requested due to automatic review settings September 9, 2026 05:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new offline validator/test harness has a couple of correctness/maintenance issues (stored comments) that should be addressed before relying on it as a CI gate.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the AI brand-imagery skill/prompt to be less interview-heavy and to produce bounded, collision-safe outputs based on actually available image tooling, and adds an offline validation gate to prevent AI asset metadata/link/discovery drift in CI.

Changes:

  • Add offline AI asset validation (tools/validate_ai_assets.py) plus regression tests and a CI workflow to enforce it.
  • Add a sync utility (tools/sync_ai_assets.py) to publish canonical .github/ assets into discovery locations (agents/, .agents/skills/) without overwriting unexpected local content.
  • Refresh the generate-brand-imagery skill and prompt to use bounded defaults, tool availability routing, and clearer failure/stop behavior; document discovery and legacy script caveats.
File summaries
File Description
tools/validate_ai_assets.py Offline validator for frontmatter constraints, local Markdown links, and discovery drift checks.
tools/sync_ai_assets.py Sync tool to publish canonical AI assets into discovery paths while avoiding unsafe overwrites.
tools/requirements-dev.txt Adds PyYAML dependency for offline validation.
tests/test_ai_assets.py Regression tests covering sync/link relocation and validation behaviors.
README.md Updates repository description and points to AI tooling documentation.
docs/AI_TOOLING.md Documents AI asset discovery, validation workflow, and historical script limitations.
AGENTS.md Adds repository guidance for AI asset authoring and validation expectations.
.gitignore Ignores local Python tooling artifacts (pycache, venv, ruff cache).
.github/workflows/validate-ai-assets.yml CI workflow to run offline validation and tests on PRs and main.
.github/skills/generate-brand-imagery/SKILL.md Reworks the skill to be bounded-by-default, tool-aware, and collision-safe.
.github/prompts/generate-brand-imagery.prompt.md Delegates prompt behavior to the skill as the source of truth and updates argument hints/examples.
.github/copilot-instructions.md Adds top-level Copilot instructions pointing to repo guidance and AI tooling docs.
Review details
  • Files reviewed: 12/13 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/test_ai_assets.py
Comment on lines +8 to +12
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "tools"))
from sync_ai_assets import sync
from validate_ai_assets import inspect_asset


Comment on lines +68 to +73
body = re.sub(
r"^(`{3,}|~{3,}).*?^\1\s*$",
"",
content[match.end() :],
flags=re.MULTILINE | re.DOTALL,
)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Discovery syncing can crash on unexpected paths, and valid Markdown forms can bypass or falsely fail link validation.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

tools/validate_ai_assets.py:72

  • This removes only fences that start in column 0 and close with exactly the same marker length. Markdown permits up to three leading spaces and a longer closing fence, so links inside those valid code examples remain in body and can produce false broken-link failures. Use the same stateful fence handling as render_agent().
    body = re.sub(
        r"^(`{3,}|~{3,}).*?^\1\s*$",
        "",
        content[match.end() :],
        flags=re.MULTILINE | re.DOTALL,
  • Files reviewed: 12/13 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment thread tools/sync_ai_assets.py
rendered.append(line)
else:
rendered.append(
re.sub(r"(\[[^\]\n]+\]\()(<[^>\n]+>|[^\s)]+)\)", relocate, line)
Comment thread tools/sync_ai_assets.py
Comment on lines +52 to +56
for directory in (root / "agents", root / ".agents", root / ".agents/skills"):
if directory.is_symlink():
return [
f"Refusing symlinked discovery directory: {directory.relative_to(root)}"
]
content[match.end() :],
flags=re.MULTILINE | re.DOTALL,
)
for target in re.findall(r"(?<!!)\[[^\]\n]+\]\(([^\s)]+)\)", body):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants