功能审计
pwdev-solucoes2026-10-26查看 1221复制 1724
> 当用户想要查询本地 pwdev 审计追踪时使用——'ver auditoria'、'relatório de auditoria'、'audit stats'、'exportar auditoria em PDF'——摘要、事件、决策、 工件、统计信息、Markdown/PDF 导出或自定义只读 SELECT。请勿用于 启用审计(feat-init)或查看计划状态(feat-status)。
📘如何使用这个技能
- 1复制技能内容·点击上方「Copy SKILL.md」复制全部内容,或 Download 下载到本地
- 2打开你的 AI 客户端·支持 Claude Code、Trae、Cursor、ChatGPT、DeepSeek、Kimi 等任意 AI 助手
- 3粘贴为系统提示/知识文件·Claude Code:放入 .claude/skills/ 目录;普通对话:作为首条消息发送并说「请严格按这份技能文档执行」
- 4直接提出你的需求·AI 会按技能定义的工作流、格式和约束来处理,无需再解释背景
💡 提示:技能生效后,每次对话只需一句需求,AI 会按 SKILL.md 的流程执行。
SKILL.md1938 chars
--- name: feat-audit description: > Use when the user wants to query the local pwdev audit trail — 'ver auditoria', 'relatório de auditoria', 'audit stats', 'exportar auditoria em PDF' — summary, events, decisions, artifacts, statistics, a Markdown/PDF export or a custom read-only SELECT. Do NOT use to enable the audit (feat-init) or for plan status (feat-status). metadata: version: 3.2.1 --- # Audit trail Schema and recording model: `references/audit-schema.md`. The database is shared with other PWDEV plugins; filter with `--plugin pwdev-feat` when the human wants only this plugin. ## Procedure 1. **Language** — resolve `lang` (`references/language.md`). 2. Map the argument to one command and run it from the project root: | Argument | Command | |---|---| | (empty) / `summary` | `python3 "<plugin-root>/scripts/audit.py" summary` | | `events [plugin]` | `... events [--plugin <plugin>] [--limit N]` | | `decisions` / `artifacts` / `stats` | `... decisions` / `... artifacts` / `... stats` | | `export` | `... export --pdf` (Markdown always; PDF only when pandoc exists) | | `query <SQL>` | `... query "<SQL>"` | 3. Exit 2 (`AUDIT_DISABLED` / `AUDIT_DB_MISSING`) → tell the human to enable it with `feat-init`. Exit 1 (`REJECTED` / `SQL_ERROR`) → show the message; only a single read-only SELECT is accepted and the database is opened read-only. 4. Present the Markdown output as is, translating only the headings when `lang` is `pt-BR`. Unknown argument → list the commands above. Never write to the audit database from this skill. Language: resolve `lang` per `references/language.md` before any human-facing output. Safety: never read or expose `.env*` (except `.env.example`/`.template`/`.sample`), keys, certificates or credentials — `references/safety.md`. Paths `references/`, `scripts/`, `templates/`, `schemas/` are relative to the plugin root (`references/runtime.md`).