@abhishek944/pi-review 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +85 -2
  3. package/THIRD_PARTY_NOTICES.md +32 -0
  4. package/package.json +40 -4
  5. package/skills/agent-review/SKILL.md +62 -0
  6. package/skills/awesome-logging-standards/LICENSE +21 -0
  7. package/skills/awesome-logging-standards/PROVENANCE.md +17 -0
  8. package/skills/awesome-logging-standards/SKILL.md +129 -0
  9. package/skills/codebase-design/LICENSE +21 -0
  10. package/skills/codebase-design/SKILL.md +85 -0
  11. package/skills/no-arbitrary-limits/SKILL.md +45 -0
  12. package/skills/no-unit-tests/SKILL.md +27 -0
  13. package/skills/security-audit/AI-AND-LLM.md +83 -0
  14. package/skills/security-audit/ATTACK-CLASSES.md +130 -0
  15. package/skills/security-audit/CLIENT-SIDE.md +83 -0
  16. package/skills/security-audit/CLOUD-AND-DEPLOYMENT.md +86 -0
  17. package/skills/security-audit/DATA-ISOLATION-AND-LIFECYCLE.md +84 -0
  18. package/skills/security-audit/DESKTOP-MOBILE-AND-LOCAL-IPC.md +89 -0
  19. package/skills/security-audit/HUNTING.md +252 -0
  20. package/skills/security-audit/LICENSE +21 -0
  21. package/skills/security-audit/MEMORY-SAFETY-AND-BINARY.md +101 -0
  22. package/skills/security-audit/PROTOCOLS-RPC-AND-MESSAGING.md +81 -0
  23. package/skills/security-audit/PROVENANCE.md +15 -0
  24. package/skills/security-audit/RECONNAISSANCE.md +156 -0
  25. package/skills/security-audit/RESOURCE-EXHAUSTION-AND-AVAILABILITY.md +78 -0
  26. package/skills/security-audit/SKILL.md +200 -0
  27. package/skills/security-audit/SUPPLY-CHAIN-AND-RELEASE.md +73 -0
  28. package/skills/security-audit/VALIDATION-AND-REPORTING.md +186 -0
  29. package/skills/security-audit/WEB-PROTOCOL-AND-AUTH.md +105 -0
  30. package/skills/security-audit/report-schema.json +461 -0
  31. package/skills/security-audit/validate-coverage-ledger.cjs +890 -0
  32. package/skills/security-audit/validate-findings.cjs +773 -0
  33. package/skills/ui-ux-qol/SKILL.md +70 -0
  34. package/skills/ui-ux-qol/references/state-and-loops.md +84 -0
  35. package/skills/ui-ux-testing/SKILL.md +403 -0
  36. package/skills/ui-ux-testing/references/contrast.md +28 -0
  37. package/skills/ui-ux-testing/references/frame-geometry.md +29 -0
  38. package/skills/ui-ux-testing/references/visibility.md +69 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Abhishek Tatikella
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,86 @@
1
- # Temporary Holding Version
1
+ # pi-review
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Eight skill-only Pi workflows for reviewing changes, designing modules, auditing security, auditing
4
+ UI/UX, finding small quality-of-life improvements, applying authorized UI fixes or flags and keeping
5
+ implementation scope honest:
6
+
7
+ | Skill | Purpose |
8
+ | --- | --- |
9
+ | `agent-review` | Runs an independent reviewer on repository changes when risk, complexity, uncertainty, or an explicit user request justifies it. |
10
+ | `codebase-design` | Guides module responsibilities, explicit interfaces, justified abstractions, and version-aware TypeScript/Effect contracts. |
11
+ | `security-audit` | Provides Cloudflare's source-first security guidance and evidence-led audit workflow with independent validation and structured reports. |
12
+ | `awesome-logging-standards` | Guides structured application and error logs, redaction, request summaries, and TypeScript/Node.js or Effect integration. |
13
+ | `no-unit-tests` | Prevents unit-test creation, editing or execution unless the user explicitly asks for unit tests. |
14
+ | `no-arbitrary-limits` | Prevents unrequested capacity limits and implementation-time questions about optional limits, and reports optional controls after completion. |
15
+ | `ui-ux-testing` | Runs a read-only UI/UX audit with parallel auditors and reports verified defects, evidence, rendered contrast and outer-frame findings, suggested fixes and a fix class per finding. In its authorized post-implementation fix-or-flag mode, it auto-fixes only clear in-scope defects or presents user-specified decisions through `ui-ux-grill-me` as each branch becomes grounded, with an independent runtime recheck for every fix. Review mode makes no production edits. |
16
+ | `ui-ux-qol` | Repeats small, evidence-backed UI/UX quality-of-life discovery for a named surface. It deduplicates candidates in a package-owned repository ledger, stays read-only for production UI and provider calls, and hands human-selected branches to `ui-ux-grill-me` and `implement`. |
17
+
18
+ This package contains only skill instructions and their bundled references, companion documents,
19
+ schema, validators and licenses. It registers no extension code or custom tools.
20
+
21
+ ## Install
22
+
23
+ Requires Pi 1.4.0 or newer and Node.js 22 or newer. `security-audit` full audits additionally
24
+ require independent agents and an OS-enforced sandbox before executing target code.
25
+ `ui-ux-testing` audits require an accessible application and authorized browser or desktop
26
+ automation; review mode reports findings without editing production source. Its fix-or-flag mode
27
+ runs inside an authorized implementation task and adds no permission of its own; flag mode
28
+ additionally needs `ui-ux-grill-me`, which requires `pi-decisions`, `pi-loop-monitor` and browser
29
+ automation, plus Herdr Core and continuous monitoring for delegated owners. Flag mode presents each
30
+ decision branch as soon as that branch's evidence is verified and its dependencies are resolved,
31
+ shares the returned decision URL immediately, and keeps the remaining read-only audit running
32
+ rather than holding choices until a synthesis or final report.
33
+
34
+ `ui-ux-qol` requires the same read-only target access and uses `ui-conventions` and `ui-copy` as
35
+ evidence sources. Presenting candidates needs `ui-ux-grill-me`, `pi-decisions`, and
36
+ `pi-loop-monitor`. Recurring discovery is owned by the parent session through `pi-loop-monitor`; the
37
+ skill never creates loops or uses a scheduler. Its ledger lives at
38
+ `var/pi-review/ui-ux-qol/state.json` in the target repository.
39
+
40
+ From an Astack checkout:
41
+
42
+ ```sh
43
+ pi install ./packages/pi-review
44
+ ```
45
+
46
+ Or use the package directory's absolute path:
47
+
48
+ ```sh
49
+ pi install /path/to/astack/packages/pi-review
50
+ ```
51
+
52
+ Run `/reload` in an open Pi session, or restart Pi, after installing or changing packages. Confirm
53
+ the package is configured with `pi list`.
54
+
55
+ The package is not published on npm. Publish manually from this directory when a release is
56
+ intended.
57
+
58
+ ### Migrating from the shared skills repository
59
+
60
+ All seven original migrated skills were previously owned by the `pi-herdr-skills` shared skill repository and
61
+ its global installer. This package is now their source of truth. `ui-ux-testing` keeps its read-only
62
+ review mode, which reports verified findings and suggested fixes without editing production source,
63
+ and now also carries the authorized post-implementation disposition workflow so one skill owns both
64
+ the audit and its tightly controlled fix-or-flag decisions.
65
+
66
+ If the old global copies exist, inspect and back up `~/.agents/skills/<skill>/` for those seven
67
+ names, then remove those directories after the package is configured. The shared installer does not
68
+ remove retired directories automatically. Do not keep both the global copies and the package
69
+ loaded: Pi keeps the first discovered skill and warns about the duplicate name.
70
+
71
+ `no-unit-tests` and `no-arbitrary-limits` are general policies, not review-only rules. They apply
72
+ to every implementation, fix, refactor, migration and maintenance task in any workflow that reads
73
+ them, exactly as before the move. `agent-review`, `codebase-design` and `awesome-logging-standards`
74
+ are referenced by name from other installed skills; keep this package installed so those
75
+ references still resolve.
76
+
77
+ `security-audit` keeps its upstream companion documents, report schema, zero-dependency validators,
78
+ license and pinned provenance. Installing the package does not run an audit or install sandbox
79
+ tooling.
80
+
81
+ ## Licensing
82
+
83
+ The package's original packaging and documentation, including `agent-review`, `no-unit-tests`,
84
+ `no-arbitrary-limits` and `ui-ux-testing`, are MIT licensed; see [LICENSE](LICENSE). Redistributed
85
+ material keeps its upstream terms and bundled license texts. See
86
+ [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
@@ -0,0 +1,32 @@
1
+ # Third-party notices
2
+
3
+ This package's original packaging, documentation and the `agent-review`, `no-unit-tests`, `no-arbitrary-limits` and `ui-ux-testing` skills use the root [MIT License](LICENSE). Redistributed material retains the following upstream terms.
4
+
5
+ ## awesome-logging-standards
6
+
7
+ - Covered files: `skills/awesome-logging-standards/`
8
+ - Upstream: [khasky/awesome-agent-skills](https://github.com/khasky/awesome-agent-skills/tree/58ea4e8915de64907d04cc909a1b8c6e5cf0fcb7/skills/awesome-logging-standards) at `58ea4e8915de64907d04cc909a1b8c6e5cf0fcb7`
9
+ - License: MIT
10
+ - Copyright: Copyright (c) 2026 Khasky
11
+ - Required text: [`skills/awesome-logging-standards/LICENSE`](skills/awesome-logging-standards/LICENSE)
12
+ - Adaptations: Pi workflow integration, redaction instead of sensitive-data sampling, authorized local verification, framework-aware request completion, and TypeScript/Effect error and context guidance. See [`skills/awesome-logging-standards/PROVENANCE.md`](skills/awesome-logging-standards/PROVENANCE.md).
13
+
14
+ ## codebase-design
15
+
16
+ - Covered files: `skills/codebase-design/`
17
+ - Upstream: [mattpocock/skills](https://github.com/mattpocock/skills/tree/d80fa0f4ebe0c5714af0adf8670336065233ecc6/skills/engineering/codebase-design) at `d80fa0f4ebe0c5714af0adf8670336065233ecc6`
18
+ - License: MIT
19
+ - Copyright: Copyright (c) 2026 Matt Pocock
20
+ - Required text: [`skills/codebase-design/LICENSE`](skills/codebase-design/LICENSE)
21
+ - Adaptations: condensed the skill and its deepening/design-it-twice references into one design reference; retained repository/library terminology, made independent agents proportionate, preserved unit-test permissions and workflow ownership, and added version-aware TypeScript/Effect contracts. Integration remains in the existing design, implementation, and review workflows.
22
+
23
+ ## security-audit
24
+
25
+ - Covered files: `skills/security-audit/`
26
+ - Upstream: [cloudflare/security-audit-skill](https://github.com/cloudflare/security-audit-skill) at `c1c8a8c1471069fb0e188eeaff69b8e8db6564a8`
27
+ - License: MIT
28
+ - Copyright: Copyright (c) 2025-2026 Cloudflare, Inc.
29
+ - Required text: [`skills/security-audit/LICENSE`](skills/security-audit/LICENSE)
30
+ - Adaptations: Pi coordination, delegation, unit-test permissions, and explicit full-audit path compatibility guidance. Upstream unit tests are omitted; companion documents, schema, and validators are unchanged. See [`skills/security-audit/PROVENANCE.md`](skills/security-audit/PROVENANCE.md).
31
+
32
+ Product and project names belong to their respective owners.
package/package.json CHANGED
@@ -1,6 +1,42 @@
1
1
  {
2
2
  "name": "@abhishek944/pi-review",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Skill-only Pi package for change review, module design, security auditing, UI/UX auditing, logging standards and scope policies.",
5
+ "keywords": [
6
+ "pi-package",
7
+ "pi",
8
+ "pi-skills",
9
+ "review",
10
+ "code-review",
11
+ "security-audit",
12
+ "design",
13
+ "policy"
14
+ ],
15
+ "license": "MIT",
16
+ "type": "module",
17
+ "engines": {
18
+ "node": ">=22"
19
+ },
20
+ "files": [
21
+ "skills/",
22
+ "THIRD_PARTY_NOTICES.md",
23
+ "README.md",
24
+ "LICENSE"
25
+ ],
26
+ "pi": {
27
+ "skills": [
28
+ "./skills"
29
+ ]
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/abhishek944/astack.git",
37
+ "directory": "packages/pi-review"
38
+ },
39
+ "scripts": {
40
+ "check": "npm pack --dry-run"
41
+ }
42
+ }
@@ -0,0 +1,62 @@
1
+ ---
2
+ name: agent-review
3
+ description: "Independent review of repository changes when requested or when concrete consequences, risk, or uncertainty warrant a separate owner."
4
+ compatibility: Requires a Git repository and support for independent reviewers.
5
+ ---
6
+
7
+ # Agent Review
8
+
9
+ Review changes without editing them. Depth follows the concrete consequences of a mistake, the actual risk, and the remaining uncertainty, not a fixed checklist, file count, or change size. Use independent review when the user requests or requires it, when a higher-priority control requires an owner separate from the implementer, or when consequential uncertainty warrants a second owner. Otherwise the implementer's direct focused verification is sufficient; do not add an independent reviewer by default.
10
+
11
+ Scope the review to the actual changed behavior and its affected boundaries. Review at coherent milestones rather than after every intermediate step. Group related findings into one report and require evidence for the exact scenario each finding claims to cover; distinguish blocking defects from optional hardening and out-of-scope suggestions. After narrow fixes, return accepted findings to the same reviewer for a correction-only recheck of those findings and directly affected code instead of repeating a broad review. Reopen a resolved finding only when the correction invalidates the evidence that resolved it. Security-sensitive changes still need independent review by an owner separate from the implementer; a milestone review, implementer self-check or coordinator inspection does not replace it.
12
+
13
+ Before replying to the user, follow the global `talk-human` skill.
14
+
15
+ ## Session coordination
16
+
17
+ When available, use `WorkCreate`/`WorkUpdate` and `TodoCreate`/`TodoUpdate` to keep the relevant session work and todos current. Use `MonitorCreate` only for a long-running background command and `LoopCreate` only for a future or repeated wake. Never change works, todos, loops, or monitors during `/ask`.
18
+
19
+ ## Rules
20
+
21
+ - Read the original user request and explicit decisions before the implementation plan, then repository instructions, the current diff, nearby callers and relevant documentation. Flag unnecessary scope; an implementer's plan is not independent authorization for its guarantees.
22
+ - For changes to interfaces, abstractions, or module responsibilities, read the global `codebase-design` skill fully and give reviewers the agreed design contract. Apply only checks relevant to the changed behavior and actual callers, not the entire checklist as new acceptance criteria. Review does not reopen approved design decisions without a concrete defect or authorize test changes.
23
+ - Reviewers are read-only. They do not edit files, run tests, or launch more agents.
24
+ - Preserve unrelated work. Never commit, push, publish, or deploy.
25
+ - When independent review is warranted, default to one reviewer covering the relevant lenses below. Add a specialist only for a named, distinct material risk whose benefit outweighs coordination cost. These are lenses, not three mandatory agents. Do not increase reviewer count merely because the implementation introduced unnecessary complexity.
26
+ - Verify every finding against the current files and supported behavior before accepting it. A blocking finding must identify a violated user requirement or existing contract, a concrete supported failure scenario, code evidence, and the smallest complete fix. An executable reproduction is not required when the failure follows clearly from the code. Severity labels alone do not make a finding blocking.
27
+ - Separate required fixes from optional cleanup/hardening and out-of-scope scenarios. Optional suggestions must not block completion or become implementation tasks without user authorization. Omit speculative improvements rather than create a backlog for the implementer.
28
+ - Before recommending more machinery, consider removing the unnecessary guarantee or abstraction that caused the finding. Preserve required behavior, security, cancellation handling and data-loss protection; simplification is not permission to ignore real bugs.
29
+
30
+ ## Evidence scope
31
+
32
+ Start with the actual changed behavior and its directly affected callers or contracts; widen searches only for a concrete review question. Use the `research` skill's **Focused evidence** procedure for ignore-aware discovery, output projection, image forwarding, output-sized batches and recovery of truncated required sources; this evidence-handling guidance does not change review's read-only rules. Give reviewers exact paths and relevant ranges instead of broad dumps, while retaining access to the complete required evidence.
33
+
34
+ ## Review lenses
35
+
36
+ - **Correctness/safety:** Does the change deliver the original request without breaking required behavior, authorization, cancellation handling, or data-loss protection? For authentication, authorization, secrets, data isolation or another security control, keep the independent security lens and trace the exact supported failure scenario before accepting a fix. Do not invent new guarantees for hypothetical failures.
37
+ - **Architecture/integration:** Do affected callers still work, and does behavior stay with its existing owner? Look first for unnecessary machinery that can be removed. Do not redesign working code or add abstractions for future flexibility.
38
+ - **Regression:** Trace existing supported behavior through changed code and affected callers. Do not turn a feature review into a repository-wide compatibility audit or require support for new scenarios.
39
+
40
+ ## Workflow
41
+
42
+ 1. Define the review base, target and scope from the original request and explicit decisions, including non-goals. Include that scope in reviewer assignments, not only the implementer's plan.
43
+ 2. Read the decision trees, visual contracts and original evidence at the exact paths supplied by the parent or caller. Do not reconstruct interview paths from a feature name, branch label or another task's numeric IDs.
44
+ 3. Before launching an independent read-only reviewer, read and follow the globally installed `model-routing-policy` skill for model, thinking level, and Fast settings. Keep routing defaults only in that skill. Use one reviewer by default; record the distinct risk before adding a specialist.
45
+ 4. Include this contract in each assignment: "Review whether this change delivers the original request and preserves affected existing behavior. Report concrete defects, not opportunities to improve the system. Prefer deletion or a local correction over new machinery. No actionable findings is a valid result." Ask for severity, the violated requirement or contract, supported failure scenario, code evidence, scope classification, and the smallest complete recommendation. Do not invent findings to fill a review.
46
+ 5. Combine duplicates by root cause and consolidate actionable, evidenced findings into one report; omit speculative suggestions rather than creating a backlog.
47
+ 6. Accept, reject, or leave each finding unresolved with a short reason. Reviewer output is advice, not authorization to expand the task. Only accepted in-scope defects require fixes; keep optional suggestions outside the task unless the user requests them.
48
+ 7. After fixes, send accepted defects back to the same reviewer for a narrow correction-only recheck of those defects and directly affected code when warranted. For a security-sensitive finding, verify the specific affected control before resolving it. Reopen a resolved finding only when the correction invalidates its supporting evidence; do not restart the full review or reopen settled design decisions unless the fixes introduce a new material risk. Stop when accepted defects are resolved and allowed verification is complete.
49
+
50
+ ## Files
51
+
52
+ Follow the global `implement` skill for canonical task ownership. Retain reports only inside the reviewer's own task directory (`taskDir`); a delegated reviewer appends its own session/Work/Task IDs below the exact supplied parent task directory. Reuse the current task when review is part of that assignment, and establish real tracking before standalone work. Never construct an output root from a feature name.
53
+
54
+ ```text
55
+ <taskDir>/summary.md
56
+ ```
57
+
58
+ A single `summary.md` is normally enough. Use separate lens reports only when distinct specialist reviews justify them. Do not create launch logs, state files, checksums, or machine-only evidence.
59
+
60
+ ## Final response
61
+
62
+ State the reviewed scope, accepted and rejected findings, unresolved risks, checks performed by the parent, and the final verdict: `clean`, `pass`, or `blocked`.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Khasky
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,17 @@
1
+ # Logging standards provenance
2
+
3
+ - Upstream: https://github.com/khasky/awesome-agent-skills
4
+ - Revision: `58ea4e8915de64907d04cc909a1b8c6e5cf0fcb7`
5
+ - Source: `skills/awesome-logging-standards/SKILL.md`
6
+ - Author: Khasky
7
+ - License: MIT; upstream copyright and permission notice are retained in `LICENSE`.
8
+
9
+ ## Local adaptations
10
+
11
+ - Integrate with Pi's existing implementation coordination, talk-human, and no-unit-tests skills without expanding authorization.
12
+ - Replace sensitive-data sampling advice with omission/redaction before emission; sampling controls volume only.
13
+ - Limit failure verification to authorized safe local checks, with user-owned live steps otherwise.
14
+ - Use framework completion hooks for accurate request summaries, including streaming and outer error handling.
15
+ - Reuse existing TypeScript/Node.js or Effect logging; retain error causes, avoid duplicate error reports, and isolate concurrent request context.
16
+
17
+ Update from a reviewed upstream revision, reapply these adaptations, and reinstall the `@abhishek944/pi-review` package so its bundled copy stays current.
@@ -0,0 +1,129 @@
1
+ ---
2
+ name: awesome-logging-standards
3
+ description: "Applies structured logging: levels, PII redaction, request logging, wide events (canonical log lines). Use when adding or reviewing logs, choosing levels, or after logs failed or leaked data in an incident."
4
+ license: MIT
5
+ metadata:
6
+ author: Khasky
7
+ tags: ["logging", "reliability", "pii"]
8
+ documentation: "https://github.com/khasky/awesome-agent-skills/tree/main/skills/awesome-logging-standards"
9
+ ---
10
+
11
+ # Logging Standards
12
+
13
+ Apply consistent logging so operations are debuggable and compliant without leaking secrets or personally identifiable information (PII).
14
+
15
+ Before replying to the user, follow the global `talk-human` skill. Reuse the active `implement` coordination workflow; this skill does not authorize project edits, production access, live failure injection, or unit tests. Follow `no-unit-tests` unless the user's latest request explicitly asks for unit tests.
16
+
17
+ Adapted from Khasky's MIT-licensed skill. See `PROVENANCE.md` and `LICENSE`.
18
+
19
+ ## When to Activate
20
+
21
+ - Adding or refactoring log statements
22
+ - User asks for "logging", "log format", or "what to log"
23
+ - Defining or reviewing logging standards for the project
24
+ - After an incident where logs were insufficient or leaked data
25
+
26
+ ## Core principles
27
+
28
+ - Define "working" before instrumenting — Write the 2–4 questions on-call will actually ask ("did checkout succeed for this user?", "which dependency is slow?") and make every signal map to one of them. A log line that answers no operational question is noise.
29
+ - Structured — Prefer key-value fields (e.g. JSON) over long prose so logs are queryable and parseable. Use the same structure across the app (timestamp, level, message, fields).
30
+ - Cardinality — Never use unbounded values as index/label keys (user_id, email, full URL, raw error text) in metrics/labels — they explode cardinality; keep them as event fields instead. Alert on symptoms (user-visible failure), not causes (one host's CPU).
31
+ - Verify the telemetry itself — Within authorized local checks, exercise a safe failure and confirm you can locate it from the logs/metrics alone. If live testing is not authorized, provide user-owned verification steps instead; never inject failures into shared or production systems without explicit permission. Untested observability tends to be silently wrong — e.g. sampling upstream of metric generation skews a request-rate metric by the sampling ratio while nothing looks broken.
32
+ - Levels — Use consistently: ERROR (failures, exceptions), WARN (recoverable issues, deprecations), INFO (key business events, request summary), DEBUG (detailed flow; disable or sample in production).
33
+ - Context — Include request_id, trace_id, or correlation_id when available. Include user_id, order_id, or similar only when safe and allowed by policy. Do not log full PII (email, phone, address) in plain text unless required and compliant.
34
+ - No secrets — Never log passwords, tokens, API keys, or full card numbers. Omit credentials entirely; redact other sensitive fields before emission. Sampling does not make sensitive data safe.
35
+ - One place — Use the project's logging library (Winston, Pino, log4j, structlog, etc.) and output to the same pipeline (e.g. stdout) that the platform collects.
36
+
37
+ ## Work Process
38
+
39
+ 1. Check existing practice — What format does the project use (JSON, plain text)? What library? What levels? Match it.
40
+ 2. Choose level — error for failures; warn for recoverable or deprecated; info for key actions (request completed, order created); debug for detailed flow. Do not use info for verbose per-item logs in hot paths; use debug or sampled info.
41
+ 3. Add context — Request id, operation name, duration, status. Identifiers (user_id, order_id) only if policy allows. Structured fields, not interpolated into message string when the logger supports structured fields.
42
+ 4. Redact — No secrets or full PII in messages or fields. Omit or redact sensitive data before emission, including error messages, stacks, and causes. Sampling controls volume only; never use it as a substitute for redaction.
43
+ 5. Verify — Logs go to stdout or the configured sink; format is parseable; no secrets or PII in sample output.
44
+
45
+ ## What to Log
46
+
47
+ | Category | Level | Content | Do not log |
48
+ |----------|--------|---------|------------|
49
+ | Request start/end | INFO | method, path (query string stripped), status, duration_ms, request_id | Body, headers with tokens, query strings, path segments carrying tokens or PII |
50
+ | Errors | ERROR | message, error type, stack (server-side), request_id | Full request/response, secrets |
51
+ | Recoverable issues | WARN | message, context (e.g. retry count), request_id | |
52
+ | Key business events | INFO | event name, relevant ids (order_id, user_id if safe), outcome | Full payloads, PII |
53
+ | External calls | INFO or DEBUG | service, operation, duration_ms, outcome (success/failure) | Full request/response, credentials |
54
+ | Detailed flow | DEBUG | step, state, ids | Secrets, PII |
55
+
56
+ ## Format (structured)
57
+
58
+ JSON (recommended for production):
59
+
60
+ ```json
61
+ {
62
+ "timestamp": "2024-03-15T10:30:00.123Z",
63
+ "level": "info",
64
+ "message": "Request completed",
65
+ "request_id": "abc-123",
66
+ "method": "GET",
67
+ "path": "/api/orders",
68
+ "status": 200,
69
+ "duration_ms": 45
70
+ }
71
+ ```
72
+
73
+ Fields: Prefer consistent names (snake_case or camelCase per project). Put variable data in fields, not only in the message string, so logs are queryable.
74
+
75
+ ## Wide events (canonical log lines)
76
+
77
+ For request-driven services, prefer one context-rich structured event per request per service over scattered log lines:
78
+
79
+ - Middleware owns timing, final status, and emission through the framework's request-completion/error hooks. Use `finally` only when it reflects the actual outcome; streaming or outer error handlers may complete later. Handlers only add safe business fields along the way.
80
+ - Include environment fields in every event: commit hash, service version, region.
81
+ - Capture business context, not just mechanics: "premium customer failed a $2,499 checkout" beats "checkout failed".
82
+ - Scattered step-by-step lines stay at debug level; the wide event is the queryable record of what happened.
83
+
84
+ ## Good vs Bad
85
+
86
+ Good:
87
+ ```typescript
88
+ logger.info({ request_id, method, path, status, duration_ms }, 'Request completed');
89
+ logger.error({ err, request_id }, 'Payment failed');
90
+ logger.debug({ order_id, step: 'validation' }, 'Validating order');
91
+ ```
92
+
93
+ Bad:
94
+ ```typescript
95
+ console.log('User ' + user.email + ' did something'); // PII in log
96
+ logger.info('Token: ' + token); // Secret in log
97
+ logger.error('Error: ' + err); // May include stack or internal detail in message; use structured field
98
+ ```
99
+
100
+ ## Rules
101
+
102
+ - Do not add logs that dump full request/response or env vars. Use an allowlist of safe fields and redact before emission; sample only already-sanitized events to control volume.
103
+ - If the project has a logging or privacy policy (retention, PII, secrets), align with it.
104
+ - Scrub the `path` before it is written: drop the query string and replace path segments that carry a token, an email or another personal identifier with a route template (`/users/:id`). Mask client IPs where the full address is not needed (zero the last octet of IPv4, the last 80 bits of IPv6).
105
+ - Log the event, not the data: "user changed email" with the user id, never the old and new values.
106
+ - Keep the audit log (sensitive reads, admin actions) apart from the application log, with its own retention and its own access list; the app log is wide-readable and short-lived, the audit log is neither.
107
+ - Use the same library and format as the rest of the codebase. Do not introduce a second logging system without good reason.
108
+ - For TypeScript/Node.js, reuse the configured logger and framework integration; consider Pino for a new plain Node.js service, not as a mandatory replacement. In Effect applications, use the installed version's Effect logging, annotations, causes, and logger configuration rather than adding a parallel logger.
109
+ - Report an error once at the boundary that handles or reports the failure. Propagate typed errors with their cause; avoid logging at every catch-and-rethrow. Keep user-facing responses safe and free of stacks or internal details.
110
+ - Prefer request-scoped context or child loggers derived from the central configuration. Correlate HTTP requests and background jobs without sharing mutable request fields between concurrent operations.
111
+
112
+ ## Checklist
113
+
114
+ - [ ] Level appropriate (error/warn/info/debug)
115
+ - [ ] Context included (request_id, operation, duration where relevant)
116
+ - [ ] No secrets or full PII in message or fields
117
+ - [ ] Structured format (fields) when logger supports it
118
+ - [ ] Matches project library and format
119
+
120
+ ## Anti-patterns
121
+
122
+ | Anti-pattern | Better approach |
123
+ |--------------|-----------------|
124
+ | Logging full request/response | Log method, path, status, duration; redact or omit body/headers |
125
+ | Using console.log in server code | Use project logger with levels and structure |
126
+ | Interpolating everything into message | Use structured fields (request_id, order_id, etc.) |
127
+ | Logging at info for every iteration in a loop | Use debug or sample (e.g. every Nth) |
128
+ | Leftover print-debugging (`print()`, `fmt.Println`, `console.log`) in production paths | Remove, or convert to `logger.debug` with fields |
129
+ | "We'll redact later" | Redact or omit from the start; do not log secrets |
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Matt Pocock
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: codebase-design
3
+ description: Design and review module responsibilities, interfaces, abstractions, and TypeScript/Effect contracts. Use before non-trivial interface changes or when reviewing coupling, scattered logic, dependency ownership, or unnecessary wrappers.
4
+ license: MIT
5
+ ---
6
+
7
+ # Codebase Design
8
+
9
+ Hide meaningful complexity behind a small, explicit interface. Keep the knowledge needed to change a behavior together. More files, classes, services, layers, or generic types do not automatically make a better design.
10
+
11
+ This is a design reference, not a replacement for the global workflows. Read it fully when applicable. Follow `talk-human` before replying and `no-unit-tests` unless the latest user request explicitly asks for unit tests.
12
+
13
+ ## Workflow boundaries
14
+
15
+ - Read repository instructions, relevant flow/architecture records, existing callers, and similar implementations first.
16
+ - In `research` or `design-council`, keep production files read-only. Design advice does not authorize implementation.
17
+ - In `implement`, work only within the approved scope and record the design in its existing plan, not a second task system.
18
+ - In `agent-review`, inspect the actual changes and callers against the agreed contract; reviewers remain read-only.
19
+ - Reuse the owning workflow's Work/Todo tracking and canonical task directory from global `implement`. If invoked alone, establish real session/Work/Task ownership first; optional notes stay inside that task directory. Delegated work appends its own IDs below the exact supplied parent task directory. Do not create a feature-named output root.
20
+ - This skill does not authorize commits, deployment, dependency upgrades, live testing, or creating, editing, deleting, or running unit tests.
21
+
22
+ ## Shared concepts
23
+
24
+ A **module** can be a function, service, class, or package with an interface and implementation. Its **interface** includes everything a caller must know: types, invariants, failure modes, ordering, configuration, resource ownership, and relevant performance limits. A **seam** is where behavior can be substituted; an **adapter** implements the contract at that seam.
25
+
26
+ A **deep module** provides substantial useful behavior through a small interface. Depth is caller leverage, not a ratio of implementation lines to interface lines. Keep valid repository and library terms such as API, boundary, and Effect service; do not rename them to enforce a glossary.
27
+
28
+ ## Design checks
29
+
30
+ 1. **Start with callers.** Show a realistic usage example. A contract that requires callers to understand implementation details is incomplete.
31
+ 2. **Own the behavior once.** Put an invariant or policy at the boundary responsible for enforcing it, not in every caller or several pass-through layers.
32
+ 3. **Keep knowledge local.** If understanding a behavior requires repeatedly opening tightly coupled siblings, combine or deepen them rather than adding another wrapper.
33
+ 4. **Reduce interface burden.** Prefer fewer meaningful operations and simpler parameters. Do not merge unrelated capabilities just to reduce method count.
34
+ 5. **Use the deletion check.** If removing a wrapper removes complexity, it was unnecessary. If complexity would spread across callers, it is earning its keep.
35
+ 6. **Justify substitution.** Reuse existing capabilities and prefer plain functions for pure decisions. Add a port or service for a real external dependency, ownership/lifecycle requirement, policy boundary, or justified variation—not a hypothetical future.
36
+ 7. **Keep internal seams internal.** Do not expose implementation collaborators merely to make them accessible to tests. Verification should observe the public contract.
37
+ 8. **Make states explicit.** Model domain invariants and invalid states with appropriate types, schemas, constraints, or discriminated unions. Prefer ordinary types and built-in utilities over clever generic machinery.
38
+ 9. **Default to no additional runtime machinery.** Estimators, reservation pools, repeated checksums, recovery systems and blocking gates need an explicit requirement or demonstrated failure within the approved scope. Hypothetical robustness or production-readiness is not a requirement. Reuse platform and trusted-boundary guarantees instead of duplicating them; account for false refusals, latency and recovery burden. If no necessary role exists, omit the mechanism. Preserve essential authorization, untrusted-input validation and data-loss protection.
39
+ 10. **Explain only what code cannot.** Put caller-visible guarantees next to the interface and surprising rationale near the implementation. Record durable, consequential trade-offs in the repository's existing decision format.
40
+
41
+ Two justified adapters are evidence for a useful seam, not a prerequisite. One implementation may still own a real dependency or resource lifecycle. Never invent a test adapter solely to justify an abstraction.
42
+
43
+ ## Design contract before non-trivial changes
44
+
45
+ Before changing an interface, adding an abstraction, or restructuring responsibilities, write a short contract in the owning workflow's plan or decision notes:
46
+
47
+ - Goal, existing callers, domain invariants, and scope/non-goals.
48
+ - Module responsibilities, public TypeScript signatures, and one caller example.
49
+ - Success result, expected failures, required dependencies, and who handles each failure.
50
+ - Hidden implementation details, dependency/resource ownership, and why each new abstraction is needed.
51
+ - Ordering, concurrency, transactions, retries/idempotency, and cancellation where relevant.
52
+ - Compatibility, migration/rollback concerns, acceptance criteria, and allowed verification commands.
53
+
54
+ Scale this to the change. A local straightforward fix needs only a brief ownership/contract check, not a speculative architecture document. Surface meaningful uncertainty before coding. In design-council, stop at a recommendation and obtain direction approval; in approved implementation, pause only for a material unresolved scope or design decision.
55
+
56
+ ## TypeScript and Effect
57
+
58
+ Apply these checks only when the repository uses Effect:
59
+
60
+ - Inspect the lockfile and installed Effect/TypeScript versions. Prefer the installed `effect/AGENTS.md` when present, then version-matched declarations, source, and official documentation. Do not upgrade dependencies or copy APIs from an unpinned upstream branch.
61
+ - Specify the success, expected error, and requirements channels of `Effect.Effect<A, E, R>`. Avoid accidental `any`/`unknown` in error or requirements contracts and unchecked casts that hide missing guarantees.
62
+ - Use Schema to validate untrusted data at trust boundaries. Use branded values or tagged variants when they enforce a real invariant, not mechanically for every primitive.
63
+ - Use Effect's installed service and Layer APIs for real dependency and lifecycle ownership; do not build a parallel DI framework. Keep pure domain decisions as plain functions when appropriate.
64
+ - Capture implementation dependencies when building a service Layer where appropriate, rather than leaking them through every method. Any remaining method requirements must be deliberate and documented.
65
+ - Keep expected domain failures typed. Translate foreign failures at adapters and decide explicitly which failures callers recover from versus propagate.
66
+ - Compose dependencies and execute effects at application/runtime boundaries. Avoid hidden runtime execution in domain logic; make any necessary interop boundary explicit.
67
+ - Define who acquires, shares, and releases resources. Use scoped acquisition and structured concurrency; bound input-sized parallel work and specify cancellation behavior.
68
+ - Retry mutations only with an explicit idempotency/duplicate-handling strategy. Define transactional ownership where partial failure matters.
69
+ - Verify through the repository's actual typecheck, lint, build, schema, and compatible Effect-diagnostic commands. Do not invent commands or add tooling without approval. Tests remain subject to `no-unit-tests`.
70
+
71
+ ## Compare designs when uncertainty matters
72
+
73
+ For consequential interface decisions, compare at least two genuinely different designs: their caller examples, interface burden, hidden complexity, ownership, failure behavior, and cost of change. Include the simplest existing-pattern option. Prefer the design with clearer contracts and less distributed knowledge, not maximum flexibility.
74
+
75
+ Do this directly when evidence is sufficient. Independent perspectives are optional, not a mandatory three-agent exercise. If agents are useful, follow the global `design-council`, `model-routing-policy`, and `herdr` lifecycle, including required monitors and recursion limits. Do not launch agents just because a design checklist exists.
76
+
77
+ ## Review and handoff
78
+
79
+ Check the actual code against the agreed contract and representative callers. Look for duplicated policy, shallow forwarding layers, hidden ordering requirements, invalid states, dependency leaks, unsafe retries, and unclear resource ownership. Preserve unrelated work and existing tests.
80
+
81
+ Report the chosen design, important rejected alternatives, remaining uncertainty, and actual verification or blocked checks. Do not claim that a written design or passing typecheck alone proves runtime correctness.
82
+
83
+ ## Provenance
84
+
85
+ Adapted from Matt Pocock's [codebase-design](https://github.com/mattpocock/skills/tree/d80fa0f4ebe0c5714af0adf8670336065233ecc6/skills/engineering/codebase-design), including its deepening and alternative-design references, at `d80fa0f4ebe0c5714af0adf8670336065233ecc6` (MIT, Copyright (c) 2026 Matt Pocock). Local adaptations preserve repository terminology, proportionate delegation, workflow boundaries, test permissions, and version-aware Effect guidance. See [LICENSE](LICENSE).
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: no-arbitrary-limits
3
+ description: Apply to every implementation, fix, refactor, migration, and maintenance task. Prevent unrequested application capacity limits and mid-implementation limit questions; enforce only verified mandatory SDK/platform constraints or explicit user requirements, and explain optional limits after completion.
4
+ ---
5
+
6
+ # No Arbitrary Limits
7
+
8
+ Apply this to every implementation, fix, refactor, migration, and maintenance task, including delegated work.
9
+
10
+ Before replying to the user, follow the global `talk-human` skill.
11
+
12
+ ## Rule
13
+
14
+ Do not introduce or tighten application capacity limits unless the user explicitly requests them. Do not interrupt implementation to propose, negotiate, or ask for optional limits. Complete the authorized work without adding those restrictions, then explain relevant optional controls in the final handoff.
15
+
16
+ This includes byte/file/body sizes, item/file/row/cell counts, quotas, pagination ceilings, token/output caps, timeouts, concurrency caps, queue depth, cache/admission budgets, and similar restrictions. Do not hide them in schemas, validators, constants, SDK options, UI controls, infrastructure configuration, or generated code.
17
+
18
+ General requests such as "make it safe," "production-ready," "robust," or "optimize it" do not authorize arbitrary numeric caps. Neither an agent-authored plan nor a suggested value becomes user approval by being written down.
19
+
20
+ ## Mandatory constraints
21
+
22
+ - Implement constraints genuinely required by the installed SDK, protocol, provider, or runtime platform. Verify their exact version, scope, units, and enforcement using installed documentation/source or official documentation, and preserve the evidence in normal task notes or the handoff.
23
+ - An optional SDK default, configurable timeout, example value, app-defined schema ceiling, conservative estimate, or guessed safety margin is not a mandatory constraint.
24
+ - Reuse existing streaming, chunking, or pagination support where appropriate instead of imposing a new whole-document/file ceiling because one transport frame is bounded. Do not expand scope into new infrastructure merely to avoid a limit.
25
+ - Do not add a stricter application cap than a mandatory boundary without the user's explicit requirement. Correctly account for required encoding/envelope overhead; do not invent an extra reserve.
26
+ - If a mandatory constraint makes the requested outcome impossible within the authorized design, report that concrete blocker immediately. Do not conceal it until completion, bypass it, or claim unsupported capacity. This exception does not authorize questions about optional caps.
27
+
28
+ ## Existing behavior and safety
29
+
30
+ - Preserve existing limits unless the user authorizes changing them. This skill is not permission to silently remove, raise, or normalize old caps. Distinguish known user requirements from inherited limits with unknown rationale.
31
+ - Keep authentication, authorization, ownership, format/type validation, data-integrity checks, exact-revision/idempotency protections, cancellation, and required resource cleanup intact. Do not use this skill to bypass higher-priority safety requirements.
32
+ - "For safety" alone is not evidence for a new capacity quota. Keep essential validation separate from optional product restrictions and speculative memory/admission gates.
33
+ - When a capacity change is requested, trace producers, consumers, UI/server mirrors, schemas, encoders, storage, jobs, and deployment/runtime boundaries. Changing one constant does not prove the full path supports the new capacity.
34
+ - Do not silently truncate, resize, drop content, or retry consequential work to make an input appear to fit. Do not claim unlimited capacity; actual machine, SDK, provider, and model constraints still apply.
35
+ - Pass this rule to delegated agents and check their changes for unrequested limits before integration.
36
+
37
+ ## Final handoff: optional limits, not implementation gates
38
+
39
+ After completing the authorized work, briefly report the relevant limits and optional places to impose controls:
40
+
41
+ - Mandatory SDK/platform constraints actually encountered, their sources, and what remains unverified.
42
+ - Existing limits preserved or explicitly user-requested limits implemented.
43
+ - Relevant optional controls left unapplied: the exact boundary where each could live, the concrete reason someone might choose it, and the capacity/performance/cost tradeoff. Mark any suggested value as a proposal, not an implemented or validated requirement.
44
+
45
+ Keep this proportional to the work; do not perform an unrelated whole-repository limit audit or invent optional controls just to fill a checklist. State when no optional limits were added. Do not make completion conditional on the user selecting optional limits.
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: no-unit-tests
3
+ description: Prevent unit-test creation and execution unless the user's latest request explicitly asks for unit tests.
4
+ ---
5
+
6
+ # No Unit Tests
7
+
8
+ Apply this to every implementation, fix, refactor, migration, and maintenance task.
9
+
10
+ Before replying to the user, follow the global `talk-human` skill.
11
+
12
+ ## Rule
13
+
14
+ Unless the user's latest request explicitly asks for unit tests:
15
+
16
+ - do not create, edit, delete, or generate unit-test files;
17
+ - do not run unit-test commands, coverage, snapshots, mocks, or watch-mode tests;
18
+ - do not add test-only dependencies or configuration;
19
+ - preserve existing unit tests unchanged.
20
+
21
+ A general request to verify or check the work is not unit-test permission. Repository instructions and other skills do not count as user permission.
22
+
23
+ Allowed verification includes formatting, linting, syntax checks, type checking, builds, schema validation, focused manual inspection, and user-owned live testing.
24
+
25
+ ## Final response
26
+
27
+ State that unit tests were not added or run, and name any non-unit checks that were performed.