You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 88fe103
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .agents/skills/python-structured-logging/SKILL.md
+15-8Lines changed: 15 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,15 @@ description: Review or improve Python logging with structlog, stdlib logging, or
7
7
8
8
Make logs useful operational events while preserving the user's scope and project contracts.
9
9
10
+
## Workflow
11
+
12
+
1. Determine whether the request is a review, a local logging change, or integration work. Review requests produce findings without edits.
13
+
2. Trace the affected logging path: its API, formatter/processors, event consumers, and failure owner as relevant. For a local change, stop when you can identify where the changed event renders and which contracts it touches; record unavailable configuration as an assumption.
14
+
3. Read the matching resources below, perform the requested work, and verify the applicable completion criteria.
15
+
10
16
## Scope and contracts
11
17
12
-
- Review requests need findings with locations and concrete effects, not edits.
13
-
- Inspect the logger API, formatter/processors, event conventions, and failure ownership. Keep the stack and wrappers; migration requires authorization.
18
+
- Keep the stack and wrappers; migration requires authorization.
14
19
- Preserve business behavior, signatures, exception propagation, and retry decisions.
15
20
- Event names and fields may feed alerts, dashboards, and queries. Preserve existing contracts, including dotted names. Before an authorized rename, inspect available consumers and explain their updates; report external consumers you cannot verify.
16
21
- With no existing convention, use stable `snake_case` events such as `invoice_processed` and put variable values in fields. Follow existing field names; give new units explicit keys such as `duration_ms`.
@@ -26,7 +31,7 @@ Read the matching example pair for substantial refactoring, integration setup, o
- Changing formatters/processors, configuring runtime logging, diagnosing missing fields, serialization, or duplicate handlers, or checking sensitive data across output paths: [output pipeline](references/output-pipeline.md).
30
35
- Working with cross-module or concurrent context or cleanup: [context lifecycle](references/context-lifecycle.md).
31
36
- Resolving failure ownership or sanitizing exception output: [exceptions and sensitive data](references/exceptions-and-sensitive-data.md).
32
37
@@ -40,10 +45,12 @@ Read only the relevant reference when:
40
45
41
46
## Verify
42
47
43
-
Use focused tests/output capture proportional to the change, through the complete configured runtime output boundary (see [output pipeline](references/output-pipeline.md)):
48
+
Choose checks for the affected behavior; combine criteria when a task spans branches:
44
49
45
-
- Contracts and application behavior preserved; fields survive formatting without API errors.
46
-
- One appropriate failure record, with traceback when needed; no sensitive values in fields, messages, or rendered exceptions.
47
-
- Request/job context isolated and cleaned up.
50
+
-**Review:** each finding has a location, concrete effect, and supporting evidence. Distinguish observed defects from unverified risks. Static review is sufficient when it establishes the finding; report runtime assumptions without requiring application startup.
51
+
-**Local change:** capture the changed event through the configured formatter, or a representative formatter when runtime configuration is unavailable. Confirm added fields survive and affected event contracts and application behavior remain intact. Keep checks scoped to the changed path.
52
+
-**Pipeline or sensitive-output change:** capture the complete configured runtime output boundary described in [output pipeline](references/output-pipeline.md), including failure and fallback paths. Verify configured output format and absence of sensitive values in fields, messages, and rendered exceptions.
53
+
-**Failure ownership change:** exercise the affected failure path; verify one appropriate failure record, traceback when needed, and unchanged propagation/retry behavior.
54
+
-**Context change:** exercise overlapping operations and cleanup on success and failure; check parent-context restoration for nested scopes.
Report checks performed, their observed results, and unverified pipeline assumptions. A representative formatter check does not establish full runtime safety.
Copy file name to clipboardExpand all lines: .agents/skills/python-structured-logging/references/context-lifecycle.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,3 +7,5 @@ For a structlog application already using contextvars, check that `merge_context
7
7
Test two overlapping requests with distinct IDs and a subsequent operation with no ID. Their outputs must not share identifiers. Thread/task boundaries and hybrid sync/async frameworks may require explicit propagation; do not assume every execution context shares the same values.
8
8
9
9
For stdlib, retain the existing adapter, filter, or record factory. Check the supported Python version and adapter behavior before relying on per-call `extra` merging.
Copy file name to clipboardExpand all lines: .agents/skills/python-structured-logging/references/exceptions-and-sensitive-data.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,6 @@
2
2
3
3
Choose the owner based on the call chain: a request boundary, worker, or command may already record failures. Adding another exception log below it can duplicate alerts. If a lower layer owns the only failure record and propagates the exception, document that its caller must not log it again.
4
4
5
-
`logger.exception` normally renders the exception message too. Allowlisting structured fields alone does not sanitize credentials embedded in a URL, exception text, or captured locals. Exercise the configured sanitizer with synthetic sensitive values and inspect its final output. Never use real secrets as fixtures.
5
+
`logger.exception` normally renders the exception message too. Allowlisting structured fields alone does not sanitize credentials embedded in a URL, exception text, or captured locals. Exercise the configured sanitizer with synthetic sensitive values and inspect its final output. Never use real secrets as fixtures. When changing sanitization or checking safety across output paths, follow [output pipeline](output-pipeline.md) to cover runtime loggers and formatter fallback as well as application records.
6
6
7
7
The paired examples use a non-retryable negative amount to illustrate preserved behavior. Both versions raise the same exception for the same input. The good version changes logging only; it does not add retry logic or invent payment metadata.
Copy file name to clipboardExpand all lines: .agents/skills/python-structured-logging/references/output-pipeline.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,3 +9,5 @@ Capture the final rendered output as well as records. Check JSON decoding where
9
9
At the application's configuration boundary, include framework/server/access/error/lifecycle loggers and the actual stdout/stderr or collector path, not just the application logger. Exercise an unexpected failure through that runtime: a safe application formatter is insufficient if another output path can emit raw data. Keep reusable modules free of global logging configuration.
10
10
11
11
Formatter failure is part of this safety boundary. Probe non-finite numbers, unsupported objects and cyclic structured values through the public logging API, including stdlib `handleError`/diagnostic fallback. Use bounded safe normalization or a safe structured fallback: logging must not raise into application code, disclose the original exception/source through fallback, or emit invalid JSON when JSON is the output contract. Capture both streams and verify that a subsequent event still emits; silent record loss is not a successful fallback.
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ The skill inspects the logging stack already in use before changing anything. If
56
56
57
57
- Main skill: [`plugins/python-structured-logging/skills/python-structured-logging/SKILL.md`](plugins/python-structured-logging/skills/python-structured-logging/SKILL.md)
58
58
- Examples: [`examples/structlog`](plugins/python-structured-logging/skills/python-structured-logging/examples/structlog) and [`examples/stdlib`](plugins/python-structured-logging/skills/python-structured-logging/examples/stdlib)
-References: [output pipeline](plugins/python-structured-logging/skills/python-structured-logging/references/output-pipeline.md), [context lifecycle](plugins/python-structured-logging/skills/python-structured-logging/references/context-lifecycle.md), and [exceptions and sensitive data](plugins/python-structured-logging/skills/python-structured-logging/references/exceptions-and-sensitive-data.md)
Copy file name to clipboardExpand all lines: plugins/python-structured-logging/skills/python-structured-logging/SKILL.md
+15-8Lines changed: 15 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,15 @@ description: Review or improve Python logging with structlog, stdlib logging, or
7
7
8
8
Make logs useful operational events while preserving the user's scope and project contracts.
9
9
10
+
## Workflow
11
+
12
+
1. Determine whether the request is a review, a local logging change, or integration work. Review requests produce findings without edits.
13
+
2. Trace the affected logging path: its API, formatter/processors, event consumers, and failure owner as relevant. For a local change, stop when you can identify where the changed event renders and which contracts it touches; record unavailable configuration as an assumption.
14
+
3. Read the matching resources below, perform the requested work, and verify the applicable completion criteria.
15
+
10
16
## Scope and contracts
11
17
12
-
- Review requests need findings with locations and concrete effects, not edits.
13
-
- Inspect the logger API, formatter/processors, event conventions, and failure ownership. Keep the stack and wrappers; migration requires authorization.
18
+
- Keep the stack and wrappers; migration requires authorization.
14
19
- Preserve business behavior, signatures, exception propagation, and retry decisions.
15
20
- Event names and fields may feed alerts, dashboards, and queries. Preserve existing contracts, including dotted names. Before an authorized rename, inspect available consumers and explain their updates; report external consumers you cannot verify.
16
21
- With no existing convention, use stable `snake_case` events such as `invoice_processed` and put variable values in fields. Follow existing field names; give new units explicit keys such as `duration_ms`.
@@ -26,7 +31,7 @@ Read the matching example pair for substantial refactoring, integration setup, o
- Changing formatters/processors, configuring runtime logging, diagnosing missing fields, serialization, or duplicate handlers, or checking sensitive data across output paths: [output pipeline](references/output-pipeline.md).
30
35
- Working with cross-module or concurrent context or cleanup: [context lifecycle](references/context-lifecycle.md).
31
36
- Resolving failure ownership or sanitizing exception output: [exceptions and sensitive data](references/exceptions-and-sensitive-data.md).
32
37
@@ -40,10 +45,12 @@ Read only the relevant reference when:
40
45
41
46
## Verify
42
47
43
-
Use focused tests/output capture proportional to the change, through the complete configured runtime output boundary (see [output pipeline](references/output-pipeline.md)):
48
+
Choose checks for the affected behavior; combine criteria when a task spans branches:
44
49
45
-
- Contracts and application behavior preserved; fields survive formatting without API errors.
46
-
- One appropriate failure record, with traceback when needed; no sensitive values in fields, messages, or rendered exceptions.
47
-
- Request/job context isolated and cleaned up.
50
+
-**Review:** each finding has a location, concrete effect, and supporting evidence. Distinguish observed defects from unverified risks. Static review is sufficient when it establishes the finding; report runtime assumptions without requiring application startup.
51
+
-**Local change:** capture the changed event through the configured formatter, or a representative formatter when runtime configuration is unavailable. Confirm added fields survive and affected event contracts and application behavior remain intact. Keep checks scoped to the changed path.
52
+
-**Pipeline or sensitive-output change:** capture the complete configured runtime output boundary described in [output pipeline](references/output-pipeline.md), including failure and fallback paths. Verify configured output format and absence of sensitive values in fields, messages, and rendered exceptions.
53
+
-**Failure ownership change:** exercise the affected failure path; verify one appropriate failure record, traceback when needed, and unchanged propagation/retry behavior.
54
+
-**Context change:** exercise overlapping operations and cleanup on success and failure; check parent-context restoration for nested scopes.
Report checks performed, their observed results, and unverified pipeline assumptions. A representative formatter check does not establish full runtime safety.
Copy file name to clipboardExpand all lines: plugins/python-structured-logging/skills/python-structured-logging/references/Python Logging Style Guide.md
Copy file name to clipboardExpand all lines: plugins/python-structured-logging/skills/python-structured-logging/references/context-lifecycle.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,3 +7,5 @@ For a structlog application already using contextvars, check that `merge_context
7
7
Test two overlapping requests with distinct IDs and a subsequent operation with no ID. Their outputs must not share identifiers. Thread/task boundaries and hybrid sync/async frameworks may require explicit propagation; do not assume every execution context shares the same values.
8
8
9
9
For stdlib, retain the existing adapter, filter, or record factory. Check the supported Python version and adapter behavior before relying on per-call `extra` merging.
Copy file name to clipboardExpand all lines: plugins/python-structured-logging/skills/python-structured-logging/references/exceptions-and-sensitive-data.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,6 @@
2
2
3
3
Choose the owner based on the call chain: a request boundary, worker, or command may already record failures. Adding another exception log below it can duplicate alerts. If a lower layer owns the only failure record and propagates the exception, document that its caller must not log it again.
4
4
5
-
`logger.exception` normally renders the exception message too. Allowlisting structured fields alone does not sanitize credentials embedded in a URL, exception text, or captured locals. Exercise the configured sanitizer with synthetic sensitive values and inspect its final output. Never use real secrets as fixtures.
5
+
`logger.exception` normally renders the exception message too. Allowlisting structured fields alone does not sanitize credentials embedded in a URL, exception text, or captured locals. Exercise the configured sanitizer with synthetic sensitive values and inspect its final output. Never use real secrets as fixtures. When changing sanitization or checking safety across output paths, follow [output pipeline](output-pipeline.md) to cover runtime loggers and formatter fallback as well as application records.
6
6
7
7
The paired examples use a non-retryable negative amount to illustrate preserved behavior. Both versions raise the same exception for the same input. The good version changes logging only; it does not add retry logic or invent payment metadata.
0 commit comments