@cesarandreslopez/occ 0.8.11 → 0.9.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 (182) hide show
  1. package/README.md +167 -77
  2. package/dist/src/cli-validation.js +3 -11
  3. package/dist/src/cli-validation.js.map +1 -1
  4. package/dist/src/cli.js +23 -11
  5. package/dist/src/cli.js.map +1 -1
  6. package/dist/src/code/build.js +28 -22
  7. package/dist/src/code/build.js.map +1 -1
  8. package/dist/src/code/cache.js +3 -1
  9. package/dist/src/code/cache.js.map +1 -1
  10. package/dist/src/code/chunk.js +4 -4
  11. package/dist/src/code/chunk.js.map +1 -1
  12. package/dist/src/code/command.js +147 -37
  13. package/dist/src/code/command.js.map +1 -1
  14. package/dist/src/code/diff.d.ts +264 -0
  15. package/dist/src/code/diff.js +504 -0
  16. package/dist/src/code/diff.js.map +1 -0
  17. package/dist/src/code/discover.js +5 -5
  18. package/dist/src/code/discover.js.map +1 -1
  19. package/dist/src/code/focus.js +5 -5
  20. package/dist/src/code/focus.js.map +1 -1
  21. package/dist/src/code/incremental.js +11 -9
  22. package/dist/src/code/incremental.js.map +1 -1
  23. package/dist/src/code/index-io.js.map +1 -1
  24. package/dist/src/code/isolated-runner.js.map +1 -1
  25. package/dist/src/code/isolated.js +2 -2
  26. package/dist/src/code/isolated.js.map +1 -1
  27. package/dist/src/code/languages.js +2 -2
  28. package/dist/src/code/languages.js.map +1 -1
  29. package/dist/src/code/map.d.ts +12 -0
  30. package/dist/src/code/map.js +22 -9
  31. package/dist/src/code/map.js.map +1 -1
  32. package/dist/src/code/output.d.ts +3 -0
  33. package/dist/src/code/output.js +39 -22
  34. package/dist/src/code/output.js.map +1 -1
  35. package/dist/src/code/parsers.js +87 -26
  36. package/dist/src/code/parsers.js.map +1 -1
  37. package/dist/src/code/query.js +44 -38
  38. package/dist/src/code/query.js.map +1 -1
  39. package/dist/src/code/rank.js +30 -17
  40. package/dist/src/code/rank.js.map +1 -1
  41. package/dist/src/code/session.js.map +1 -1
  42. package/dist/src/code/slim.js.map +1 -1
  43. package/dist/src/code/store.js +35 -23
  44. package/dist/src/code/store.js.map +1 -1
  45. package/dist/src/code/types.js +15 -3
  46. package/dist/src/code/types.js.map +1 -1
  47. package/dist/src/doc/batch.js +6 -2
  48. package/dist/src/doc/batch.js.map +1 -1
  49. package/dist/src/doc/chunk.js +9 -5
  50. package/dist/src/doc/chunk.js.map +1 -1
  51. package/dist/src/doc/command.js +18 -9
  52. package/dist/src/doc/command.js.map +1 -1
  53. package/dist/src/doc/discover.d.ts +1 -1
  54. package/dist/src/doc/discover.js.map +1 -1
  55. package/dist/src/doc/entities.js +90 -10
  56. package/dist/src/doc/entities.js.map +1 -1
  57. package/dist/src/doc/inspect-docx.js +5 -4
  58. package/dist/src/doc/inspect-docx.js.map +1 -1
  59. package/dist/src/doc/inspect-odt.js.map +1 -1
  60. package/dist/src/doc/inspect-pdf.js +1 -1
  61. package/dist/src/doc/inspect-pdf.js.map +1 -1
  62. package/dist/src/doc/inspect.js +4 -4
  63. package/dist/src/doc/inspect.js.map +1 -1
  64. package/dist/src/doc/output.js +11 -8
  65. package/dist/src/doc/output.js.map +1 -1
  66. package/dist/src/doc/references.js +4 -4
  67. package/dist/src/doc/references.js.map +1 -1
  68. package/dist/src/errors.js +2 -4
  69. package/dist/src/errors.js.map +1 -1
  70. package/dist/src/git/api.d.ts +34 -0
  71. package/dist/src/git/api.js +247 -0
  72. package/dist/src/git/api.js.map +1 -0
  73. package/dist/src/git/client.d.ts +48 -0
  74. package/dist/src/git/client.js +336 -0
  75. package/dist/src/git/client.js.map +1 -0
  76. package/dist/src/git/command.d.ts +2 -0
  77. package/dist/src/git/command.js +173 -0
  78. package/dist/src/git/command.js.map +1 -0
  79. package/dist/src/git/index.d.ts +5 -0
  80. package/dist/src/git/index.js +6 -0
  81. package/dist/src/git/index.js.map +1 -0
  82. package/dist/src/git/output.d.ts +8 -0
  83. package/dist/src/git/output.js +38 -0
  84. package/dist/src/git/output.js.map +1 -0
  85. package/dist/src/git/parse.d.ts +19 -0
  86. package/dist/src/git/parse.js +354 -0
  87. package/dist/src/git/parse.js.map +1 -0
  88. package/dist/src/git/types.d.ts +334 -0
  89. package/dist/src/git/types.js +135 -0
  90. package/dist/src/git/types.js.map +1 -0
  91. package/dist/src/index.d.ts +29 -7
  92. package/dist/src/index.js +20 -3
  93. package/dist/src/index.js.map +1 -1
  94. package/dist/src/inspect/shared.js.map +1 -1
  95. package/dist/src/markdown/convert.js +17 -11
  96. package/dist/src/markdown/convert.js.map +1 -1
  97. package/dist/src/output/tabular.js +25 -17
  98. package/dist/src/output/tabular.js.map +1 -1
  99. package/dist/src/output/tree.js +7 -7
  100. package/dist/src/output/tree.js.map +1 -1
  101. package/dist/src/parsers/docx.js +1 -1
  102. package/dist/src/parsers/docx.js.map +1 -1
  103. package/dist/src/parsers/index.js +9 -7
  104. package/dist/src/parsers/index.js.map +1 -1
  105. package/dist/src/parsers/pdf.js +1 -1
  106. package/dist/src/parsers/pdf.js.map +1 -1
  107. package/dist/src/parsers/pptx.js.map +1 -1
  108. package/dist/src/parsers/xlsx.js +5 -3
  109. package/dist/src/parsers/xlsx.js.map +1 -1
  110. package/dist/src/progress-event.d.ts +1 -1
  111. package/dist/src/progress-event.js +1 -0
  112. package/dist/src/progress-event.js.map +1 -1
  113. package/dist/src/scc.js +9 -5
  114. package/dist/src/scc.js.map +1 -1
  115. package/dist/src/sheet/command.js +11 -7
  116. package/dist/src/sheet/command.js.map +1 -1
  117. package/dist/src/sheet/inspect.js +14 -14
  118. package/dist/src/sheet/inspect.js.map +1 -1
  119. package/dist/src/sheet/output.js +10 -15
  120. package/dist/src/sheet/output.js.map +1 -1
  121. package/dist/src/skills/command.d.ts +2 -0
  122. package/dist/src/skills/command.js +188 -0
  123. package/dist/src/skills/command.js.map +1 -0
  124. package/dist/src/slide/command.js +8 -6
  125. package/dist/src/slide/command.js.map +1 -1
  126. package/dist/src/slide/inspect-odp.js.map +1 -1
  127. package/dist/src/slide/inspect-pptx.js +5 -2
  128. package/dist/src/slide/inspect-pptx.js.map +1 -1
  129. package/dist/src/slide/inspect.js +4 -2
  130. package/dist/src/slide/inspect.js.map +1 -1
  131. package/dist/src/slide/output.js +10 -15
  132. package/dist/src/slide/output.js.map +1 -1
  133. package/dist/src/slide/types.js.map +1 -1
  134. package/dist/src/stats.js +31 -3
  135. package/dist/src/stats.js.map +1 -1
  136. package/dist/src/table/command.js +8 -6
  137. package/dist/src/table/command.js.map +1 -1
  138. package/dist/src/table/inspect-docx.js +1 -1
  139. package/dist/src/table/inspect-docx.js.map +1 -1
  140. package/dist/src/table/inspect-odt.js.map +1 -1
  141. package/dist/src/table/inspect-pptx.js +5 -2
  142. package/dist/src/table/inspect-pptx.js.map +1 -1
  143. package/dist/src/table/inspect-xlsx.js +1 -1
  144. package/dist/src/table/inspect-xlsx.js.map +1 -1
  145. package/dist/src/table/inspect.js +3 -1
  146. package/dist/src/table/inspect.js.map +1 -1
  147. package/dist/src/table/output.js +7 -11
  148. package/dist/src/table/output.js.map +1 -1
  149. package/dist/src/table/types.js.map +1 -1
  150. package/dist/src/tokens.js +1 -1
  151. package/dist/src/tokens.js.map +1 -1
  152. package/dist/src/utils.js +6 -11
  153. package/dist/src/utils.js.map +1 -1
  154. package/dist/src/walker.js +2 -4
  155. package/dist/src/walker.js.map +1 -1
  156. package/dist/src/workspace/analyze.js +4 -4
  157. package/dist/src/workspace/analyze.js.map +1 -1
  158. package/dist/src/workspace/bundle.d.ts +27 -0
  159. package/dist/src/workspace/bundle.js +157 -54
  160. package/dist/src/workspace/bundle.js.map +1 -1
  161. package/dist/src/workspace/command.js +31 -16
  162. package/dist/src/workspace/command.js.map +1 -1
  163. package/dist/src/workspace/describe-output.js +10 -9
  164. package/dist/src/workspace/describe-output.js.map +1 -1
  165. package/dist/src/workspace/describe.js +54 -47
  166. package/dist/src/workspace/describe.js.map +1 -1
  167. package/dist/src/workspace/documents.js +28 -8
  168. package/dist/src/workspace/documents.js.map +1 -1
  169. package/dist/src/workspace/prepare-runner.js.map +1 -1
  170. package/dist/src/workspace/prepare-types.js.map +1 -1
  171. package/dist/src/workspace/prepare.js +38 -19
  172. package/dist/src/workspace/prepare.js.map +1 -1
  173. package/dist/src/workspace/types.js +4 -2
  174. package/dist/src/workspace/types.js.map +1 -1
  175. package/package.json +57 -4
  176. package/scripts/postinstall.js +13 -9
  177. package/skills/occ/SKILL.md +77 -0
  178. package/skills/occ/reference/code.md +69 -0
  179. package/skills/occ/reference/commands.md +66 -0
  180. package/skills/occ/reference/documents.md +65 -0
  181. package/skills/occ/reference/git.md +55 -0
  182. package/skills/occ/reference/workspace.md +65 -0
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: occ
3
+ description: >-
4
+ Use the occ CLI to explore unfamiliar repositories and office documents
5
+ efficiently for AI coding tasks. occ ("Office Cloc and Count") emits
6
+ token-budgeted, JSON-first output for three jobs: workspace reconnaissance
7
+ with "occ describe" and "occ workspace analyze"; office-document and table
8
+ triage for DOCX, PDF, XLSX, PPTX, ODT, ODS, and ODP with "occ doc inspect",
9
+ "occ sheet inspect", "occ slide inspect", and "occ table inspect"; and code
10
+ exploration for JS/TS, Vue SFC, and Python with "occ code map", "occ code
11
+ pack", "occ code find", "occ code analyze", "occ code diff", and "occ git
12
+ diff". Reach for it whenever you need to understand a codebase or a set of
13
+ office files without burning context reading everything, or whenever the user
14
+ mentions occ.
15
+ metadata:
16
+ version: 0.9.0
17
+ license: MIT
18
+ ---
19
+
20
+ # occ — Office Cloc and Count
21
+
22
+ `occ` is a **read-only** analysis CLI that helps an agent understand a repository
23
+ or a set of office documents _cheaply_, before spending context reading files in
24
+ full. It never modifies the target project. It shells out to a vendored `scc`
25
+ for code metrics and to `git` for git context.
26
+
27
+ Design principles to lean on:
28
+
29
+ - **JSON-first** — pass `--format json` to almost any command for machine-parseable output.
30
+ - **Token-budgeted** — `occ code map/pack` and `occ code diff` accept `--map-tokens <n>`
31
+ (and the root scan accepts `--token-budget <n>`). Pair with `--tokenizer o200k_base`
32
+ (or `cl100k_base`) for an _exact_ BPE budget instead of the default heuristic estimate.
33
+ - **Stream large output to a file** — for big maps/packs/analyses, add `-o <file>` and
34
+ read it back selectively rather than flooding the conversation.
35
+
36
+ ## Invocation
37
+
38
+ ```bash
39
+ occ <command> ... # if installed globally (npm i -g @cesarandreslopez/occ)
40
+ npx @cesarandreslopez/occ <command> ... # without a global install
41
+ ```
42
+
43
+ Run `occ --help` or `occ <group> --help` to see every flag.
44
+
45
+ ## Decision table — pick the right command
46
+
47
+ | If you need to… | Start with | Deep reference |
48
+ | ------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------ |
49
+ | Tell what kind of project a directory is | `occ describe <dir> --format json` | [reference/workspace.md](reference/workspace.md) |
50
+ | Inventory a whole workspace (code + docs + structure) | `occ workspace analyze <dir> --format json -o ws.json` | [reference/workspace.md](reference/workspace.md) |
51
+ | Inventory / cross-reference office docs in a tree | `occ workspace documents <dir> --format json` | [reference/workspace.md](reference/workspace.md) |
52
+ | Get document + code metrics for some directories | `occ <dirs> --format json --structure` | [reference/workspace.md](reference/workspace.md) |
53
+ | Preflight one DOCX / PDF / ODT before reading it | `occ doc inspect <file> --format json` | [reference/documents.md](reference/documents.md) |
54
+ | Preflight an XLSX workbook (schema, sheets, risks) | `occ sheet inspect <file> --format json` | [reference/documents.md](reference/documents.md) |
55
+ | Preflight a PPTX / ODP deck | `occ slide inspect <file> --format json` | [reference/documents.md](reference/documents.md) |
56
+ | Extract structured table data from a document | `occ table inspect <file> --format json` | [reference/documents.md](reference/documents.md) |
57
+ | Pull entities/keywords (emails, URLs, dates) from a doc | `occ doc entities <file>` | [reference/documents.md](reference/documents.md) |
58
+ | Get oriented in an unfamiliar codebase | `occ code map --path . --map-tokens 8000 --tokenizer o200k_base -o map.md` | [reference/code.md](reference/code.md) |
59
+ | Pull file _contents_ within a token budget | `occ code pack --path . --map-tokens 8000 --tokenizer o200k_base -o pack.md` | [reference/code.md](reference/code.md) |
60
+ | Find a symbol / concept (best-effort) | `occ code find fused "<query>" --format json` | [reference/code.md](reference/code.md) |
61
+ | Find an exact symbol by name or type | `occ code find name <Name> --format json` | [reference/code.md](reference/code.md) |
62
+ | See who calls X / what X calls | `occ code analyze callers <fn>` · `occ code analyze calls <fn>` | [reference/code.md](reference/code.md) |
63
+ | Inspect imports / module coupling | `occ code analyze deps <target>` · `occ code analyze coupling <target>` | [reference/code.md](reference/code.md) |
64
+ | See which _symbols_ changed in a diff | `occ code diff --base <ref> --map-tokens 4096 --format json` | [reference/code.md](reference/code.md) |
65
+ | List changed files / bounded patch / churn | `occ git changed` · `occ git diff --patch --map-tokens 2048` · `occ git churn` | [reference/git.md](reference/git.md) |
66
+
67
+ ## Recommended agent workflows
68
+
69
+ - **Land in a new repo:** `occ describe . --format json` → `occ code map --path . --map-tokens 8000 --tokenizer o200k_base -o map.md`, read the map, then drill in with `occ code find` / `occ code analyze`.
70
+ - **Review a change:** `occ git changed` → `occ code diff --base <base> --format json` for symbol-level scope → `occ git diff --patch --map-tokens 4096` for a bounded patch.
71
+ - **Process a document drop:** `occ <dir> --format json` for the inventory → `occ doc/sheet/slide inspect --format json` per file → `occ table inspect` to pull tabular data → read only what matters.
72
+
73
+ ## Notes
74
+
75
+ - For the full flag list of every command, read [reference/commands.md](reference/commands.md).
76
+ - Languages with first-class code support: JavaScript, TypeScript, Vue SFC, and Python.
77
+ - `--format json` is the integration surface; tabular output is for humans.
@@ -0,0 +1,69 @@
1
+ # Code exploration for agents
2
+
3
+ `occ code` builds an in-memory code graph (no database, no daemon) for JS/TS,
4
+ Vue SFC, and Python. Shared flags on every `code` subcommand: `--path
5
+ <repo-root>` (default cwd), `--format json`, `-o <file>`, `--exclude-dir`,
6
+ `--no-gitignore`, `--content-mode none|excerpt|full`, `--max-file-size-bytes
7
+ <n>`, `--max-lines <n>`.
8
+
9
+ ## Orientation — `occ code map` / `occ code pack`
10
+
11
+ Token-budgeted, PageRank-ranked output. `map` emits top symbol _signatures_ per
12
+ file; `pack` emits file _content_ (optionally compressed). This is the primary
13
+ "understand this repo cheaply" tool.
14
+
15
+ ```bash
16
+ occ code map --path . --map-tokens 8000 --tokenizer o200k_base -o map.md
17
+ occ code pack --path . --map-tokens 8000 --tokenizer o200k_base -o pack.md
18
+ ```
19
+
20
+ Shared map/pack flags: `--map-tokens <n>` (default 4096; alias `--token-budget`),
21
+ `--tokenizer heuristic|o200k_base|cl100k_base`, `--map-format markdown|xml|json|plain`,
22
+ `--mode map|pack`, `--compress` (pack), `--max-symbols <n>`, `--no-bias-exports`.
23
+
24
+ Focus the map toward a task (boost relevant files/symbols):
25
+ `--query "<text>"`, `--focus-path <path>` (repeatable), `--focus-depth <n>`,
26
+ `--changed-from <ref>`, `--changed-to <ref>`, `--staged`.
27
+
28
+ ```bash
29
+ occ code map --path . --query "auth token refresh" --focus-path src/auth --map-tokens 4096
30
+ occ code map --path . --changed-from main --map-tokens 4096 # diff-focused map
31
+ ```
32
+
33
+ ## Search — `occ code find <mode>`
34
+
35
+ - `occ code find fused "<query>"` — combines name + pattern + content search with
36
+ rank fusion (`--weights name:3,pattern:2,content:1`). Best when unsure.
37
+ - `occ code find name <name>` — exact symbol name. `--file <path>` to disambiguate, `--type <node-type>`.
38
+ - `occ code find pattern <substr>` — substring match on names.
39
+ - `occ code find type <nodeType>` — list all nodes of a type (`file|module|function|class|interface|type-alias|enum|variable`).
40
+ - `occ code find content <text>` — full-text search (auto-upgrades to `--content-mode full`).
41
+
42
+ All accept `--limit <n>` (default 50) and `--format json`.
43
+
44
+ ## Relationships — `occ code analyze <kind>`
45
+
46
+ - `occ code analyze calls <fn>` — what a function calls (outgoing).
47
+ - `occ code analyze callers <fn>` — what calls a function (incoming, impact analysis).
48
+ - `occ code analyze chain <fromFn> <toFn>` — call paths between two functions (`--depth <n>`, default 5).
49
+ - `occ code analyze deps <target>` — module/file import relationships (local/external/unresolved).
50
+ - `occ code analyze coupling <target>` — module-level coupling metrics.
51
+ - `occ code analyze tree <className>` — class/interface inheritance.
52
+
53
+ `calls`/`callers`/`tree` accept `--file <path>` to disambiguate. Relationships
54
+ report `resolved` / `ambiguous` / `unresolved` status explicitly.
55
+
56
+ ## Change-aware — `occ code diff` / `occ code history`
57
+
58
+ ```bash
59
+ occ code diff --base main --map-tokens 4096 --format json # which symbols changed
60
+ occ code history buildRepoMap --format json # git line history for a symbol
61
+ ```
62
+
63
+ `code diff` flags: `--base <ref>`, `--head <ref>`, `--staged`, `--map-tokens
64
+ <n>` (default 4096), `--tokenizer`. See also [git.md](git.md) for raw patches.
65
+
66
+ ## Full index — `occ code index`
67
+
68
+ Build/dump the full codebase index (files, symbols, edges, capabilities). Heavy;
69
+ prefer `map`/`find`/`analyze` for targeted questions.
@@ -0,0 +1,66 @@
1
+ # Command cheat-sheet
2
+
3
+ Every `occ` command with its canonical one-line description. Run `occ <group>
4
+ --help` for the authoritative flag list. Most commands accept `--format
5
+ tabular|json`, `-o <file>`, and `--ci`.
6
+
7
+ ## Root
8
+
9
+ - `occ [directories...]` — Office Cloc and Count: scc-style summary tables for office documents. Flags: `--by-file`, `--structure`, `--quick`, `--include-ext`/`--exclude-ext`/`--exclude-dir`, `--no-gitignore`, `--sort files|name|words|size`, `--token-budget <n>`, `--tokenizer`, `--large-file-limit <mb>`, `--no-code`.
10
+ - `occ describe [directories...]` — Quickly classify one or more directories from fast file and manifest signals.
11
+
12
+ ## `occ workspace` — Workspace-level analysis and document context helpers
13
+
14
+ - `occ workspace describe [rootDir]` — Quickly classify a workspace from fast file and manifest signals.
15
+ - `occ workspace analyze [rootDir]` — Analyze workspace code, documents, and structures with a versioned JSON contract. (default JSON)
16
+ - `occ workspace documents [rootDir]` — Inspect workspace document summaries and cross-document references. (default JSON)
17
+
18
+ ## `occ doc` — Inspect document structure and content before deep reading
19
+
20
+ - `occ doc inspect <file>` — Inspect DOCX, PDF, or ODT document metadata, structure, and content preview.
21
+ - `occ doc entities <file>` — Extract entities (emails, URLs, dates, phone numbers, mentions) and keywords from a document.
22
+ - `occ doc references [directories...]` — Detect cross-references between documents in directories.
23
+
24
+ ## `occ sheet` — Inspect spreadsheet structure and content before deep reading
25
+
26
+ - `occ sheet inspect <file>` — Inspect XLSX workbook metadata, sheet inventory, schema, and token estimates.
27
+
28
+ ## `occ slide` — Inspect presentation structure and content before deep reading
29
+
30
+ - `occ slide inspect <file>` — Inspect PPTX or ODP presentation metadata, slides, and content preview.
31
+
32
+ ## `occ table` — Extract and inspect table content from documents
33
+
34
+ - `occ table inspect <file>` — Extract structured table data from DOCX, XLSX, PPTX, ODT, or ODP documents.
35
+
36
+ ## `occ code` — Explore code structure with first-class JS/TS and Python support
37
+
38
+ - `occ code map` — Token-budgeted, importance-ranked repo map (top symbol signatures per file).
39
+ - `occ code pack` — Token-budgeted, importance-ranked pack (file content, optionally compressed).
40
+ - `occ code index` — Build the full codebase index (files, symbols, edges, capabilities).
41
+ - `occ code find name <name>` — Find code elements by exact name.
42
+ - `occ code find pattern <pattern>` — Find code elements by substring pattern.
43
+ - `occ code find type <nodeType>` — List all nodes of a given type.
44
+ - `occ code find content <text>` — Search code content (full source text).
45
+ - `occ code find fused <query>` — Fused search combining name, pattern, and content with rank fusion.
46
+ - `occ code analyze calls <fn>` — Show what a function calls (outgoing calls).
47
+ - `occ code analyze callers <fn>` — Show what calls a function (incoming calls).
48
+ - `occ code analyze chain <fromFn> <toFn>` — Find call paths between two functions.
49
+ - `occ code analyze deps <target>` — Show module/file import relationships.
50
+ - `occ code analyze coupling <target>` — Show module-level coupling metrics.
51
+ - `occ code analyze tree <className>` — Show class/interface inheritance relationships.
52
+ - `occ code diff` — Show changed symbols for a git diff range.
53
+ - `occ code history <symbol>` — Show git line history for a symbol.
54
+
55
+ ## `occ git` — Inspect git changes, history, and churn
56
+
57
+ - `occ git changed` — List changed files for the resolved diff range.
58
+ - `occ git diff` — Summarize or render the resolved diff (`--patch` for a bounded raw patch).
59
+ - `occ git history [file]` — Show commit history for a range or file.
60
+ - `occ git churn` — Rank changed files by churn.
61
+
62
+ ## `occ skills` — Install and inspect the Agent Skills bundled with occ
63
+
64
+ - `occ skills install [--agent claude|codex|all] [--user|--project] [--project-root <dir>] [--force] [--link]` — Install occ Agent Skills into one or more coding agents.
65
+ - `occ skills list [--format json]` — List the Agent Skills bundled with occ.
66
+ - `occ skills path` — Print the path to occ's bundled Agent Skills.
@@ -0,0 +1,65 @@
1
+ # Office-document & table triage
2
+
3
+ Preflight a document with `inspect` (JSON) _before_ deciding to read it in full.
4
+ All commands accept `--format json`, `-o <file>`, and `--ci`.
5
+
6
+ ## `occ doc inspect <file>`
7
+
8
+ Inspect DOCX, PDF, or ODT document metadata, structure, and content preview —
9
+ metadata, risk flags, content stats, heading tree, and a short preview.
10
+
11
+ ```bash
12
+ occ doc inspect report.docx --format json
13
+ occ doc inspect report.pdf --sample-paragraphs 10
14
+ ```
15
+
16
+ Flags: `--sample-paragraphs <n>` (default 5), `--no-structure` (skip heading tree).
17
+
18
+ ## `occ doc entities <file>`
19
+
20
+ Extract entities (emails, URLs, dates, phone numbers, mentions) and keywords
21
+ from a document. Defaults to `--format json`.
22
+
23
+ ## `occ doc references [directories...]`
24
+
25
+ Detect cross-references between documents across directories. Defaults to JSON.
26
+ Flags: `--exclude-dir`, `--no-gitignore`, `--ignore-pattern`.
27
+
28
+ ## `occ sheet inspect <file>`
29
+
30
+ Inspect XLSX workbook metadata, sheet inventory, schema hints, and lightweight
31
+ samples — including hidden sheets, named ranges, formulas, links, comments, and
32
+ token estimates.
33
+
34
+ ```bash
35
+ occ sheet inspect finance.xlsx --format json --sample-rows 3 --max-columns 12
36
+ occ sheet inspect finance.xlsx --sheet "Q3" # name or 1-based index
37
+ ```
38
+
39
+ Flags: `--sheet <selector>`, `--sample-rows <n>` (default 5), `--header-row
40
+ auto|none|<n>` (default auto), `--max-columns <n>` (default 50).
41
+
42
+ ## `occ slide inspect <file>`
43
+
44
+ Inspect PPTX or ODP presentation metadata, per-slide inventory, risk flags, and
45
+ content preview.
46
+
47
+ Flags: `--sample-slides <n>` (default 3), `--slide <number>` (1-based).
48
+
49
+ ## `occ table inspect <file>`
50
+
51
+ Extract structured table data from DOCX, XLSX, PPTX, ODT, or ODP documents —
52
+ auto-detected headers, sample-row limits, merged-cell support.
53
+
54
+ ```bash
55
+ occ table inspect report.docx --format json
56
+ occ table inspect finance.xlsx --table 2 --sample-rows 50
57
+ ```
58
+
59
+ Flags: `--table <n>` (1-based), `--sample-rows <n>` (default 20), `--header-row
60
+ auto|none|<n>`.
61
+
62
+ ## Pattern
63
+
64
+ `inspect --format json` → read the schema / risk flags / token estimate → only
65
+ then read full content (or extract tables) if the document is actually relevant.
@@ -0,0 +1,55 @@
1
+ # Git context
2
+
3
+ Inspect git changes, history, and churn. Shared flags: `--path <repo-root>`
4
+ (default cwd), `--base <ref>`, `--head <ref>`, `--staged`, `--format
5
+ tabular|json`, `-o <file>`. The diff range is resolved from `--base`/`--head`/
6
+ `--staged` (defaults to the working-tree changes when unspecified).
7
+
8
+ ## `occ git changed`
9
+
10
+ List changed files for the resolved diff range — a quick scope check.
11
+
12
+ ```bash
13
+ occ git changed --path .
14
+ occ git changed --base main --format json
15
+ ```
16
+
17
+ ## `occ git diff`
18
+
19
+ Summarize the resolved diff, or render it as a bounded patch.
20
+
21
+ ```bash
22
+ occ git diff --format json # summary (files, +/- counts)
23
+ occ git diff --patch --map-tokens 2048 --tokenizer o200k_base # raw patch, token-bounded
24
+ ```
25
+
26
+ Flags: `--patch` (raw unified diff instead of summary), `--map-tokens <n>` +
27
+ `--tokenizer` to cap patch size.
28
+
29
+ ## `occ git history [file]`
30
+
31
+ Show commit history for a range or a file (hash, author date, subject).
32
+
33
+ ```bash
34
+ occ git history src/cli.ts --limit 10
35
+ occ git history --since 2025-01-01 --format json
36
+ ```
37
+
38
+ Flags: `--limit <n>` (default 50), `--since <date>`, `--follow` (track renames),
39
+ `--line-start <n>` / `--line-end <n>` (for `git log -L` line history).
40
+
41
+ ## `occ git churn`
42
+
43
+ Rank changed files by churn — find hotspots worth attention.
44
+
45
+ ```bash
46
+ occ git churn --sort churn --limit 20 --format json
47
+ ```
48
+
49
+ Flags: `--sort churn|commits|added|deleted|net` (default churn), `--limit <n>`,
50
+ `--since <date>`.
51
+
52
+ ## Symbol-level changes
53
+
54
+ To see which _symbols_ (not just files/lines) changed, use `occ code diff`
55
+ (see [code.md](code.md)).
@@ -0,0 +1,65 @@
1
+ # Workspace reconnaissance
2
+
3
+ Use these to understand _what a directory is_ and inventory its contents before
4
+ reading anything in depth. All accept `--format json` and `-o <file>`.
5
+
6
+ ## `occ [directories...]` — the root scan
7
+
8
+ scc-style summary tables for office documents (and, by default, `scc` code metrics).
9
+
10
+ ```bash
11
+ occ docs/ reports/ # tabular metrics grouped by type
12
+ occ . --format json # machine-readable inventory
13
+ occ . --structure --format json # also extract heading trees (RAG-friendly, with char offsets)
14
+ occ . --quick # file count + size by extension, skip parsing (fast)
15
+ ```
16
+
17
+ Useful flags: `-f, --by-file` (row per file), `--include-ext`/`--exclude-ext`,
18
+ `--exclude-dir <dirs>` (default `node_modules,.git`), `--no-gitignore`,
19
+ `--sort files|name|words|size`, `--token-budget <n>` with `--tokenizer
20
+ heuristic|o200k_base|cl100k_base`, `--large-file-limit <mb>` (default 50),
21
+ `--no-code` (skip scc), `-o <file>`, `--ci` (ASCII only).
22
+
23
+ ## `occ describe [directories...]`
24
+
25
+ Quickly classify one or more directories from fast file and manifest signals
26
+ (is this a code / office / documentation / data / mixed project?).
27
+
28
+ ```bash
29
+ occ describe . --format json
30
+ occ describe apps/* --quiet # summary only
31
+ ```
32
+
33
+ Flags: `--full` (full report), `--quiet` (summary only), `--max-projects <n>`
34
+ (default 25), `--exclude-dir`, `--no-gitignore`, `-o`.
35
+
36
+ ## `occ workspace describe [rootDir]`
37
+
38
+ Same classification as `occ describe`, scoped to a single workspace root.
39
+
40
+ ## `occ workspace analyze [rootDir]`
41
+
42
+ Analyze workspace code, documents, and structures with a versioned JSON contract.
43
+ Defaults to `--format json`. This is the one-call snapshot for agents.
44
+
45
+ ```bash
46
+ occ workspace analyze . -o ws.json
47
+ occ workspace analyze . --no-documents # code + structures only
48
+ ```
49
+
50
+ Flags: `--no-code`, `--no-documents`, `--no-structures`, `--exclude-dir`,
51
+ `--large-file-limit <mb>`, `--no-gitignore`, `-o`.
52
+
53
+ ## `occ workspace documents [rootDir]`
54
+
55
+ Inspect workspace document summaries and cross-document references. Defaults to
56
+ `--format json`.
57
+
58
+ Flags: `--max-files <n>` (default 50), `--max-reference-files <n>` (default 20),
59
+ `--include-markdown`, `--exclude-dir`, `-o`.
60
+
61
+ ## Suggested sequence
62
+
63
+ 1. `occ describe . --format json` — what am I looking at?
64
+ 2. `occ workspace analyze . --format json -o ws.json` — full inventory.
65
+ 3. Drill into specifics with the code or document commands.