structurecc 3.2.0 → 3.3.1

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.
@@ -94,6 +94,12 @@ You are extracting structured data from a document chunk.
94
94
  - Pages: {start_page} to {end_page} (or "all" for images/small docs)
95
95
  - Output: Write JSON to {output_path}
96
96
 
97
+ ## Core Principle
98
+
99
+ **Figures are data, not decorations.**
100
+
101
+ A chart is a visual table. A graph is data in disguise. When you see axes and curves, you see data waiting to be extracted - not an image to describe.
102
+
97
103
  ## Protocol
98
104
 
99
105
  ### Step 1: SCAN
@@ -101,6 +107,7 @@ Read the document using the Read tool. Look at ALL pages in your assigned range.
101
107
  List every element you see:
102
108
  - Tables (data tables, comparison tables, any tabular data)
103
109
  - Figures (charts, graphs, images, diagrams, gels, blots, plots)
110
+ **Figures are data, not decorations. Read them like you read tables.**
104
111
  - Text blocks (paragraphs, headers, captions)
105
112
  - Equations (mathematical formulas)
106
113
  - Lists (bulleted, numbered)
@@ -119,6 +126,30 @@ Rules:
119
126
  - Include ALL flags, markers, asterisks, annotations
120
127
  - Transcribe units exactly as shown (mg/dL, not mg per dL)
121
128
 
129
+ ### Step 2B: EXTRACT FIGURE DATA
130
+
131
+ **Figures are data, not decorations.**
132
+
133
+ For every figure with axes:
134
+
135
+ 1. **Read the axes** (your coordinate system)
136
+ - X-axis: label, range, units
137
+ - Y-axis: label, range, units
138
+
139
+ 2. **Read the data points** (estimate from visual position)
140
+ - Where does each line/bar/point fall on the grid?
141
+ - For step functions: each step is a data point
142
+ - For curves: sample ~10 points across the range
143
+ - Format: [[x1, y1], [x2, y2], ...]
144
+
145
+ 3. **Read the legend** (what each series represents)
146
+ - Color, line style, label
147
+
148
+ 4. **Multi-panel = multiple extractions**
149
+ - Panel A, B, C, D each get FULL extraction
150
+
151
+ A chart without data_series values is like a table without cell values - incomplete.
152
+
122
153
  ### Step 3: STRUCTURE
123
154
  Output as JSON with this schema:
124
155
 
@@ -158,19 +189,35 @@ Output as JSON with this schema:
158
189
  }
159
190
 
160
191
  **For Figures (charts/graphs):**
192
+
193
+ Figures are data, not decorations. Extract the actual values.
194
+
161
195
  {
162
- "figure_type": "bar_chart|line_graph|scatter_plot|pie_chart|other",
163
- "description": "Brief description of what the figure shows",
196
+ "figure_type": "bar_chart|line_graph|scatter_plot|kaplan_meier|forest_plot|other",
197
+ "description": "Brief description (SECONDARY to actual data)",
164
198
  "axes": {
165
- "x": {"label": "Time (hours)", "range": [0, 24]},
166
- "y": {"label": "Concentration (ng/mL)", "range": [0, 100]}
199
+ "x": {"label": "Time (days)", "range": [0, 7000], "unit": "days"},
200
+ "y": {"label": "Cumulative Risk", "range": [0, 0.6], "unit": null}
167
201
  },
168
- "data_series": [
169
- {"name": "Control", "color": "blue", "values": [[0, 10], [6, 45], [12, 80]]},
170
- {"name": "Treatment", "color": "red", "values": [[0, 12], [6, 60], [12, 95]]}
202
+ "data_series": [ // REQUIRED - the actual data, not optional
203
+ {
204
+ "name": "HSV Group",
205
+ "color": "purple",
206
+ "line_type": "step",
207
+ "values": [[0, 0], [1000, 0.05], [2000, 0.08], [3000, 0.12], [4000, 0.16], [5000, 0.22], [6000, 0.32], [7000, 0.55]]
208
+ },
209
+ {
210
+ "name": "Control Group",
211
+ "color": "blue",
212
+ "line_type": "step",
213
+ "values": [[0, 0], [1000, 0.01], [2000, 0.02], [3000, 0.03], [4000, 0.04], [5000, 0.05], [6000, 0.06], [7000, 0.07]]
214
+ }
215
+ ],
216
+ "legend": ["HSV Group", "Control Group", "HSV 95% CI", "Control 95% CI"],
217
+ "confidence_bands": [
218
+ {"series": "HSV Group", "color": "purple shaded", "description": "95% CI"}
171
219
  ],
172
- "legend": ["Control", "Treatment"],
173
- "annotations": ["Arrow pointing to peak at t=12h"]
220
+ "annotations": []
174
221
  }
175
222
 
176
223
  **For Figures (gels/blots):**
@@ -224,6 +271,11 @@ Output as JSON with this schema:
224
271
  4. Low confidence (<0.8) = flag for review in notes
225
272
  5. For tables with merged cells, represent structure accurately
226
273
  6. Include ALL visible data points, not just a sample
274
+ 7. FIGURES ARE DATA, NOT DECORATIONS
275
+ - A chart/graph without data_series is INCOMPLETE
276
+ - Estimate numeric values from visual position on the grid
277
+ - Multi-panel figures need FULL extraction for EACH panel
278
+ - If you can see axes and curves, you can extract data
227
279
 
228
280
  ## Output
229
281
  Write your JSON to: {output_path}
package/install.js CHANGED
@@ -7,6 +7,10 @@ const os = require('os');
7
7
  const CLAUDE_DIR = path.join(os.homedir(), '.claude');
8
8
  const COMMANDS_DIR = path.join(CLAUDE_DIR, 'commands');
9
9
 
10
+ // Read version from package.json
11
+ const pkg = require('./package.json');
12
+ const VERSION = pkg.version;
13
+
10
14
  function copyFile(src, dest) {
11
15
  const destDir = path.dirname(dest);
12
16
  if (!fs.existsSync(destDir)) {
@@ -22,7 +26,7 @@ function install() {
22
26
  ║ STRUCTURECC ║
23
27
  ║ Document Structure Extraction ║
24
28
  ║ ║
25
- ║ Claude Code Plugin | v3.1
29
+ ║ Claude Code Plugin | v${VERSION.padEnd(20)}
26
30
  ║ ║
27
31
  ╚═══════════════════════════════════════════════════╝
28
32
  `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "structurecc",
3
- "version": "3.2.0",
3
+ "version": "3.3.1",
4
4
  "description": "Claude Code plugin for extracting structured data from documents using native vision and parallel Task agents",
5
5
  "author": "UTMB Diagnostic Center",
6
6
  "license": "MIT",