Dreamers Add Logging
Phased pass to add or improve project logging per logging-standards.md. Audit current state → propose changes → user approval → i…
Claude CodeGeneric
---
description: 'Phased pass to add or improve project logging per logging-standards.md. Audit current state → propose changes → user approval → implement inline → optional Sentinel review. Triggers: /dreamers-add-logging, add logging, improve logging, audit log calls.'
---
Also load at runtime (not inlined — these are templates / project files):
- `~/.claude/dreamers/templates/logging-standards.md` — the binding spec
- `CLAUDE.md` (project, if present) — project-specific logging conventions (logger library, format)
<dreamers-kernel>
# Dreamers Kernel
## Subagent allowlist (HARD RULE)
Do not use any non-Dreamers agent unless explicitly authorized by user. Allowed Dreamers subagents: `sentinel`, `probe`, `hone`, `echo`, `sage`, `bolt`. NEVER `general-purpose`, NEVER `claude`, NEVER any other host-runtime agent.
## Subagent prompt — required content
Every `Agent` invocation MUST include in the prompt:
- **Context** — what this agent is being asked to do and why
- **Prior work** — what was done previously, with absolute paths to any output files
- **What is needed** — specific deliverable
- **Constraints** — hard rules the agent must not violate
- **Definition of Done** — how to know the work is complete
- **Plan file path** — absolute path to the relevant plan file (if applicable)
- **Mandatory line:** `Do NOT call TaskCreate / TaskUpdate / TaskList. The command that invoked you owns its todo.`
All `Agent` calls run synchronously (default) — the call blocks until the agent returns.
## Continuation principle
At every natural pause between phases — where the command has produced a meaningful result and the user could redirect — call `AskUserQuestion` with three choices: `Continue` / `Halt for now` / `Other` (freeform). Never silently advance; never silently stop. On `Halt`, emit a one-line resume command and stop.
## Implementation discipline
- **Plan adherence:** edit only files in the plan's scope. No while-I'm-here cleanup, no unrelated refactors mixed with feature work.
- **No spec-arguing comments:** never add a code comment that argues the spec permits a pattern.
- **Branch identity check:** before the first edit, `git log --oneline -3`. Confirm the branch and recent commits match the expected feature. If not, halt and surface.
- **No dependency installs without permission.** Don't run `npm install`, `pip install`, etc. without explicit user approval.
- **Type-check before declaring implementation done.** Run the project's type-check command from `CLAUDE.md` and fix errors before moving on.
## Commit trailer
Every commit body includes:
Co-authored-by: The Dreamers System
</dreamers-kernel>
$ARGUMENTS
---
## Todo list
At skill entry, declare via `TaskCreate`:
- [ ] Phase 1 — audit current logging state
- [ ] Phase 2 — proposal + user approval
- [ ] Phase 3 — implement approved changes
- [ ] Phase 4 — optional Sentinel review
- [ ] Phase 5 — commit
Mark each item `in_progress` when starting, `completed` when done. Never batch completions at the end.
---
## Phase 1 — Audit
Scope: project source root by default; `--scope <path>` to restrict.
Walk the scope and identify:
- Functions with no logging where DEBUG entry/exit would help.
- Branches without log statements that affect business outcomes.
- ERROR-level logs missing stack traces.
- INFO logs that include secrets, PII, or full request bodies (NEVER-LOG violations — high priority).
- DEBUG logs in high-frequency loops without `// high-freq` annotation.
- Log calls using the wrong level (e.g., ERROR for recoverable issues; INFO for incoming requests with full bodies).
Produce an audit summary in chat: file path → issues found.
## Phase 2 — Proposal + user approval
Present the proposed changes in chat:
- List of files to modify, with one-line summary per file.
- Net adds vs net changes (e.g., "12 new DEBUG calls, 3 ERROR-level fixes, 2 NEVER-LOG violations to remove").
- Any logger-library / format conventions detected from existing code (so additions are consistent).
Call `AskUserQuestion` with `["Approved — apply changes", "Halt for now", "Other"]`. Freeform corrections go through Other.
- Approved → proceed to Phase 3.
- Halt for now → output "Audit complete. No changes applied. Resume by re-invoking `/dreamers-add-logging`." and stop.
- Corrections → revise proposal; re-present. Loop until approved.
## Phase 3 — Implement
Apply the approved changes inline. Stage with `git add` as you go. Follow `dreamers-kernel.md` implementation discipline — only edit files in scope; no while-I'm-here cleanup.
Spawn Bolt (`subagent_type: "bolt"`) to run the project's type-check command after edits. Fix any type errors inline based on Bolt's report.
## Phase 4 — Optional Sentinel review
Call `AskUserQuestion` with `["Yes — review before commit", "No — skip review", "Other"]`.
- Yes → invoke `subagent_type: "sentinel"` with the changed-files scope. Sentinel reviews under correctness/security/maintainability lenses; comment-rules + logging-standards violations surface here. Apply findings inline.
- No → proceed to commit.
## Phase 5 — Commit
`git status` to confirm staged content. Commit message: `chore: improve logging per logging-standards.md` (or appropriate). Do NOT push (user pushes when ready, or invokes `/dreamers-pr` to push + open the PR).
Maintain Dreamers Add Logging?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[Dreamers Add Logging on getagentictools](https://getagentictools.com/loops/mrstorrs-dreamers-kernel?ref=badge)