@caddis/cli 0.4.16 → 0.4.19

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.
@@ -38,8 +38,22 @@ import shutil
38
38
  import subprocess
39
39
  import sys
40
40
  import time
41
+ import datetime
42
+ import traceback
41
43
  from pathlib import Path
42
44
 
45
+ _DEBUG_LOG = Path.home() / ".caddis" / "statusline_debug.log"
46
+ def _debug_log(msg: str):
47
+ if not os.environ.get("CADDIS_STATUSLINE_DEBUG"):
48
+ return
49
+ try:
50
+ with open(_DEBUG_LOG, "a", encoding="utf-8") as f:
51
+ f.write(f"[{datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')}] [PID {os.getpid()}] {msg}\n")
52
+ except Exception:
53
+ pass
54
+
55
+ _debug_log(f"INVOKE: argv={sys.argv} cwd={os.getcwd()}")
56
+
43
57
  # --------------------------------------------------------------------------------------
44
58
  # Config
45
59
  # --------------------------------------------------------------------------------------
@@ -186,17 +200,30 @@ def term_width() -> int:
186
200
  # Host facts the payload does not carry
187
201
  # --------------------------------------------------------------------------------------
188
202
 
203
+ _GIT_CACHE_FILE = Path.home() / ".caddis" / ".git_status_cache.json"
204
+
205
+
189
206
  def git_facts(cwd: str) -> dict:
190
207
  """One `git status --porcelain=v2 --branch` call -> branch, staged/unstaged/untracked,
191
- ahead/behind. The v2 format gives all of it in a single invocation, which is why the
192
- old bash line dropped its two-calls-plus-grep-plus-awk approach."""
208
+ ahead/behind. Uses a 2-second cache file per cwd to eliminate git process thrashing on rapid
209
+ status updates."""
193
210
  out = {"branch": "", "staged": 0, "unstaged": 0, "untracked": 0, "ahead": 0, "behind": 0}
194
211
  if not cwd or not os.path.isdir(cwd):
195
212
  return out
213
+
214
+ now = time.time()
215
+ try:
216
+ if _GIT_CACHE_FILE.exists():
217
+ cached = json.loads(_GIT_CACHE_FILE.read_text(encoding="utf-8"))
218
+ if cached.get("cwd") == cwd and (now - cached.get("time", 0)) < 2.0:
219
+ return cached.get("facts", out)
220
+ except Exception:
221
+ pass
222
+
196
223
  try:
197
224
  proc = subprocess.run(
198
225
  ["git", "-C", cwd, "--no-optional-locks", "status", "--porcelain=v2", "--branch"],
199
- stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, timeout=1.0,
226
+ stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, timeout=0.8,
200
227
  )
201
228
  text = proc.stdout.decode("utf-8", "replace")
202
229
  except Exception:
@@ -223,6 +250,12 @@ def git_facts(cwd: str) -> dict:
223
250
  out["unstaged"] += 1
224
251
  elif line.startswith("? "):
225
252
  out["untracked"] += 1
253
+
254
+ try:
255
+ _GIT_CACHE_FILE.write_text(json.dumps({"cwd": cwd, "time": now, "facts": out}), encoding="utf-8")
256
+ except Exception:
257
+ pass
258
+
226
259
  return out
227
260
 
228
261
 
@@ -722,7 +755,19 @@ def wire_host(host: str, settings_path: Path, command: str, dry_run: bool) -> in
722
755
  if host == "agy":
723
756
  entry["enabled"] = True # agy ignores a statusLine block without this
724
757
 
725
- if data.get("statusLine") == entry:
758
+ changed = False
759
+ if data.get("statusLine") != entry:
760
+ data["statusLine"] = entry
761
+ changed = True
762
+
763
+ if host == "agy":
764
+ title_cmd = command.replace("--profile agy", "--title")
765
+ title_entry = {"type": "command", "command": title_cmd, "enabled": True}
766
+ if data.get("title") != title_entry:
767
+ data["title"] = title_entry
768
+ changed = True
769
+
770
+ if not changed:
726
771
  print(" ok %-6s already wired" % host)
727
772
  return 0
728
773
 
@@ -730,7 +775,6 @@ def wire_host(host: str, settings_path: Path, command: str, dry_run: bool) -> in
730
775
  if settings_path.exists():
731
776
  backup = settings_path.with_suffix(settings_path.suffix + ".bak-caddis-statusline")
732
777
  shutil.copyfile(str(settings_path), str(backup))
733
- data["statusLine"] = entry
734
778
  settings_path.write_text(json.dumps(data, indent=2) + "\n", encoding="utf-8")
735
779
  print(" ok %-6s wired -> %s" % (host, settings_path))
736
780
  return 0
@@ -761,6 +805,12 @@ def check() -> int:
761
805
  else:
762
806
  print(" !! %-6s points elsewhere: %s" % (host, cmd))
763
807
  bad += 1
808
+ if host == "agy":
809
+ t_entry = data.get("title")
810
+ if isinstance(t_entry, dict) and "statusline.py" in str(t_entry.get("command", "")) and "--title" in str(t_entry.get("command", "")):
811
+ print(" ok agy-title %s" % t_entry.get("command"))
812
+ else:
813
+ print(" -- agy-title not wired to statusline.py (run --install to wire)")
764
814
  return bad
765
815
 
766
816
 
@@ -815,6 +865,7 @@ def main(argv=None) -> int:
815
865
  parser.add_argument("--sample", action="store_true", help="render a fake payload (preview / test)")
816
866
  parser.add_argument("--dry-run", action="store_true", help="with --install: print, write nothing")
817
867
  parser.add_argument("--no-color", action="store_true", help="render without ANSI colour")
868
+ parser.add_argument("--title", action="store_true", help="render terminal title (agy)")
818
869
  args = parser.parse_args(argv)
819
870
 
820
871
  # The line is Unicode. On Windows the default cp1252 stdout raises on ◆/⎇/█.
@@ -827,6 +878,21 @@ def main(argv=None) -> int:
827
878
  except Exception:
828
879
  pass
829
880
 
881
+ if args.title:
882
+ cwd = os.getcwd()
883
+ repo = os.path.basename(cwd) or cwd
884
+ facts = git_facts(cwd)
885
+ branch = facts.get("branch", "")
886
+ if branch:
887
+ print(f"agy: {repo} [{branch}]")
888
+ else:
889
+ print(f"agy: {repo}")
890
+ try:
891
+ sys.stdout.flush()
892
+ except Exception:
893
+ pass
894
+ return 0
895
+
830
896
  if args.install:
831
897
  hosts = ["claude", "agy"] if args.host == "both" else [args.host]
832
898
  return 1 if install(hosts, args.dry_run) else 0
@@ -838,31 +904,39 @@ def main(argv=None) -> int:
838
904
  if args.no_color:
839
905
  cfg["color"] = False
840
906
 
907
+ t0 = time.time()
841
908
  if args.sample:
842
909
  data = SAMPLES[args.profile]
843
910
  else:
844
911
  try:
845
912
  raw = sys.stdin.read()
846
- except Exception:
913
+ except Exception as e:
914
+ _debug_log(f"stdin.read exception: {e}")
847
915
  raw = ""
916
+ _debug_log(f"stdin read: {len(raw)} bytes in {time.time()-t0:.3f}s")
848
917
  start = raw.find("{") # strip a UTF-8 BOM or any leading noise
849
918
  try:
850
919
  data = json.loads(raw[start:]) if start >= 0 else {}
851
- except Exception:
920
+ except Exception as e:
921
+ _debug_log(f"json.loads exception: {e}")
852
922
  data = {}
853
923
  if not isinstance(data, dict):
854
924
  data = {}
855
925
 
856
926
  try:
857
927
  line = RENDERERS[args.profile](data, cfg)
858
- except Exception:
928
+ _debug_log(f"Rendered in {time.time()-t0:.3f}s")
929
+ except Exception as e:
930
+ _debug_log(f"Renderer exception: {traceback.format_exc()}")
859
931
  # A status line must never break the host. Degrade to the directory name.
860
932
  line = os.path.basename(os.getcwd())
861
933
 
862
934
  try:
863
935
  print(line)
864
936
  sys.stdout.flush()
865
- except (BrokenPipeError, OSError):
937
+ _debug_log(f"Printed and flushed in {time.time()-t0:.3f}s")
938
+ except (BrokenPipeError, OSError) as e:
939
+ _debug_log(f"BrokenPipeError on flush: {e}")
866
940
  # Parent process cancelled or closed stdout pipe (e.g. agy runner on user prompt/state switch).
867
941
  # Redirecting to devnull prevents Windows Python from throwing unhandled TextIOWrapper errors on exit.
868
942
  try:
@@ -871,7 +945,8 @@ def main(argv=None) -> int:
871
945
  except Exception:
872
946
  pass
873
947
  return 0
874
- except Exception:
948
+ except Exception as e:
949
+ _debug_log(f"Flush exception: {e}")
875
950
  return 0
876
951
 
877
952
  return 0
@@ -880,10 +955,12 @@ def main(argv=None) -> int:
880
955
  if __name__ == "__main__":
881
956
  try:
882
957
  code = main()
883
- except BaseException:
958
+ except BaseException as e:
959
+ _debug_log(f"Unhandled exception in main: {traceback.format_exc()}")
884
960
  code = 0
885
961
  try:
886
962
  sys.stdout.flush()
887
- except Exception:
888
- pass
889
- sys.exit(code)
963
+ except Exception as e:
964
+ _debug_log(f"Final flush exception: {e}")
965
+ _debug_log(f"EXIT with code {code}")
966
+ os._exit(code)
@@ -50,6 +50,8 @@
50
50
  | Code Documentation | `code-documentation/` | Writing effective code documentation - API docs, README files, inline comments, and technical guides. Use for documenting codebases, APIs, or writing developer guides. |
51
51
  | Confluence Hla | `confluence-hla/` | Author enterprise High-Level Architecture (HLA) documents in Simplified Technical English and generate Confluence Storage Format XHTML with self-contained PlantUML diagrams, wrapped tables, and zero AI fingerprints. Use when creating high-level architecture designs, architecture documentation for Confluence, or converting markdown architecture to Confluence storage format. |
52
52
  | Explainer Doc | `explainer-doc/` | Write a document that hands off work to a team who did NOT do the investigation — an external vendor, another team, a contractor — and who must be able to act on it alone. Use when the user says "write a spec for the X team", "document this for someone outside the team", "explainer doc", "implementation spec for a vendor", "hand this off to Y", or is about to write a design doc whose primary reader did not live through the debugging/design process. NOT for internal specs where the reader already has full context (use technical-writing or writing-plans instead) — this is specifically for the "stranger must follow it alone" case. |
53
+ | Hld | `hld/` | Generate High-Level Design (HLD) Markdown documentation and Confluence XHTML with Draw.io diagrams. |
54
+ | Lld | `lld/` | Generate Lower-Level Design (LLD) Markdown documentation and Confluence XHTML with Draw.io diagrams. |
53
55
  | Tech Explainer | `tech-explainer/` | >- |
54
56
  | Technical Writing | `technical-writing/` | Technical documentation best practices for READMEs, API docs, architecture docs, runbooks, and developer guides. Use when writing or reviewing documentation, creating onboarding guides, or establishing documentation standards. |
55
57
  | Writing Plans | `writing-plans/` | Use when you have a spec or requirements for a multi-step task, before touching code |
@@ -83,6 +85,7 @@
83
85
  | Kb | `kb/` | Rebuild the KB index (.caddis/kb/DOC-MAP.md) — create it if missing, index un-indexed notes, report dangling links |
84
86
  | Mermaid Db | `mermaid-db/` | Turn a SQL artifact (proc, view, query, .sql file, or table name) into a Mermaid diagram that explains it — git-diffable, saved as .md |
85
87
  | Migrate Dir | `migrate-dir/` | Rename this repo's legacy `.claudster/` artifact dir to `.caddis/` — dry-run first, `git mv` to keep history, merges a straggler dir, rewrites live refs. Opt-in, never automatic. |
88
+ | Mmr | `mmr/` | Multi-Model Review & Runner (MMR) — run an ad-hoc task in an isolated multi-lane sandbox with rate-limit failover, test gates, and second-vendor review, or run a fast cross-model review on a diff |
86
89
  | Park | `park/` | File a future-work item in the one backlog — .caddis/parking-lot/ — or list what is open |
87
90
  | Pr Merge | `pr-merge/` | End-to-end pull request and merge lane — push feature branch, open or update PR, monitor CI to green, merge to default branch, and clean up the feature branch. |
88
91
  | Prd | `prd/` | Capture requirements through structured discovery and write a PRD |
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: hld
3
+ description: Generate High-Level Design (HLD) Markdown documentation and Confluence XHTML with Draw.io diagrams.
4
+ ---
5
+
6
+ # /hld Command
7
+
8
+ Run the High-Level Design (HLD) generation procedure:
9
+
10
+ 1. **Research & Scope Analysis:**
11
+ - Review target application architecture, user navigation surfaces, and primary databases.
12
+ - Enforce HLD boundaries: exclude internal API routes, low-level stored procedures, and detailed ETL scripts.
13
+ - Use high-level reporting summary tables and domain entities only.
14
+
15
+ 2. **Author Canonical Markdown Document:**
16
+ - Create document at `docs/<app>/<app>-hld.md`.
17
+ - Adhere strictly to the standard 7-section HLD structure.
18
+ - Ensure Mermaid diagrams depict automated schedulers as system participants, not human actors.
19
+ - Use ASD-STE100 Simplified Technical English: active voice, short sentences, zero em-dashes.
20
+
21
+ 3. **Convert to Confluence Storage Format XHTML:**
22
+ - Run the Draw.io-enabled converter:
23
+ ```bash
24
+ python scripts/convert_doc_to_confluence.py docs/<app>/<app>-hld.md --output docs/<app>/<app>-hld.html
25
+ ```
26
+ - Verify that all diagrams are converted to native `<ac:structured-macro ac:name="drawio">` blocks.
27
+ - Verify that output validates as well-formed XML.
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: lld
3
+ description: Generate Lower-Level Design (LLD) Markdown documentation and Confluence XHTML with Draw.io diagrams.
4
+ ---
5
+
6
+ # /lld Command
7
+
8
+ Run the Lower-Level Design (LLD) generation procedure:
9
+
10
+ 1. **Detailed Technical Discovery:**
11
+ - Scan physical hosts, service managers (NSSM, systemd), environment configurations, and ports.
12
+ - Extract internal API routes, controllers, middleware, and dependency injection patterns.
13
+ - Inspect database schemas, tables, views, primary keys, and index configurations.
14
+ - Catalog stored procedures (`usp_*`), parameter lists, business logic flows, and return codes.
15
+ - Map batch ingestion scripts, command-line arguments, and background refresher polling loops.
16
+
17
+ 2. **Author Canonical Markdown Document:**
18
+ - Create document at `docs/<app>/<app>-lld.md`.
19
+ - Adhere strictly to the standard 7-section LLD structure.
20
+ - Detail every stored procedure, table, ETL job, and endpoint contract.
21
+ - Include detailed Mermaid sequence, flowchart, and component interaction diagrams.
22
+ - Use ASD-STE100 Simplified Technical English: active voice, short sentences, zero em-dashes.
23
+
24
+ 3. **Convert to Confluence Storage Format XHTML:**
25
+ - Run the Draw.io-enabled converter:
26
+ ```bash
27
+ python scripts/convert_doc_to_confluence.py docs/<app>/<app>-lld.md --output docs/<app>/<app>-lld.html
28
+ ```
29
+ - Verify that all diagrams are converted to native `<ac:structured-macro ac:name="drawio">` blocks.
30
+ - Verify that output validates as well-formed XML.
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: mmr
3
+ description: Multi-Model Review & Runner (MMR) — run an ad-hoc task in an isolated multi-lane sandbox with rate-limit failover, test gates, and second-vendor review, or run a fast cross-model review on a diff
4
+ ---
5
+
6
+ # /caddis:mmr — Multi-Model Review & Runner
7
+
8
+ Execute an ad-hoc task across model lanes (GLM-5.3 &rarr; Codex Sol &rarr; Claude) inside an isolated
9
+ git worktree with automated test gates and second-vendor review (DeepSeek). Destroys the worktree
10
+ immediately on completion (zero worktree leaks) and leaves the output on a clean branch with a
11
+ simple Verdict Card.
12
+
13
+ When invoked without a task prompt (or with a git range), `/mmr` runs a direct cross-model diff review.
14
+
15
+ ## Natural Language Triggers
16
+ You can trigger MMR naturally without typing the full slash command:
17
+ - *"Run this on another lane: &lt;task&gt;"* &rarr; `/mmr "<task>"`
18
+ - *"Try this with multilane: &lt;task&gt;"* &rarr; `/mmr "<task>"`
19
+ - *"Keep it"* / *"Keep the changes"* &rarr; `/mmr keep`
20
+ - *"Drop it"* / *"Discard the attempt"* &rarr; `/mmr drop`
21
+ - *"Check mmr status"* / *"Which lanes are ready?"* &rarr; `/mmr status`
22
+ - *"Review this diff with mmr"* &rarr; `/mmr`
23
+
24
+ ---
25
+
26
+ ## Commands
27
+
28
+ ### 1. Run an Ad-Hoc Task
29
+ ```bash
30
+ python scripts/caddis_adhoc.py run "<task description>" [--type backend|tests|docs|ui|hard]
31
+ # Shorthand:
32
+ python scripts/caddis_adhoc.py "<task description>"
33
+ ```
34
+ - **Sandbox Isolation:** Creates an ephemeral 1-phase plan at `.caddis/orchestrator/adhoc/<slug>.md`.
35
+ - **Pre-flight Checks:** Verifies dirty tree and API keys. Warns if local edits exist.
36
+ - **Failover Cascade:** Automatically cascades from GLM to Codex to Claude if a lane is out of budget.
37
+ - **Local Test Gates:** Runs project test gates before review.
38
+ - **Cross-Vendor Review:** DeepSeek or GLM reviews the diff.
39
+ - **Immediate Worktree Cleanup:** Stashes/commits results to `lane/adhoc-<slug>` and immediately removes the worktree. Zero open worktrees remain.
40
+ - **Verdict Card:** Prints PASS/FAIL summary with diff stats and next actions.
41
+
42
+ ### 2. Keep the Result
43
+ ```bash
44
+ python scripts/caddis_adhoc.py keep
45
+ ```
46
+ - Keeps the output branch `lane/adhoc-<slug>`.
47
+ - **Main Branch Protection:** If you are on `main` or `master`, direct merge is disabled to protect trunk. Recommends running `/ship-pr`.
48
+ - If on a feature branch and the working tree is clean, provides squash-merge instructions.
49
+
50
+ ### 3. Drop the Result
51
+ ```bash
52
+ python scripts/caddis_adhoc.py drop
53
+ ```
54
+ - Deletes the branch `lane/adhoc-<slug>`.
55
+ - Deletes the ephemeral plan file and run logs.
56
+ - Workspace remains clean and untouched.
57
+
58
+ ### 4. Check Status
59
+ ```bash
60
+ python scripts/caddis_adhoc.py status
61
+ ```
62
+ - Displays API key readiness for all lanes (`Anthropic`, `DeepSeek`, `GLM`, `OpenAI`).
63
+ - Shows the latest task status, model used, and gates/review verdicts.
64
+ - Lists any unmerged `lane/adhoc-*` branches.
65
+
66
+ ### 5. Review Diff Only
67
+ ```bash
68
+ python scripts/caddis_adhoc.py review [--range <range>]
69
+ # Shorthand (no args):
70
+ python scripts/caddis_adhoc.py
71
+ ```
72
+ - Fast cross-model review of working tree or git range (e.g., `origin/main..HEAD`).
73
+
74
+ ---
75
+
76
+ ## Tool Resolution
77
+ Resolve `caddis_adhoc.py` deterministically:
78
+ ```bash
79
+ if [ -f "${CLAUDE_PLUGIN_ROOT}/scripts/caddis_adhoc.py" ]; then
80
+ TOOL="${CLAUDE_PLUGIN_ROOT}/scripts/caddis_adhoc.py"
81
+ elif [ -f "scripts/caddis_adhoc.py" ]; then
82
+ TOOL="scripts/caddis_adhoc.py"
83
+ else
84
+ echo "caddis_adhoc.py not found — report this and stop."
85
+ exit 3
86
+ fi
87
+ ```
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "caddis-extras",
3
- "version": "1.3.29",
3
+ "version": "1.3.30",
4
4
  "description": "caddis-extras — the long-tail skills for the Antigravity (agy) caddis plugin; install alongside caddis for the full set."
5
5
  }
@@ -61,6 +61,8 @@
61
61
  | Architecture Document | `architecture-document/` | Generate professional enterprise-grade HLD and LLD documents from the living Architecture.md. Outputs DOCX (editable) or PPTX (executive summary) using existing document skills. |
62
62
  | Doc Coauthoring | `doc-coauthoring/` | Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks. |
63
63
  | Documentation Analyzer | `documentation-analyzer/` | Analyze codebases, explain code functionality, and generate comprehensive documentation. Use when documenting a project, creating README files, or understanding complex code. |
64
+ | Hld | `hld/` | Generates High-Level Design (HLD) Markdown documentation and converts to Confluence Storage Format XHTML with inline PlantUML macros. |
65
+ | Lld | `lld/` | Generates Lower-Level Design (LLD) Markdown documentation and converts to Confluence Storage Format XHTML with inline PlantUML macros. |
64
66
  | Naming Analyzer | `naming-analyzer/` | Suggest better variable, function, and class names based on context and conventions. |
65
67
  | Prd To Code | `prd-to-code/` | Transform PRD documents into working application code using a systematic 6-phase methodology. Use when starting projects from requirements or converting specs to implementation. |
66
68
 
@@ -0,0 +1,100 @@
1
+ ---
2
+ name: hld
3
+ description: Generates High-Level Design (HLD) Markdown documentation and converts to Confluence Storage Format XHTML with inline PlantUML macros.
4
+ ---
5
+
6
+ # High-Level Design (HLD) Authoring Skill
7
+
8
+ ## Overview
9
+ This skill generates High-Level Design (HLD) documents for enterprise application fleet systems and converts them to Confluence Storage Format XHTML with self-contained, inline PlantUML (`<ac:structured-macro ac:name="plantuml">`) diagrams.
10
+
11
+ ## Scope and Boundary Principles (Strict)
12
+ 1. **High-Level Design Only:**
13
+ - Include: Business initiative goals, high-level architecture topology, user surfaces, high-level database references, security & network boundaries, and target state roadmap.
14
+ - **DO NOT INCLUDE:**
15
+ - Internal application API routes or controller implementation details.
16
+ - Stored procedure names, parameter lists, or SQL code.
17
+ - Low-level ETL batch scripts, job schedules, or internal script arguments.
18
+ - Low-level table schemas or physical column definitions.
19
+ 2. **Database Representation:**
20
+ - Mention the physical database host and database name.
21
+ - List high-level reporting summary tables or key domain mart entities only.
22
+ - Low-level tables and stored procedures belong strictly in the Lower-Level Design (LLD).
23
+ 3. **Sequence Diagrams:**
24
+ - Automated schedulers (such as Windows Task Scheduler or cron) must be depicted as system components or lifeline participants, **NEVER** as human actors.
25
+ 4. **Diagram Rendering and Orthogonal Connectors:**
26
+ - Diagrams are converted to native Confluence PlantUML macros (`<ac:structured-macro ac:name="plantuml">`) using `skinparam linetype ortho`.
27
+ - `skinparam linetype ortho` ensures that all arrows connecting boxes are strictly orthogonal (90-degree right angles, zero diagonal slants).
28
+ - PlantUML renders inline upon copy-paste into Confluence with zero attachment access errors.
29
+ 5. **No AI Traces and Clean STE:**
30
+ - The HLD must contain zero hints or traces of AI generation (no model names, tool mentions, or meta-notices in the Confluence HTML).
31
+ - Write in Simplified Technical English (ASD-STE100): short sentences, active voice, and clear technical descriptions.
32
+ - Executive Metadata is omitted from the Confluence HTML view (metadata belongs in LLD).
33
+
34
+ ## Standard HLD Document Structure (Markdown)
35
+ Every HLD document must follow this standardized 7-section structure:
36
+
37
+ ```markdown
38
+ ---
39
+ type: design
40
+ status: current
41
+ feature: <app>-hld
42
+ creation-agent: caddis
43
+ Original Author: Solutions Architecture
44
+ Creation Date: <YYYY-MM-DDTHH:MM:SSZ>
45
+ Creating Model: gemini-3.5-flash
46
+ ---
47
+
48
+ # High-Level Architecture (HLA): <Application Name>
49
+
50
+ ## Document Information
51
+
52
+ ### Version History
53
+ | Version | Date | Author | Description |
54
+ |---|---|---|---|
55
+ | 1.0 | <YYYY-MM-DD> | Solutions Architecture | Initial High-Level Architecture Draft |
56
+
57
+ ---
58
+
59
+ ## 1. Executive Summary
60
+ - 1.1 Initiative Goal
61
+ - 1.2 Solution Architecture Summary
62
+ - 1.3 Business Value & Operational Outcomes
63
+
64
+ ## 2. Project Context and Scope
65
+ - 2.1 Background
66
+ - 2.2 Scope (In Scope / Out of Scope)
67
+ - 2.3 Architecture Boundaries and Key Assumptions
68
+
69
+ ## 3. Solution Approach and Workflow
70
+ - 3.1 Operational Process Flow (Mermaid flowchart)
71
+ - 3.2 End-to-End Operational Sequence Diagram (Mermaid sequence diagram with system scheduler participant)
72
+
73
+ ## 4. Solution Architecture Landscape
74
+ - 4.1 Solution Design and Architecture (Mermaid topology diagram)
75
+ - 4.2 User Surfaces and Capabilities Overview (Summary table of primary operational interfaces)
76
+ - 4.3 High-Level Data Model and Summary Mart (High-level summary entities only, no stored procedures or DDL)
77
+ - 4.4 High-Level Data Flow and Integration (Mermaid data lineage flow)
78
+
79
+ ## 5. Security Architecture and Controls
80
+ - 5.1 Identity and Access Management (Authentication seams, roles, authorization boundaries)
81
+ - 5.2 Network Boundaries and Perimeter Controls (Subnets, ports, host environments)
82
+ - 5.3 Data Protection and Privacy (Encryption, sensitive data handling)
83
+ - 5.4 Auditability and Governance
84
+
85
+ ## 6. Target State Roadmap (Work In Progress)
86
+ - 6.1 Enterprise Identity Evolution
87
+ - 6.2 Automated Operational Integration
88
+
89
+ ## 7. Appendix
90
+ - 7.1 Terms and Definitions
91
+ - 7.2 Reference Documents
92
+ ```
93
+
94
+ ## Conversion Workflow
95
+ 1. Write the canonical HLD Markdown file to `docs/<app>/<app>-hld.md`.
96
+ 2. Run the conversion script:
97
+ ```bash
98
+ python scripts/convert_doc_to_confluence.py docs/<app>/<app>-hld.md --output docs/<app>/<app>-hld.html
99
+ ```
100
+ 3. Verify that the output validates as well-formed XML and contains `<ac:structured-macro ac:name="plantuml">` blocks with `skinparam linetype ortho`.