@orderful/droid 0.45.0 → 0.46.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 (49) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +8 -2
  3. package/.github/workflows/claude-issue-agent.yml +1 -2
  4. package/CHANGELOG.md +14 -0
  5. package/dist/tools/droid/.claude-plugin/plugin.json +1 -1
  6. package/dist/tools/droid/TOOL.yaml +1 -1
  7. package/dist/tools/droid/skills/droid/SKILL.md +1 -0
  8. package/dist/tools/droid/skills/droid-bootstrap/SKILL.md +1 -0
  9. package/dist/tools/edi-schema/.claude-plugin/plugin.json +25 -0
  10. package/dist/tools/edi-schema/TOOL.yaml +29 -0
  11. package/dist/tools/edi-schema/agents/edi-schema-agent.md +97 -0
  12. package/dist/tools/edi-schema/commands/edi-schema.md +33 -0
  13. package/dist/tools/edi-schema/skills/edi-schema/SKILL.md +86 -0
  14. package/dist/tools/pii/.claude-plugin/plugin.json +25 -0
  15. package/dist/tools/pii/TOOL.yaml +22 -0
  16. package/dist/tools/pii/agents/pii-scanner.md +85 -0
  17. package/dist/tools/pii/commands/pii.md +33 -0
  18. package/dist/tools/pii/skills/pii/SKILL.md +97 -0
  19. package/dist/tools/pii/skills/pii/references/supported-entities.md +90 -0
  20. package/dist/tools/pii/skills/pii/scripts/presidio-analyze.d.ts +18 -0
  21. package/dist/tools/pii/skills/pii/scripts/presidio-analyze.d.ts.map +1 -0
  22. package/dist/tools/pii/skills/pii/scripts/presidio-analyze.ts +258 -0
  23. package/dist/tools/pii/skills/pii/scripts/presidio-init.d.ts +17 -0
  24. package/dist/tools/pii/skills/pii/scripts/presidio-init.d.ts.map +1 -0
  25. package/dist/tools/pii/skills/pii/scripts/presidio-init.ts +151 -0
  26. package/dist/tools/pii/skills/pii/scripts/presidio-redact.d.ts +21 -0
  27. package/dist/tools/pii/skills/pii/scripts/presidio-redact.d.ts.map +1 -0
  28. package/dist/tools/pii/skills/pii/scripts/presidio-redact.ts +294 -0
  29. package/dist/tools/pii/skills/pii/scripts/presidio.test.ts +444 -0
  30. package/package.json +1 -1
  31. package/src/tools/droid/.claude-plugin/plugin.json +1 -1
  32. package/src/tools/droid/TOOL.yaml +1 -1
  33. package/src/tools/droid/skills/droid/SKILL.md +1 -0
  34. package/src/tools/droid/skills/droid-bootstrap/SKILL.md +1 -0
  35. package/src/tools/edi-schema/.claude-plugin/plugin.json +25 -0
  36. package/src/tools/edi-schema/TOOL.yaml +29 -0
  37. package/src/tools/edi-schema/agents/edi-schema-agent.md +97 -0
  38. package/src/tools/edi-schema/commands/edi-schema.md +33 -0
  39. package/src/tools/edi-schema/skills/edi-schema/SKILL.md +86 -0
  40. package/src/tools/pii/.claude-plugin/plugin.json +25 -0
  41. package/src/tools/pii/TOOL.yaml +22 -0
  42. package/src/tools/pii/agents/pii-scanner.md +85 -0
  43. package/src/tools/pii/commands/pii.md +33 -0
  44. package/src/tools/pii/skills/pii/SKILL.md +97 -0
  45. package/src/tools/pii/skills/pii/references/supported-entities.md +90 -0
  46. package/src/tools/pii/skills/pii/scripts/presidio-analyze.ts +258 -0
  47. package/src/tools/pii/skills/pii/scripts/presidio-init.ts +151 -0
  48. package/src/tools/pii/skills/pii/scripts/presidio-redact.ts +294 -0
  49. package/src/tools/pii/skills/pii/scripts/presidio.test.ts +444 -0
@@ -9,7 +9,7 @@
9
9
  {
10
10
  "name": "droid",
11
11
  "description": "Core droid meta-skill for update awareness, tool discovery, and usage help. Checks for updates, helps users find tools, and answers 'how do I...' questions about droid workflows.",
12
- "version": "0.7.0",
12
+ "version": "0.7.1",
13
13
  "source": {
14
14
  "source": "github",
15
15
  "repo": "orderful/droid",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "droid",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "AI-powered development tools for Claude Code",
5
5
  "author": {
6
6
  "name": "Orderful",
@@ -22,7 +22,9 @@
22
22
  "./src/tools/comments/skills/comments/SKILL.md",
23
23
  "./src/tools/droid/skills/droid/SKILL.md",
24
24
  "./src/tools/droid/skills/droid-bootstrap/SKILL.md",
25
+ "./src/tools/edi-schema/skills/edi-schema/SKILL.md",
25
26
  "./src/tools/meeting/skills/meeting/SKILL.md",
27
+ "./src/tools/pii/skills/pii/SKILL.md",
26
28
  "./src/tools/plan/skills/plan/SKILL.md",
27
29
  "./src/tools/project/skills/project/SKILL.md",
28
30
  "./src/tools/release/skills/release/SKILL.md",
@@ -38,7 +40,9 @@
38
40
  "./src/tools/codex/commands/codex.md",
39
41
  "./src/tools/comments/commands/comments.md",
40
42
  "./src/tools/droid/commands/setup.md",
43
+ "./src/tools/edi-schema/commands/edi-schema.md",
41
44
  "./src/tools/meeting/commands/meeting.md",
45
+ "./src/tools/pii/commands/pii.md",
42
46
  "./src/tools/plan/commands/plan.md",
43
47
  "./src/tools/project/commands/project.md",
44
48
  "./src/tools/release/commands/release.md",
@@ -52,6 +56,8 @@
52
56
  "./src/tools/code-review/agents/error-handling-reviewer.md",
53
57
  "./src/tools/code-review/agents/test-coverage-analyzer.md",
54
58
  "./src/tools/code-review/agents/type-reviewer.md",
55
- "./src/tools/codex/agents/codex-document-processor.md"
59
+ "./src/tools/codex/agents/codex-document-processor.md",
60
+ "./src/tools/edi-schema/agents/edi-schema-agent.md",
61
+ "./src/tools/pii/agents/pii-scanner.md"
56
62
  ]
57
63
  }
@@ -148,7 +148,6 @@ jobs:
148
148
  id: implement
149
149
  uses: anthropics/claude-code-action@v1
150
150
  with:
151
- github_token: ${{ github.token }}
152
151
  claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
153
152
  track_progress: true
154
153
 
@@ -199,7 +198,7 @@ jobs:
199
198
  continue-on-error: true
200
199
  if: steps.implement.outputs.branch_name
201
200
  env:
202
- GH_TOKEN: ${{ steps.implement.outputs.github_token || github.token }}
201
+ GH_TOKEN: ${{ github.token }}
203
202
  PLAN_JSON: ${{ steps.plan.outputs.structured_output }}
204
203
  run: |
205
204
  BRANCH="${{ steps.implement.outputs.branch_name }}"
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @orderful/droid
2
2
 
3
+ ## 0.46.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#293](https://github.com/Orderful/droid/pull/293) [`66a2fd2`](https://github.com/Orderful/droid/commit/66a2fd20b1cbb13ea8ce54e1e7c7a9b9de835a7e) Thanks [@frytyler](https://github.com/frytyler)! - Add pii tool for PII detection and redaction powered by Microsoft Presidio with bundled Python venv, pii-scanner sub-agent, and scan/redact commands.
8
+
9
+ ## 0.45.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#289](https://github.com/Orderful/droid/pull/289) [`f6e43e5`](https://github.com/Orderful/droid/commit/f6e43e52069e53cb8c4000455e46b04ddd515ea8) Thanks [@claude](https://github.com/apps/claude)! - droid: add alwaysApply: true to droid-bootstrap and droid skills so update awareness and tool discovery load every session
14
+
15
+ - [#291](https://github.com/Orderful/droid/pull/291) [`b5819c2`](https://github.com/Orderful/droid/commit/b5819c254dabd51bb1e85e423e3163d057d502e3) Thanks [@frytyler](https://github.com/frytyler)! - add new `edi-schema` tool with skill, command, and specialized sub-agent for querying X12/EDIFACT schemas using targeted extraction strategies
16
+
3
17
  ## 0.45.0
4
18
 
5
19
  ### Minor Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "droid",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Core droid meta-skill for update awareness, tool discovery, and usage help. Checks for updates, helps users find tools, and answers 'how do I...' questions about droid workflows.",
5
5
  "author": {
6
6
  "name": "Orderful",
@@ -1,6 +1,6 @@
1
1
  name: droid
2
2
  description: "Core droid meta-skill for update awareness, tool discovery, and usage help. Checks for updates, helps users find tools, and answers 'how do I...' questions about droid workflows."
3
- version: 0.7.0
3
+ version: 0.7.1
4
4
  status: beta
5
5
 
6
6
  # System tool - always stays current regardless of auto-update settings
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: droid
3
3
  description: "Core droid meta-skill for updates, tool discovery, usage help, and skill overrides. Use when checking for droid updates, discovering available tools, answering 'how do I...' questions about droid workflows, or customizing skill behaviour. User prompts like 'any droid updates?', 'what tools do I have?', 'what tools do you have?', 'remind me what tools you have', 'hey droid what can you do', 'how do I add context?', 'remind me how to use codex', 'what's the best way to start a session?', 'customize brain search', 'create an override for brain'."
4
+ alwaysApply: true
4
5
  allowed-tools: [Bash, Read, Write]
5
6
  ---
6
7
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: droid-bootstrap
3
3
  description: "Lightweight droid bootstrap for update awareness. Checks for droid updates once per session."
4
+ alwaysApply: true
4
5
  allowed-tools: [Bash]
5
6
  ---
6
7
 
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "droid-edi-schema",
3
+ "version": "0.1.0",
4
+ "description": "Query EDI schemas without context overhead. Uses a sub-agent to inspect large schema and code-list files, then returns concise results.",
5
+ "author": {
6
+ "name": "Orderful",
7
+ "url": "https://github.com/orderful"
8
+ },
9
+ "repository": "https://github.com/orderful/droid",
10
+ "license": "MIT",
11
+ "keywords": [
12
+ "droid",
13
+ "ai",
14
+ "edi-schema"
15
+ ],
16
+ "skills": [
17
+ "./skills/edi-schema/SKILL.md"
18
+ ],
19
+ "commands": [
20
+ "./commands/edi-schema.md"
21
+ ],
22
+ "agents": [
23
+ "./agents/edi-schema-agent.md"
24
+ ]
25
+ }
@@ -0,0 +1,29 @@
1
+ name: edi-schema
2
+ description: "Query EDI schemas without context overhead. Uses a sub-agent to inspect large schema and code-list files, then returns concise results."
3
+ version: 0.1.0
4
+ status: beta
5
+
6
+ includes:
7
+ skills:
8
+ - name: edi-schema
9
+ required: true
10
+ commands:
11
+ - name: edi-schema
12
+ is_alias: false
13
+ agents:
14
+ - edi-schema-agent
15
+
16
+ dependencies: []
17
+
18
+ prerequisites:
19
+ - name: jq
20
+ description: JSON query tool used for targeted schema extraction
21
+ check: "jq --version"
22
+ install_hint: "brew install jq"
23
+
24
+ config_schema:
25
+ schemas_dir:
26
+ type: string
27
+ description: "Optional absolute path to a repository containing libs/schemas/. If empty, auto-detect from current workspace."
28
+ required: false
29
+ default: ""
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: edi-schema-agent
3
+ description: "Specialized EDI schema query agent. Uses jq and targeted reads to extract precise schema details with minimal output."
4
+ tools:
5
+ - Read
6
+ - Glob
7
+ - Grep
8
+ - Bash
9
+ color: blue
10
+ ---
11
+
12
+ You are an EDI schema analysis agent. Your job is to query large schema files and return concise, accurate findings.
13
+
14
+ ## Inputs
15
+
16
+ You will receive:
17
+
18
+ 1. `schemasRoot`: Absolute repo path containing `libs/schemas/src/lib/data`
19
+ 2. `mode`: One of `field-search`, `segments`, `loops`, `codes`, `versions`, `types`
20
+ 3. `transactionType`: Full or short transaction type identifier
21
+ 4. `schemaFile` (optional): Resolved schema file path for schema-specific modes
22
+ 5. `query` (optional): Search text for `field-search`
23
+ 6. `elementId` (optional): Element identifier for `codes`
24
+
25
+ ## Rules
26
+
27
+ - Prioritize correctness over broad output.
28
+ - Never output full JSON blobs.
29
+ - Keep returned content compact and actionable.
30
+ - Prefer jq for extraction. If jq is missing, use `rg` + targeted reads.
31
+
32
+ ## Query Strategies
33
+
34
+ ### `field-search`
35
+
36
+ Run exact identifier and title-first queries before fuzzy search:
37
+
38
+ ```bash
39
+ jq '.. | objects | select(.elementIdentifier? == $id)' --arg id "{query}" "{schemaFile}"
40
+ jq '.. | objects | select(.title? == $title)' --arg title "{query}" "{schemaFile}"
41
+ jq '.. | objects | select(.title? | test($q; "i"))' --arg q "{query}" "{schemaFile}"
42
+ ```
43
+
44
+ Return top matches including:
45
+
46
+ - `elementIdentifier` (if present)
47
+ - `title`
48
+ - `schemaType`
49
+ - `X12Requirement` / relevant requirement field
50
+ - a concise path hint when derivable
51
+
52
+ ### `segments`
53
+
54
+ ```bash
55
+ jq '[.. | objects | select(.schemaType? == "segmentInstance") | {title, requirement: .X12Requirement}] | unique' "{schemaFile}"
56
+ ```
57
+
58
+ Return deduplicated segment names and requirement info.
59
+
60
+ ### `loops`
61
+
62
+ ```bash
63
+ jq '[.. | objects | select(.schemaType? | test("loop")) | {title, schemaType}]' "{schemaFile}"
64
+ ```
65
+
66
+ Return loop hierarchy summary. Include parent-child nesting hints if visible.
67
+
68
+ ### `codes`
69
+
70
+ Find likely code-list file (for example `x12_004010_codeList.json`), then:
71
+
72
+ ```bash
73
+ jq --arg id "{elementId}" '.[$id]' "{codeListFile}"
74
+ ```
75
+
76
+ Return code values and descriptions. If no entry exists, return "not found" and suggest checking identifier/version.
77
+
78
+ ### `versions`
79
+
80
+ List available schema filenames matching type in x12 + edifact directories, then normalize to type/version list.
81
+
82
+ ### `types`
83
+
84
+ Read `transactionTypes.json` and return a concise sorted list (or filtered list if query provided).
85
+
86
+ ## Output Format
87
+
88
+ Respond in markdown with this structure:
89
+
90
+ 1. `Resolved:` line (type/version and file used)
91
+ 2. `Results:` compact bullets or table
92
+ 3. `Notes:` any ambiguity, fallbacks, or missing data
93
+
94
+ If no match:
95
+
96
+ - state that clearly
97
+ - provide 2-5 nearest alternatives when possible
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: edi-schema
3
+ description: "Query EDI schemas (X12/EDIFACT) without context blowup. Find fields, segments, loops, and code-list values."
4
+ argument-hint: "{transactionType|types|versions {transactionType}} [{query|--segments|--loops|--codes {elementId}}]"
5
+ ---
6
+
7
+ # /edi-schema
8
+
9
+ **User invoked:** `/edi-schema $ARGUMENTS`
10
+
11
+ **Your task:** Invoke the **edi-schema skill** with these arguments.
12
+
13
+ ## Examples
14
+
15
+ - `/edi-schema 944_004010 freeFormDescription`
16
+ - `/edi-schema 850 --segments`
17
+ - `/edi-schema 856_004010 --loops`
18
+ - `/edi-schema 850 --codes BEG01`
19
+ - `/edi-schema types`
20
+ - `/edi-schema versions 850`
21
+
22
+ ## Quick Reference
23
+
24
+ ```bash
25
+ /edi-schema {transactionType} {query} # Search fields/elements
26
+ /edi-schema {transactionType} --segments # List segment set
27
+ /edi-schema {transactionType} --loops # Show loop structure
28
+ /edi-schema {transactionType} --codes ID # Code-list values for element
29
+ /edi-schema types # List transaction types
30
+ /edi-schema versions {transactionType} # List available versions
31
+ ```
32
+
33
+ See the **edi-schema skill** for full behaviour and resolution rules.
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: edi-schema
3
+ description: "Query EDI schemas without consuming parent context. Use when finding fields, loops, segments, requirements, or code-list values for X12/EDIFACT transaction types. User prompts like '/edi-schema 944_004010 freeFormDescription' or '/edi-schema 850 --codes BEG01'."
4
+ argument-hint: "{transactionType|types|versions {transactionType}} [{query|--segments|--loops|--codes {elementId}}]"
5
+ allowed-tools: [Read, Glob, Grep, Bash, Task]
6
+ ---
7
+
8
+ # EDI Schema Skill
9
+
10
+ Query EDI schemas through a sub-agent so large schema JSON files never enter parent context.
11
+
12
+ ## Commands
13
+
14
+ ```bash
15
+ /edi-schema {transactionType} {query}
16
+ /edi-schema {transactionType} --segments
17
+ /edi-schema {transactionType} --loops
18
+ /edi-schema {transactionType} --codes {elementId}
19
+ /edi-schema types
20
+ /edi-schema versions {transactionType}
21
+ ```
22
+
23
+ ## Input Rules
24
+
25
+ - `transactionType` accepts either full form (`850_004010`, `ORDERS_D96A`) or short form (`850`, `ORDERS`).
26
+ - If short form is used, resolve to the most common version and state which version was selected.
27
+ - If multiple plausible versions exist and no safe default is clear, show options and ask user to pick.
28
+
29
+ ## Data Sources
30
+
31
+ Expected paths in the target schemas repo:
32
+
33
+ - `libs/schemas/src/lib/data/transactionSchemas/x12/`
34
+ - `libs/schemas/src/lib/data/transactionSchemas/edifact/`
35
+ - `libs/schemas/src/lib/data/codeLists/`
36
+ - `libs/schemas/src/lib/data/transactionTypes.json`
37
+
38
+ ## Procedure
39
+
40
+ ### 1. Resolve schemas root
41
+
42
+ 1. Check `droid config --get tools.edi-schema.schemas_dir`.
43
+ 2. If configured and valid, use it.
44
+ 3. Otherwise auto-detect from current workspace by finding `libs/schemas/src/lib/data/`.
45
+ 4. If not found, ask user for the repo path or suggest setting `tools.edi-schema.schemas_dir`.
46
+
47
+ ### 2. Route command
48
+
49
+ - `types`:
50
+ - List transaction types from `transactionTypes.json` (type + description where available).
51
+ - `versions {transactionType}`:
52
+ - List matching schema versions from x12/edifact schema filenames.
53
+ - `{transactionType} --segments`:
54
+ - Ask sub-agent for unique segment list and requirement indicators.
55
+ - `{transactionType} --loops`:
56
+ - Ask sub-agent for loop hierarchy.
57
+ - `{transactionType} --codes {elementId}`:
58
+ - Ask sub-agent for code-list values for the requested element ID.
59
+ - `{transactionType} {query}`:
60
+ - Ask sub-agent to search by identifier/title/business term and return best matches.
61
+
62
+ ### 3. Sub-agent handoff
63
+
64
+ Use `edi-schema-agent` for all schema/content queries. Pass:
65
+
66
+ - Resolved schemas root
67
+ - Resolved schema file path + transaction type/version
68
+ - Query mode (`field-search`, `segments`, `loops`, `codes`, `versions`, `types`)
69
+ - User input (`query`, `elementId`)
70
+
71
+ ### 4. Response format
72
+
73
+ Keep responses compact and structured:
74
+
75
+ - Header with resolved schema (`850_004010`, etc.)
76
+ - Result table or bullets with identifiers and titles
77
+ - Requirement/type constraints where relevant
78
+ - Path hints (loop/segment path) when available
79
+ - Clear next step if no matches
80
+
81
+ ## Behaviour Rules
82
+
83
+ - Never dump the entire schema JSON.
84
+ - Prefer exact identifier match first (for example `BEG01`) before fuzzy title matching.
85
+ - When no exact match, return top fuzzy matches with confidence notes.
86
+ - If jq is unavailable, fall back to `rg`/targeted reads and state that fallback was used.
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "droid-pii",
3
+ "version": "0.1.0",
4
+ "description": "Detect and redact PII (personally identifiable information) in text files. Powered by Microsoft Presidio with a bundled Python venv — zero external dependencies after first run.",
5
+ "author": {
6
+ "name": "Orderful",
7
+ "url": "https://github.com/orderful"
8
+ },
9
+ "repository": "https://github.com/orderful/droid",
10
+ "license": "MIT",
11
+ "keywords": [
12
+ "droid",
13
+ "ai",
14
+ "pii"
15
+ ],
16
+ "skills": [
17
+ "./skills/pii/SKILL.md"
18
+ ],
19
+ "commands": [
20
+ "./commands/pii.md"
21
+ ],
22
+ "agents": [
23
+ "./agents/pii-scanner.md"
24
+ ]
25
+ }
@@ -0,0 +1,22 @@
1
+ name: pii
2
+ description: "Detect and redact PII (personally identifiable information) in text files. Powered by Microsoft Presidio with a bundled Python venv — zero external dependencies after first run."
3
+ version: 0.1.0
4
+ status: beta
5
+
6
+ includes:
7
+ skills:
8
+ - name: pii
9
+ required: true
10
+ commands:
11
+ - name: pii
12
+ is_alias: false
13
+ agents:
14
+ - pii-scanner
15
+
16
+ dependencies: []
17
+
18
+ prerequisites:
19
+ - name: python3
20
+ description: "Python 3.8+ required to run the Presidio venv"
21
+ check: "python3 --version"
22
+ install_hint: "Install Python 3 from python.org or via: brew install python3"
@@ -0,0 +1,85 @@
1
+ ---
2
+ name: pii-scanner
3
+ description: "Isolated PII analysis agent. Runs presidio-analyze.ts in a contained context so raw entity values never appear in the parent conversation. Use PROACTIVELY when the pii skill delegates scan operations."
4
+ tools:
5
+ - Bash
6
+ color: orange
7
+ ---
8
+
9
+ You are a PII scanning agent. Your sole job is to run `presidio-analyze.ts` on a file or text and return a structured summary — without leaking raw PII values into the conversation.
10
+
11
+ ## Inputs
12
+
13
+ You will receive:
14
+
15
+ 1. `file_path` — absolute path to the file to scan (preferred), OR
16
+ 2. `text_content` — inline text to scan (for small strings only)
17
+ 3. `entities` (optional) — comma-separated list of entity types to filter (e.g. `EMAIL_ADDRESS,PHONE_NUMBER`)
18
+ 4. `venv_path` (optional) — override for the Presidio venv path (default: `~/.droid/runtimes/presidio/`)
19
+
20
+ ## Rules
21
+
22
+ - **Never echo raw PII values** in your output — return entity types, counts, and line numbers only
23
+ - Make exactly one Bash call to `presidio-analyze.ts`
24
+ - Parse the JSON result and return only the structured summary
25
+ - If the script returns `init_required: true`, stop and tell the parent skill to run `presidio-init.ts` first
26
+ - If the file does not exist, return a clear error
27
+
28
+ ## Procedure
29
+
30
+ 1. Build the command:
31
+ ```bash
32
+ droid exec pii presidio-analyze --file <file_path> [--entities <types>]
33
+ ```
34
+ (Use `--text` only for inline strings under ~1000 characters)
35
+
36
+ 2. Parse the JSON output from the script
37
+
38
+ 3. From the `entities` array, compute:
39
+ - `total_entities`: total count
40
+ - `by_type`: entity type → count map
41
+ - `lines_affected`: sorted unique list of line numbers
42
+ - `sample_lines`: up to 5 line numbers with the entity types found on each line
43
+
44
+ 4. Return the structured summary (see Output Format below)
45
+
46
+ ## Output Format
47
+
48
+ Return JSON:
49
+
50
+ ```json
51
+ {
52
+ "file": "/path/to/file.md",
53
+ "total_entities": 3,
54
+ "by_type": {
55
+ "EMAIL_ADDRESS": 2,
56
+ "PHONE_NUMBER": 1
57
+ },
58
+ "lines_affected": [4, 8, 12],
59
+ "sample_lines": [
60
+ { "line": 4, "types": ["EMAIL_ADDRESS"] },
61
+ { "line": 8, "types": ["PHONE_NUMBER"] },
62
+ { "line": 12, "types": ["EMAIL_ADDRESS"] }
63
+ ]
64
+ }
65
+ ```
66
+
67
+ If no entities are found:
68
+ ```json
69
+ {
70
+ "file": "/path/to/file.md",
71
+ "total_entities": 0,
72
+ "by_type": {},
73
+ "lines_affected": [],
74
+ "sample_lines": []
75
+ }
76
+ ```
77
+
78
+ If an error occurs:
79
+ ```json
80
+ {
81
+ "file": "/path/to/file.md",
82
+ "error": "...",
83
+ "init_required": true
84
+ }
85
+ ```
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: pii
3
+ description: "Detect and redact PII (personally identifiable information) in files and directories. Powered by Microsoft Presidio."
4
+ argument-hint: "[scan | redact] {file|dir} [--entities TYPES] [--output PATH] [--dry-run] [--mask]"
5
+ ---
6
+
7
+ # /pii
8
+
9
+ **User invoked:** `/pii $ARGUMENTS`
10
+
11
+ **Your task:** Invoke the **pii skill** with these arguments.
12
+
13
+ ## Examples
14
+
15
+ - `/pii scan transcript.md`
16
+ - `/pii scan ./meeting-notes/`
17
+ - `/pii redact transcript.md --output transcript-clean.md`
18
+ - `/pii redact transcript.md --dry-run`
19
+ - `/pii redact transcript.md --entities PHONE_NUMBER,EMAIL_ADDRESS`
20
+
21
+ ## Quick Reference
22
+
23
+ ```bash
24
+ /pii scan {file} # Scan file for PII
25
+ /pii scan {dir} # Scan directory recursively
26
+ /pii redact {file} # Redact PII (writes {file}-redacted.{ext})
27
+ /pii redact {file} --output {out} # Redact to specific output path
28
+ /pii redact {file} --dry-run # Preview redactions without writing
29
+ /pii redact {file} --entities TYPES # Redact only specific entity types
30
+ /pii redact {file} --mask # Use *** instead of <ENTITY_TYPE>
31
+ ```
32
+
33
+ See the **pii skill** for full behaviour, procedure, and supported entity types.
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: pii
3
+ description: "Detect and redact PII in text files and directories. Use when scanning files for sensitive data before sharing, or redacting emails, phone numbers, credit cards, SSNs, and other PII. User prompts like '/pii scan transcript.md' or '/pii redact meeting-notes/ --dry-run'."
4
+ argument-hint: "[scan | redact] {file|dir} [--entities TYPES] [--output PATH] [--dry-run] [--mask]"
5
+ allowed-tools: [Read, Glob, Grep, Bash, Task]
6
+ ---
7
+
8
+ # PII Skill
9
+
10
+ Detect and redact personally identifiable information using Microsoft Presidio — deterministic pattern matching + NER, fully offline after first run.
11
+
12
+ ## Usage
13
+
14
+ ```bash
15
+ /pii scan transcript.md # Scan a file for PII
16
+ /pii scan ./meeting-notes/ # Scan a directory recursively
17
+ /pii redact transcript.md # Redact PII in-place (writes to transcript-redacted.md)
18
+ /pii redact transcript.md --output clean.md # Redact to specific output file
19
+ /pii redact transcript.md --dry-run # Preview redactions without writing
20
+ /pii redact transcript.md --entities PHONE_NUMBER,EMAIL_ADDRESS # Redact specific types only
21
+ /pii redact transcript.md --mask # Use *** instead of <ENTITY_TYPE> placeholders
22
+ ```
23
+
24
+ ## Procedure
25
+
26
+ ### Step 0: Ensure Presidio venv is ready
27
+
28
+ Before any scan or redact operation, verify the venv exists:
29
+
30
+ ```bash
31
+ droid exec pii presidio-init
32
+ ```
33
+
34
+ On first run this takes ~2–3 min (downloads Presidio packages + spaCy en_core_web_lg model). Subsequent runs return immediately (`already_existed: true`).
35
+
36
+ If init fails, surface the error and stop — do not attempt to run analysis without the venv.
37
+
38
+ ### Step 1: Route on subcommand
39
+
40
+ Parse the first argument:
41
+ - `scan` → proceed to Step 2
42
+ - `redact` → proceed to Step 3
43
+ - anything else → show usage and stop
44
+
45
+ ### Step 2: Scan (delegate to pii-scanner agent)
46
+
47
+ The `pii-scanner` agent runs analysis in an isolated context so raw PII values never appear in the parent conversation.
48
+
49
+ **For a single file:**
50
+ Delegate to the `pii-scanner` agent with `file_path` set to the absolute path.
51
+
52
+ **For a directory:**
53
+ Use `Glob` to find text files matching: `**/*.{md,txt,ts,js,json,yaml,yml,csv,html,xml}`
54
+ Delegate each file to `pii-scanner` individually and aggregate results.
55
+
56
+ **Display results:**
57
+ Show entity types, counts, and affected line numbers only — never print raw PII values.
58
+
59
+ Example output:
60
+ ```
61
+ transcript.md: 3 PII entities found
62
+ EMAIL_ADDRESS × 2 (lines 4, 12)
63
+ PHONE_NUMBER × 1 (line 8)
64
+ ```
65
+
66
+ ### Step 3: Redact (run presidio-redact.ts directly)
67
+
68
+ ```bash
69
+ droid exec pii presidio-redact \
70
+ --file <path> \
71
+ [--output <path>] \
72
+ [--dry-run] \
73
+ [--entities <TYPES>] \
74
+ [--mask]
75
+ ```
76
+
77
+ Parse the JSON result and display:
78
+ - Number of entities found and redacted
79
+ - Output file path (if written)
80
+ - In `--dry-run` mode: show a brief diff preview (first 10 redacted lines), but do NOT echo the full `redacted_text` field by default
81
+
82
+ **Never echo `redacted_text` in full to the terminal** unless the user explicitly requests it.
83
+
84
+ ### Step 4: Format and present results
85
+
86
+ - Always show: entity type, count, affected lines
87
+ - On success for redact: confirm output path and entity counts
88
+ - On failure: surface the error from the script's `error` field with actionable next steps
89
+
90
+ ## Behaviour Rules
91
+
92
+ - **Never print raw PII values** to the terminal — always show types + line numbers only
93
+ - For `--dry-run` redact, show a preview diff (10 lines max) not the full document
94
+ - If `python3` is not found, show a clear install message from the prerequisite check
95
+ - Binary files and unknown extensions are skipped during directory scans
96
+ - The `pii-scanner` agent handles the isolation boundary for `scan`; `redact` operates directly since the redacted output is the goal
97
+ - Supported entity types are listed in `references/supported-entities.md`