Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
59e26cc
feat(skills): introduce a2ui-remediate-problem skill and embed copyab…
gspencergoog Aug 25, 2026
5ca7f87
feat(audit): automatically inject copyable remediation prompt blocks …
gspencergoog Aug 25, 2026
ef1f52a
feat(audit): add descriptive label above copyable remediation prompt …
gspencergoog Aug 25, 2026
4627a93
refactor(audit): use multi-line f-string for prompt block in create_c…
gspencergoog Aug 25, 2026
7b155e3
feat(skills): prompt developer for change destination and suggest wor…
gspencergoog Aug 25, 2026
a73ae8b
docs(skills): generalize branch and remote handling for forks in reme…
gspencergoog Aug 25, 2026
39352e6
docs(skills): avoid '#' symbol before recommendation indices to preve…
gspencergoog Aug 25, 2026
5786757
docs(skills): recommend branch name without prescribing worktree layo…
gspencergoog Aug 25, 2026
ec80e5c
docs(skills): clarify PR submission and draft options in remediation …
gspencergoog Aug 25, 2026
9bbfb4c
docs(skills): recommend using ask_question tool for user interactions…
gspencergoog Aug 25, 2026
1e7ea52
feat(skills): generalize a2ui-remediate-problem to support any issue …
gspencergoog Aug 25, 2026
da08255
docs(skills): use scripts/fix_format.sh across all languages in remed…
gspencergoog Aug 25, 2026
5c3f9f4
fix(skills): track code block fences and handle missing gh CLI in ext…
gspencergoog Aug 25, 2026
5c362b3
Merge branch 'main' into remediate_problem_skill
gspencergoog Aug 26, 2026
49944e8
Merge branch 'main' into remediate_problem_skill
gspencergoog Aug 27, 2026
b30e8c0
docs(eval): update arXiv URLs to canonical abstract links in DESIGN.md
gspencergoog Aug 27, 2026
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
10 changes: 5 additions & 5 deletions .agents/skills/a2ui-audit/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ fix issues.
4. **Summarize the report**:
- Add a `## Summary` section at the top of the `compliance_report.md` file with a detailed overview of the audit scope and key findings across all audited codebases.
- Add a `## Recommendations` section listing actionable, prioritized follow-up items formatted as a numbered list (e.g. `1. **P0**: ...`). Each numbered item MUST represent a concrete, self-contained remediation task.
- Immediately below the recommendations list, include the mandatory automated remediation callout:
> 🤖 **Automated Remediation**: Comment `/fix <number>` (e.g., `/fix 1`) on this issue to have an agent create a draft PR for that recommendation.

5. **Format and Detail Requirements**:
- **MANDATORY COMPLETE REPOSITORY COVERAGE**: The report MUST include status rows and detailed findings for **ALL 8 production codebases** discovered by `check_compliance.py`. Do NOT truncate, shortcut, or abbreviate the summary tables or detailed findings.
Expand All @@ -49,6 +47,7 @@ fix issues.
```bash
python3 .agents/skills/a2ui-audit/scripts/create_compliance_report.py compliance_report.md --repo a2ui-project/a2ui
```
- The publishing script will create the GitHub issue, automatically inject copyable remediation prompt blocks referencing the newly created issue URL under each recommendation item, and update the issue body.
- Ensure the helper script runs successfully.
- Clean up the temporary file `compliance_report.md` after completion.

Expand All @@ -65,10 +64,11 @@ When compiling `compliance_report.md`, use the following structure:

## Recommendations

1. **[Priority]**: [Clear title and detailed explanation of the fix needed, specifying affected directories or modules.]
2. **[Priority]**: [Clear title and detailed explanation of the fix needed, specifying affected directories or modules.]
1. **[Priority]**: **[Title]**
- [Clear detailed explanation of the fix needed, specifying affected directories or modules.]

> 🤖 **Automated Remediation**: Comment `/fix <number>` (e.g., `/fix 1`) on this issue to have an agent create a draft PR for that recommendation.
2. **[Priority]**: **[Title]**
- [Clear detailed explanation of the fix needed, specifying affected directories or modules.]

## Codebase Blueprint Compliance Audit

Expand Down
99 changes: 0 additions & 99 deletions .agents/skills/a2ui-audit/references/remediate-problem.md

This file was deleted.

123 changes: 121 additions & 2 deletions .agents/skills/a2ui-audit/scripts/create_compliance_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,107 @@

This script parses command-line arguments to locate the compiled markdown report
and post it as a new GitHub issue in the target repository using the `gh` CLI.
It then automatically injects copyable remediation prompt blocks with the newly
created issue URL under each recommendation item and updates the issue body.
"""

from __future__ import annotations

import argparse
import datetime
import os
import re
import subprocess
import sys


def inject_recommendation_prompts(report_content: str, issue_url: str) -> str:
"""Injects copyable agent prompt blocks under each recommendation item."""
lines = report_content.splitlines()
new_lines: list[str] = []
in_recommendations = False
rec_pattern = re.compile(r"^(\d+)\.\s+(.*)")

i = 0
while i < len(lines):
line = lines[i]
stripped = line.strip()
if stripped.startswith("## Recommendations"):
in_recommendations = True
new_lines.append(line)
i += 1
continue
elif in_recommendations and (stripped.startswith("## ") or stripped == "---"):
if stripped.startswith("## "):
in_recommendations = False
new_lines.append(line)
i += 1
continue

if in_recommendations:
match = rec_pattern.match(stripped)
if match:
idx = int(match.group(1))
new_lines.append(line)
i += 1

# Collect subsequent lines belonging to this recommendation
rec_lines: list[str] = []
while i < len(lines):
next_stripped = lines[i].strip()
if (
rec_pattern.match(next_stripped)
or next_stripped.startswith("## ")
or next_stripped == "---"
):
break
# If an existing prompt block or label is found, skip it
if next_stripped.startswith("Copy this prompt"):
i += 1
continue
if next_stripped.startswith("````") or next_stripped.startswith(
"```"
):
fence = (
next_stripped[:4]
if next_stripped.startswith("````")
else next_stripped[:3]
)
i += 1
while i < len(lines) and not lines[i].strip().startswith(fence):
i += 1
if i < len(lines):
i += 1
continue
rec_lines.append(lines[i])
i += 1

while rec_lines and rec_lines[-1].strip() == "":
rec_lines.pop()

new_lines.extend(rec_lines)

prompt_block = f""" Copy this prompt to implement this recommendation:
````markdown
Read the A2UI issue at {issue_url} and use the `a2ui-remediate-problem` skill to implement recommendation {idx} described in the issue's Recommendation section.
````"""
new_lines.append(prompt_block)
new_lines.append("")
continue

new_lines.append(line)
i += 1

return "\n".join(new_lines).rstrip() + "\n"


def main() -> None:
"""Parses arguments and creates a GitHub issue with the compliance report.

Validates that the input report exists, formats the issue title, and invokes
the GitHub CLI (`gh`) to file the issue under the target repository with
the required labels.
the required labels. Then injects copyable prompt blocks with the generated
issue URL and updates the issue body.
"""
parser = argparse.ArgumentParser(
description="Post blueprint compliance report as a GitHub issue."
Expand All @@ -47,6 +133,9 @@ def main() -> None:
print(f"Error: Report file not found at '{report_path}'")
sys.exit(1)

with open(report_path, "r", encoding="utf-8") as f:
original_content = f.read()

today = datetime.date.today().isoformat()
issue_title = f"Weekly A2UI Compliance Report ({today})"

Expand Down Expand Up @@ -87,8 +176,38 @@ def main() -> None:
print(result.stderr)
sys.exit(1)

issue_url = result.stdout.strip()
print("Success: Compliance report issue posted successfully.")
print(result.stdout.strip())
print(issue_url)

# Post-process report to inject recommendation prompt blocks and update issue
enhanced_content = inject_recommendation_prompts(original_content, issue_url)
if enhanced_content != original_content:
with open(report_path, "w", encoding="utf-8") as f:
f.write(enhanced_content)

issue_id = issue_url.rstrip("/").split("/")[-1]
edit_cmd = [
"gh",
"issue",
"edit",
issue_id,
"--body-file",
report_path,
]
if args.repo:
edit_cmd.extend(["--repo", args.repo])

print(f"Updating issue with remediation prompt blocks: {' '.join(edit_cmd)}")
edit_result = subprocess.run(
edit_cmd, capture_output=True, text=True, check=False, env=env
)
if edit_result.returncode != 0:
print(
"Warning: Failed to update issue description with prompt blocks:"
f" {edit_result.stderr}",
file=sys.stderr,
)


if __name__ == "__main__":
Expand Down
Loading
Loading