ワンクリックで
backend-worker
Backend-focused worker for services, server, client, and infrastructure changes
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Backend-focused worker for services, server, client, and infrastructure changes
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | backend-worker |
| description | Backend-focused worker for services, server, client, and infrastructure changes |
NOTE: Startup and cleanup are handled by worker-base. This skill defines the WORK PROCEDURE.
Use for features that primarily modify:
services.py — data access layer functionsinbox_server.py — API endpoints, server stateinbox_client.py — HTTP client methodscontacts.py — contact resolutionambient_notes.py / ambient_daemon.py — ambient capturetests/NOT for features that require TUI changes (use fullstack-worker instead).
None — this worker operates purely on backend code and tests.
Read the feature description carefully. Understand exactly what behavior is expected, what preconditions must hold, and what verification steps are defined.
Investigate the current code relevant to this feature:
.factory/library/architecture.md for system architecture.factory/services.yaml for commands and servicesWrite failing tests first (RED):
tests/conftest.py and peer test filesFastAPI TestClient (see tests/test_server_endpoints.py)httpx.Client (see tests/test_client.py)uv run pytest path/to/test_file.py -x)Implement to make tests pass (GREEN):
from loguru import logger)Run full validation:
uv run pytest -x -q — all tests passuv run pyright — 0 errorsuv run ruff check . — 0 errorsManual verification (if feature has API endpoints):
uv run python inbox_server.py &lsof -ti :9849 | xargs killVerify preconditions and expected behavior from the feature description:
expectedBehavior — is it satisfied?verificationStepsCommit your changes with a descriptive message.
{
"salientSummary": "Added structured loguru logging to all service functions in services.py, replacing 47 silent except blocks with logger.error/exception calls. All 190 tests pass, pyright 0 errors, ruff 0 errors. Manually triggered a service error and confirmed log output in stderr.",
"whatWasImplemented": "Replaced all bare except:pass and except Exception:return[] patterns in services.py with loguru logging. Added `from loguru import logger` import. Each except block now logs the function name, arguments (sanitized), and full traceback via logger.exception(). Added 3 new tests verifying error logging behavior.",
"whatWasLeftUndone": "",
"verification": {
"commandsRun": [
{"command": "uv run pytest -x -q", "exitCode": 0, "observation": "193 passed in 3.8s"},
{"command": "uv run pyright", "exitCode": 0, "observation": "0 errors, 0 warnings"},
{"command": "uv run ruff check .", "exitCode": 0, "observation": "All checks passed"},
{"command": "curl -sf http://localhost:9849/health", "exitCode": 0, "observation": "200 OK with status healthy"}
],
"interactiveChecks": [
{"action": "Triggered imsg_contacts with invalid DB path", "observed": "loguru error line in stderr: 'imsg_contacts failed: no such table: chat'"}
]
},
"tests": {
"added": [
{
"file": "tests/test_services.py",
"cases": [
{"name": "test_imsg_contacts_logs_error_on_db_failure", "verifies": "loguru.error called when SQLite query fails"},
{"name": "test_gmail_contacts_logs_error_on_api_failure", "verifies": "loguru.error called when Gmail API raises"},
{"name": "test_service_errors_not_silently_swallowed", "verifies": "grep for bare except:pass returns 0 matches in services.py"}
]
}
]
},
"discoveredIssues": []
}