@ngocsangairvds/vsaf 4.1.17 → 4.1.18
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.
package/package.json
CHANGED
|
@@ -118,6 +118,7 @@ uv run --directory ~/.claude/vds-scripts --package spec_orchestrator vds-spec --
|
|
|
118
118
|
|
|
119
119
|
When fetching or exporting Confluence page content (especially BRD, KBNV, SRS pages with tables and images), you **MUST** read and follow `references/confluence-content-export.md` before proceeding. Key rules:
|
|
120
120
|
|
|
121
|
+
0. **Output to `.vsaf/docs/confluence/<page-title>/`** — never to `docs/` at project root
|
|
121
122
|
1. **Use `body.storage`** (not `body.view`) as source of truth for image references
|
|
122
123
|
2. **Only download attachments referenced in `body.storage`** — never bulk-download all attachments
|
|
123
124
|
3. **Preserve image position** in output — replace `ac:image` with `` in-place, never collect at end
|
|
@@ -2,6 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
When extracting content from a Confluence page (BRD, KBNV, SRS, or any page with tables/images), follow these rules strictly. Violations cause data loss that is invisible to the user.
|
|
4
4
|
|
|
5
|
+
## Rule 0 — Output Directory
|
|
6
|
+
|
|
7
|
+
All Confluence export artifacts **MUST** be placed under `.vsaf/docs/` in the project root, **not** in `docs/` at root.
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
<project-root>/
|
|
11
|
+
├── .vsaf/
|
|
12
|
+
│ └── docs/
|
|
13
|
+
│ └── confluence/
|
|
14
|
+
│ ├── <page-title>/
|
|
15
|
+
│ │ ├── content.md
|
|
16
|
+
│ │ └── images/
|
|
17
|
+
│ │ ├── screen-login.png
|
|
18
|
+
│ │ └── flow-diagram.png
|
|
19
|
+
│ └── <another-page>/
|
|
20
|
+
│ ├── content.md
|
|
21
|
+
│ └── images/
|
|
22
|
+
└── docs/ ← project docs, NOT for Confluence exports
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- Use `.vsaf/docs/confluence/<page-title>/` as the output directory for each page.
|
|
26
|
+
- This keeps Confluence artifacts separate from project documentation and co-located with other VSAF working files.
|
|
27
|
+
- Pass `--out .vsaf/docs/confluence/<page-title>/` when using CLI commands that accept output path.
|
|
28
|
+
|
|
5
29
|
## Rule 1 — Use `body.storage` as the Single Source of Truth for Image Refs
|
|
6
30
|
|
|
7
31
|
- **Never** rely on `body.view` for image references — it is post-render HTML that may add or drop images via macros.
|
|
@@ -71,12 +95,14 @@ If the user requests "all attachments" (audit/backup scenario):
|
|
|
71
95
|
- Report summary: `Used: N inline / Total: M attached`
|
|
72
96
|
|
|
73
97
|
```bash
|
|
74
|
-
# Download only referenced attachments
|
|
98
|
+
# Download only referenced attachments into .vsaf/docs/confluence/<page>/images/
|
|
99
|
+
OUT_DIR=".vsaf/docs/confluence/<page-title>"
|
|
100
|
+
mkdir -p "$OUT_DIR/images"
|
|
75
101
|
for filename in $REFERENCED_FILES; do
|
|
76
102
|
att_id=$(vds-cli confluence content list-attachments <PAGE_ID> --json-only \
|
|
77
103
|
| jq -r ".[] | select(.title == \"$filename\") | .id")
|
|
78
104
|
uv run --directory ~/.claude/vds-scripts --package vds-cli \
|
|
79
|
-
vds-cli confluence content download-attachment "$att_id" --out "images/$filename"
|
|
105
|
+
vds-cli confluence content download-attachment "$att_id" --out "$OUT_DIR/images/$filename"
|
|
80
106
|
done
|
|
81
107
|
```
|
|
82
108
|
|
|
@@ -98,6 +124,10 @@ Do not report success if counts diverge.
|
|
|
98
124
|
## Rule 5 — Correct Invocation Sequence (Step by Step)
|
|
99
125
|
|
|
100
126
|
```bash
|
|
127
|
+
# B0: Set output directory
|
|
128
|
+
OUT_DIR=".vsaf/docs/confluence/<page-title>"
|
|
129
|
+
mkdir -p "$OUT_DIR/images"
|
|
130
|
+
|
|
101
131
|
# B1: Fetch storage body (source of truth for image refs)
|
|
102
132
|
uv run --directory ~/.claude/vds-scripts --package vds-cli \
|
|
103
133
|
vds-cli confluence content page <PAGE_ID> --expand body.storage
|
|
@@ -106,12 +136,12 @@ uv run --directory ~/.claude/vds-scripts --package vds-cli \
|
|
|
106
136
|
|
|
107
137
|
# B3: Download only referenced attachments
|
|
108
138
|
uv run --directory ~/.claude/vds-scripts --package vds-cli \
|
|
109
|
-
vds-cli confluence content download-attachment <ATT_ID> --out images/<filename>
|
|
139
|
+
vds-cli confluence content download-attachment <ATT_ID> --out "$OUT_DIR/images/<filename>"
|
|
110
140
|
|
|
111
141
|
# B4: Convert storage XHTML → markdown (see Rule 2 Python snippet)
|
|
112
142
|
# - ac:image →  in-place
|
|
113
143
|
# - tables stay as HTML
|
|
114
|
-
# - output: content.md + images/
|
|
144
|
+
# - output: $OUT_DIR/content.md + $OUT_DIR/images/
|
|
115
145
|
|
|
116
146
|
# B5: Verify (see Rule 4)
|
|
117
147
|
```
|
|
@@ -125,3 +155,4 @@ uv run --directory ~/.claude/vds-scripts --package vds-cli \
|
|
|
125
155
|
| Flatten `<table>` to markdown `\|` pipe tables | Destroys merged cells, nested bullets, colspan/rowspan |
|
|
126
156
|
| Collect images at end of document | Breaks image↔context mapping (which screen? which step?) |
|
|
127
157
|
| Skip verification | Silent data loss — user trusts output without knowing images are missing |
|
|
158
|
+
| Export to `docs/` at project root | Pollutes project docs; use `.vsaf/docs/confluence/` instead |
|