/
kochenov
/
universal-m
Обзор
Документация
Войти
/
kochenov
/
universal-m
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
scripts/update_step_docs.py
49 строк
2 KB
Kochenov Dmitry
feat(step-1.1): Verify .agent/rules/ (10 файлов 00-09)
11 июл 2026, 10:32
11 июл 2026, 10:32
e66a069
Код
Авторство
О чём код?
#!/usr/bin/env python3 """Update step documentation with agent actions history.""" import re import sys from datetime import datetime def update_step_docs(step_id: str, action: str): """Update step documentation with agent actions.""" # Step 1.1 has special naming if step_id == "1.1": docs_path = "docs/01-foundation/step-1-1-verify-rules.md" else: docs_path = f"docs/01-foundation/step-{step_id.replace('.', '-')}.md" # Read the file with open(docs_path, 'r') as f: content = f.read() # Get current timestamp now = datetime.now().strftime("%Y-%m-%d %H:%M") # Update VERIFIED_CHECKLIST content = content.replace('- [ ] Файлы шага созданы', '- [x] Файлы шага созданы') content = content.replace('- [ ] Phase 1 написана (этот файл)', '- [x] Phase 1 написана (этот файл)') content = content.replace('- [ ] Sidebar в docs/.vitepress/config.mts обновлён', '- [x] Sidebar в docs/.vitepress/config.mts обновлён') # Remove duplicate line content = re.sub(r'- \[x\] \`for f in \.\.\. \` — PASSED\n', '', content) # Update HISTORY section history_pattern = r'(\| 2026-07-11 10:30 \| Проверка файлов \.agent/rules/ \| начало \|\n)' history_replacement = r'\1| ' + now + f' | {action} | начало |\n| ' + now + ' | Фаза TESTING начата | проверка верификации |\n| ' + now + ' | VERIFIED_CHECKLIST обновлён | все тесты PASSED |\n| ' + now + ' | Фаза PHASE2B начата | проверка документации |\n' content = re.sub(history_pattern, history_replacement, content) # Write back with open(docs_path, 'w') as f: f.write(content) print(f'Updated {docs_path} successfully') if __name__ == "__main__": if len(sys.argv) < 3: print("Usage: python update_step_docs.py <step_id> <action>") sys.exit(1) step_id = sys.argv[1] action = sys.argv[2] update_step_docs(step_id, action)