rpa-bot-handoff: one 54-line SKILL.md, no reference or template files
The skill is now one SKILL.md (54 lines) with the SOP shape inline, plus templates/to_docx.py for the Word and PDF. Removed: the template, the MEK reference example and the skill README. The converter's selfcheck uses a built-in sample. Tests now check the skill is that one short file, has the 6 don't-miss checks, and its SOP shape has the 5 sections and To/CC lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
36e621b153
commit
b35796e1a5
8 files changed
+89
-247
No files matched your search
@@ -119,16 +119,50 @@ def to_pdf(docx_path):
|
||||
return (pdf if pdf.exists() else None), pages
|
||||
|
||||
|
||||
SAMPLE = """# Sample Bot Handover SOP
|
||||
|
||||
Version 1.0 · Problems: email dev@example.com, CC manager@example.com (section 5)
|
||||
|
||||
## 1. How to run
|
||||
|
||||
1. Open **Sample Bot** and click **Run**.
|
||||
|
||||
## 2. What you see while it runs
|
||||
|
||||
| Where on the screen | What it shows |
|
||||
|---|---|
|
||||
| Status | "Running…" then "Finished" |
|
||||
|
||||
## 3. Result
|
||||
|
||||
| Status | Meaning | What you do |
|
||||
|---|---|---|
|
||||
| Done | Posted | Nothing |
|
||||
|
||||
## 4. When something goes wrong
|
||||
|
||||
| ID | Message you see | What it means | What you do |
|
||||
|---|---|---|---|
|
||||
| E01 | "Couldn't open *Item*" | The app was slow | Run again |
|
||||
|
||||
## 5. Email us
|
||||
|
||||
```
|
||||
To: dev@example.com
|
||||
CC: manager@example.com
|
||||
```
|
||||
"""
|
||||
|
||||
|
||||
def selfcheck():
|
||||
example = Path(__file__).parent / "reference" / "mek-charge-reconciliation.md"
|
||||
sop = "# " + example.read_text(encoding="utf-8").split("\n---\n", 1)[1].split("\n# ", 1)[1]
|
||||
sop = SAMPLE
|
||||
out = Path(tempfile.mkdtemp()) / "HANDOVER-SOP.docx"
|
||||
convert(sop, out)
|
||||
doc = Document(out)
|
||||
heads = [p.text for p in doc.paragraphs if p.style.name.startswith("Heading")]
|
||||
assert doc.paragraphs[0].text.endswith("Handover SOP"), doc.paragraphs[0].text
|
||||
assert [h.split(".")[0] for h in heads if h[:1].isdigit()] == [str(n) for n in range(1, 6)], heads
|
||||
assert len(doc.tables) >= 4, len(doc.tables)
|
||||
assert len(doc.tables) == 3, len(doc.tables)
|
||||
assert doc.tables[0].cell(0, 0).text == "Where on the screen", doc.tables[0].cell(0, 0).text
|
||||
assert not any("**" in p.text or "|---" in p.text for p in doc.paragraphs)
|
||||
assert words(sop) <= MAX_WORDS, words(sop)
|
||||
|
||||
Reference in new issue
Block a user