Add an empty appendix placeholder at the end of *skill* (idempotent). Mirrors ``inject_empty_slow_update_field``: called once at skill init so the protected region exists before any note is written.
(skill: str)
| 87 | |
| 88 | |
| 89 | def inject_empty_appendix_field(skill: str) -> str: |
| 90 | """Add an empty appendix placeholder at the end of *skill* (idempotent). |
| 91 | |
| 92 | Mirrors ``inject_empty_slow_update_field``: called once at skill init so the |
| 93 | protected region exists before any note is written. |
| 94 | """ |
| 95 | if has_appendix_field(skill): |
| 96 | return skill |
| 97 | block = f"\n\n{APPENDIX_START}\n{APPENDIX_HEADING}\n{APPENDIX_END}\n" |
| 98 | return skill.rstrip() + block |
| 99 | |
| 100 | |
| 101 | def extract_appendix_notes(skill: str) -> list[str]: |