@plebeiantech/lat.md 0.12.3-fork.9 → 0.13.4-fork.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.
- package/README.md +27 -3
- package/dist/src/cli/agent-invocation.d.ts +6 -0
- package/dist/src/cli/agent-invocation.js +23 -0
- package/dist/src/cli/checklist-menu.d.ts +2 -1
- package/dist/src/cli/checklist-menu.js +3 -2
- package/dist/src/cli/fork-instructions.d.ts +1 -0
- package/dist/src/cli/fork-instructions.js +8 -32
- package/dist/src/cli/fork-scaffold.js +2 -2
- package/dist/src/cli/graph.d.ts +1 -1
- package/dist/src/cli/hook.d.ts +26 -0
- package/dist/src/cli/hook.js +115 -64
- package/dist/src/cli/index.js +147 -70
- package/dist/src/cli/init-preferences.d.ts +4 -0
- package/dist/src/cli/init-preferences.js +36 -0
- package/dist/src/cli/init.d.ts +2 -1
- package/dist/src/cli/init.js +100 -60
- package/dist/src/cli/reindex.d.ts +1 -1
- package/dist/src/cli/reindex.js +7 -10
- package/dist/src/cli/search.d.ts +14 -4
- package/dist/src/cli/search.js +115 -101
- package/dist/src/cli/ui-build-server.d.ts +12 -0
- package/dist/src/cli/ui-build-server.js +26 -0
- package/dist/src/cli/ui-build.d.ts +1 -1
- package/dist/src/cli/ui-build.js +1 -1
- package/dist/src/cli/ui.d.ts +1 -1
- package/dist/src/cli/ui.js +1 -1
- package/dist/src/fork/antigravity-hook.d.ts +47 -0
- package/dist/src/fork/antigravity-hook.js +424 -0
- package/dist/src/fork/antigravity-init.d.ts +17 -0
- package/dist/src/fork/antigravity-init.js +124 -0
- package/dist/src/fork/upstream-drift.js +1 -1
- package/dist/src/fork/upstream-guard.d.ts +1 -1
- package/dist/src/fork/upstream-guard.js +8 -7
- package/dist/src/graph-export.js +7 -7
- package/dist/src/knowledge/index.js +2 -2
- package/dist/src/mcp/server.js +34 -18
- package/dist/src/search/cache.d.ts +3 -0
- package/dist/src/search/cache.js +104 -0
- package/dist/src/search/chunks.d.ts +23 -0
- package/dist/src/search/chunks.js +200 -0
- package/dist/src/search/db.d.ts +28 -16
- package/dist/src/search/db.js +100 -40
- package/dist/src/search/embedder.d.ts +2 -1
- package/dist/src/search/embedder.js +7 -6
- package/dist/src/search/index.d.ts +6 -2
- package/dist/src/search/index.js +176 -70
- package/dist/src/search/lexical.d.ts +6 -0
- package/dist/src/search/lexical.js +36 -0
- package/dist/src/search/lock.d.ts +5 -0
- package/dist/src/search/lock.js +45 -0
- package/dist/src/search/query.d.ts +26 -0
- package/dist/src/search/query.js +103 -0
- package/dist/src/search/search.d.ts +16 -7
- package/dist/src/search/search.js +165 -21
- package/dist/src/search/types.d.ts +15 -0
- package/dist/src/view/client/assets/GraphView-D_xnk0bP.js +456 -0
- package/dist/src/view/client/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/src/view/client/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/src/view/client/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/src/view/client/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/src/view/client/assets/MarkdownEditor-bjqt_FoF.js +28 -0
- package/dist/src/view/client/assets/OrbitControls-DwcpQNja.js +1 -0
- package/dist/src/view/client/assets/STLLoader-CLWTKt5i.js +1 -0
- package/dist/src/view/client/assets/_commonjsHelpers-CqkleIqs.js +1 -0
- package/dist/src/view/client/assets/abnfDiagram-VCTEODGH-kWGvtRnL.js +1 -0
- package/dist/src/view/client/assets/arc-BPAFd7cP.js +1 -0
- package/dist/src/view/client/assets/architectureDiagram-5GKGNRK7-CsY39oIR.js +36 -0
- package/dist/src/view/client/assets/blockDiagram-I7D4REHJ-DHGBG7BJ.js +129 -0
- package/dist/src/view/client/assets/c4Diagram-7LVT6UL2-vywK4eb7.js +38 -0
- package/dist/src/view/client/assets/channel-CX71L_qV.js +1 -0
- package/dist/src/view/client/assets/chunk-2Q5K7J3B-Do3Hz_ci.js +1 -0
- package/dist/src/view/client/assets/chunk-5VM5RSS4-B5R1lSeY.js +15 -0
- package/dist/src/view/client/assets/chunk-F27PBJKO-Dm55FM_W.js +1 -0
- package/dist/src/view/client/assets/chunk-IMKFNOWR-ChptrvvM.js +231 -0
- package/dist/src/view/client/assets/chunk-JWPE2WC7-BRQBjrKS.js +1 -0
- package/dist/src/view/client/assets/chunk-POPQ4Y6H-CainVZIL.js +1 -0
- package/dist/src/view/client/assets/chunk-SVP7TREG-DsKsNGmM.js +88 -0
- package/dist/src/view/client/assets/chunk-TICWLB2K-BctkMcJc.js +206 -0
- package/dist/src/view/client/assets/chunk-XXDRQBXY-BN7SgOUT.js +1 -0
- package/dist/src/view/client/assets/classDiagram-ZZMXUADV-B1VyU6zO.js +1 -0
- package/dist/src/view/client/assets/classDiagram-v2-VYDZK3BY-B1VyU6zO.js +1 -0
- package/dist/src/view/client/assets/cose-bilkent-JH36ORCC-BszzwrMe.js +1 -0
- package/dist/src/view/client/assets/cynefin-OW5HDTMX-CdRyAkPs.js +166 -0
- package/dist/src/view/client/assets/cynefinDiagram-5FMLGOSQ-BLvKPZ1u.js +62 -0
- package/dist/src/view/client/assets/cytoscape.esm-DzSz-X2X.js +321 -0
- package/dist/src/view/client/assets/dagre-GXQ25YYZ-V68w_l65.js +4 -0
- package/dist/src/view/client/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/src/view/client/assets/diagram-S7CK7UJ4-C2i4eEMg.js +30 -0
- package/dist/src/view/client/assets/diagram-UQ7AKVKN-BiwWh5jC.js +41 -0
- package/dist/src/view/client/assets/diagram-VSXAHHWV-hkKR_vyS.js +3 -0
- package/dist/src/view/client/assets/diagram-VX7I27RA-DzRCSMAc.js +24 -0
- package/dist/src/view/client/assets/diagram-Z3DM3KII-fhSFPxyK.js +24 -0
- package/dist/src/view/client/assets/ebnfDiagram-PWID7BFC-CCEUDKSA.js +1 -0
- package/dist/src/view/client/assets/erDiagram-RLTQ6QDP-FJ2IMyTi.js +99 -0
- package/dist/src/view/client/assets/flowDiagram-HODETNUW-BvasdLeK.js +168 -0
- package/dist/src/view/client/assets/ganttDiagram-EL5Y4UJY-CiwkBZvY.js +292 -0
- package/dist/src/view/client/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/dist/src/view/client/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/dist/src/view/client/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/dist/src/view/client/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/dist/src/view/client/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
- package/dist/src/view/client/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
- package/dist/src/view/client/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
- package/dist/src/view/client/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
- package/dist/src/view/client/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
- package/dist/src/view/client/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
- package/dist/src/view/client/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/dist/src/view/client/assets/gitGraphDiagram-WWUBYQGX-DYlP2_js.js +106 -0
- package/dist/src/view/client/assets/index-BnENo9bV.js +1 -0
- package/dist/src/view/client/assets/index-CQ7EOox7.css +1 -0
- package/dist/src/view/client/assets/index-CynNDkxt.js +13 -0
- package/dist/src/view/client/assets/infoDiagram-27XIBGKW-DRPB2c48.js +2 -0
- package/dist/src/view/client/assets/init-Gi6I4Gst.js +1 -0
- package/dist/src/view/client/assets/ishikawaDiagram-5VMMS53U-8VV429Cv.js +70 -0
- package/dist/src/view/client/assets/journeyDiagram-3NMN7TZE-Dzmwnf83.js +139 -0
- package/dist/src/view/client/assets/kanban-definition-UXKFOSKX-pYyZZ1i-.js +89 -0
- package/dist/src/view/client/assets/katex-HP8lGamR.js +257 -0
- package/dist/src/view/client/assets/layout-GF9k6yGo.js +1 -0
- package/dist/src/view/client/assets/linear-Yt2sSOYV.js +1 -0
- package/dist/src/view/client/assets/logo-RR_KBOAT.svg +149 -0
- package/dist/src/view/client/assets/maplibre-gl-CDX6Zuow.js +800 -0
- package/dist/src/view/client/assets/mermaid.core-ChWYCHN0.js +310 -0
- package/dist/src/view/client/assets/mindmap-definition-YA3MSWOX-Cc4fQvf1.js +96 -0
- package/dist/src/view/client/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/src/view/client/assets/pegDiagram-XKGWAZYB-C0SsB8bZ.js +1 -0
- package/dist/src/view/client/assets/pieDiagram-E7YTZNPT-DIJpqERZ.js +39 -0
- package/dist/src/view/client/assets/quadrantDiagram-AXDQQJYC--d-gl6j-.js +7 -0
- package/dist/src/view/client/assets/railroadDiagram-O6MQD6OU-BQxwTt7z.js +1 -0
- package/dist/src/view/client/assets/requirementDiagram-BXWQKSXE-B_oTeD2A.js +84 -0
- package/dist/src/view/client/assets/sankeyDiagram-P5KCCOFB-DLukmE8X.js +40 -0
- package/dist/src/view/client/assets/sequenceDiagram-WJ2MYXX4-BNjVB2sc.js +162 -0
- package/dist/src/view/client/assets/sizeCapture-INFHLROL-BZecQTOw.js +1 -0
- package/dist/src/view/client/assets/stateDiagram-D77RDMKH-Bu1urvXC.js +1 -0
- package/dist/src/view/client/assets/stateDiagram-v2-MP3YSRHH-5pc_697G.js +1 -0
- package/dist/src/view/client/assets/swimlanes-42K2YHIH-bLAlcepB.js +1 -0
- package/dist/src/view/client/assets/swimlanesDiagram-VR7AAH4N-BbOpZjpp.js +8 -0
- package/dist/src/view/client/assets/three.module-PDSP0dbZ.js +4108 -0
- package/dist/src/view/client/assets/timeline-definition-24CTP7MA-tbwCNvcA.js +120 -0
- package/dist/src/view/client/assets/vennDiagram-4TSXK5OY-D8U8Fk0N.js +34 -0
- package/dist/src/view/client/assets/wardleyDiagram-VM6X3IG4-LHBVIeNb.js +78 -0
- package/dist/src/view/client/assets/xychartDiagram-S5SC5T6Z-CN4tfaFV.js +7 -0
- package/dist/src/view/client/index.html +2 -2
- package/dist/src/view/client-shell.d.ts +2 -0
- package/dist/src/view/client-shell.js +5 -0
- package/dist/src/view/diagnostics.d.ts +3 -2
- package/dist/src/view/diagnostics.js +49 -58
- package/dist/src/view/document-edit.d.ts +8 -0
- package/dist/src/view/document-edit.js +25 -0
- package/dist/src/view/document-route.d.ts +14 -0
- package/dist/src/view/document-route.js +137 -0
- package/dist/src/view/document-tree.d.ts +18 -0
- package/dist/src/view/document-tree.js +139 -0
- package/dist/src/view/external-document-tree.d.ts +3 -0
- package/dist/src/view/external-document-tree.js +674 -0
- package/dist/src/view/git-diff.js +202 -2
- package/dist/src/view/git.js +1 -1
- package/dist/src/view/graph.d.ts +4 -3
- package/dist/src/view/graph.js +100 -9
- package/dist/src/view/highlight.d.ts +10 -2
- package/dist/src/view/highlight.js +50648 -3166
- package/dist/src/view/markdown.d.ts +3 -2
- package/dist/src/view/markdown.js +256 -54
- package/dist/src/view/preindexed-search.d.ts +15 -0
- package/dist/src/view/preindexed-search.js +25 -0
- package/dist/src/view/protocol.d.ts +53 -7
- package/dist/src/view/publication.d.ts +2 -0
- package/dist/src/view/publication.js +78 -0
- package/dist/src/view/references.d.ts +11 -26
- package/dist/src/view/references.js +121 -112
- package/dist/src/view/repository.d.ts +14 -4
- package/dist/src/view/repository.js +260 -19
- package/dist/src/view/request-security.d.ts +5 -0
- package/dist/src/view/request-security.js +46 -0
- package/dist/src/view/search-result.d.ts +4 -0
- package/dist/src/view/search-result.js +25 -0
- package/dist/src/view/search.d.ts +7 -2
- package/dist/src/view/search.js +23 -34
- package/dist/src/view/server-build.d.ts +21 -0
- package/dist/src/view/server-build.js +145 -0
- package/dist/src/view/server-deployment.d.ts +31 -0
- package/dist/src/view/server-deployment.js +123 -0
- package/dist/src/view/server-index-worker.d.ts +6 -0
- package/dist/src/view/server-index-worker.js +14 -0
- package/dist/src/view/server.d.ts +11 -2
- package/dist/src/view/server.js +245 -73
- package/dist/src/view/source-target.d.ts +2 -0
- package/dist/src/view/source-target.js +49 -8
- package/dist/src/view/static-build.d.ts +18 -2
- package/dist/src/view/static-build.js +449 -110
- package/dist/src/view/static-protocol.d.ts +26 -2
- package/dist/src/view/static-protocol.js +5 -0
- package/dist/src/view/store.d.ts +20 -3
- package/dist/src/view/store.js +304 -48
- package/dist/src/view/table-of-contents.d.ts +2 -2
- package/dist/src/view/table-of-contents.js +2 -22
- package/dist/src/view/vercel-build.d.ts +24 -0
- package/dist/src/view/vercel-build.js +152 -0
- package/dist/src/view/vercel-server-build.d.ts +10 -0
- package/dist/src/view/vercel-server-build.js +61 -0
- package/dist/vendor/lat.md-server/cli.d.ts +2 -0
- package/dist/vendor/lat.md-server/cli.js +12 -0
- package/dist/vendor/lat.md-server/index.d.ts +38 -0
- package/dist/vendor/lat.md-server/index.js +128 -0
- package/package.json +68 -22
- package/plugins/lat-md/README.md +61 -0
- package/plugins/lat-md/hooks.json +38 -0
- package/plugins/lat-md/plugin.json +9 -0
- package/plugins/lat-md/rules/AGENTS.md +344 -0
- package/plugins/lat-md/skills/lat-md/SKILL.md +210 -0
- package/plugins/lat-md/skills/lat-md-conventions/SKILL.md +226 -0
- package/templates/AGENTS.md +26 -7
- package/templates/cursor-rules.md +23 -7
- package/templates/fork/conventions.md +133 -11
- package/templates/opencode-plugin.ts +9 -9
- package/templates/pi-extension.ts +11 -11
- package/templates/skill/SKILL.md +35 -3
- package/dist/src/cli/check-coverage.d.ts +0 -2
- package/dist/src/cli/check-coverage.js +0 -71
- package/dist/src/cli/check-frontmatter.d.ts +0 -12
- package/dist/src/cli/check-frontmatter.js +0 -44
- package/dist/src/cli/check-mode.d.ts +0 -21
- package/dist/src/cli/check-mode.js +0 -364
- package/dist/src/cli/check-status.d.ts +0 -74
- package/dist/src/cli/check-status.js +0 -217
- package/dist/src/cli/check.d.ts +0 -45
- package/dist/src/cli/check.js +0 -781
- package/dist/src/cli/context.d.ts +0 -11
- package/dist/src/cli/context.js +0 -58
- package/dist/src/cli/expand.d.ts +0 -8
- package/dist/src/cli/expand.js +0 -94
- package/dist/src/cli/gen-index.d.ts +0 -45
- package/dist/src/cli/gen-index.js +0 -235
- package/dist/src/cli/link-scheme.d.ts +0 -54
- package/dist/src/cli/link-scheme.js +0 -101
- package/dist/src/cli/locate.d.ts +0 -2
- package/dist/src/cli/locate.js +0 -17
- package/dist/src/cli/refs.d.ts +0 -22
- package/dist/src/cli/refs.js +0 -229
- package/dist/src/cli/section.d.ts +0 -43
- package/dist/src/cli/section.js +0 -252
- package/dist/src/cli/select-menu.d.ts +0 -13
- package/dist/src/cli/select-menu.js +0 -100
- package/dist/src/code-refs.d.ts +0 -17
- package/dist/src/code-refs.js +0 -298
- package/dist/src/config.d.ts +0 -29
- package/dist/src/config.js +0 -83
- package/dist/src/context.d.ts +0 -23
- package/dist/src/context.js +0 -11
- package/dist/src/extensions/wiki-link/from-markdown.d.ts +0 -5
- package/dist/src/extensions/wiki-link/from-markdown.js +0 -34
- package/dist/src/extensions/wiki-link/index.d.ts +0 -4
- package/dist/src/extensions/wiki-link/index.js +0 -3
- package/dist/src/extensions/wiki-link/syntax.d.ts +0 -14
- package/dist/src/extensions/wiki-link/syntax.js +0 -121
- package/dist/src/extensions/wiki-link/to-markdown.d.ts +0 -5
- package/dist/src/extensions/wiki-link/to-markdown.js +0 -28
- package/dist/src/extensions/wiki-link/types.d.ts +0 -34
- package/dist/src/format.d.ts +0 -8
- package/dist/src/format.js +0 -43
- package/dist/src/init-version.d.ts +0 -10
- package/dist/src/init-version.js +0 -49
- package/dist/src/lattice.d.ts +0 -109
- package/dist/src/lattice.js +0 -817
- package/dist/src/parser.d.ts +0 -3
- package/dist/src/parser.js +0 -18
- package/dist/src/source-parser.d.ts +0 -27
- package/dist/src/source-parser.js +0 -916
- package/dist/src/untrusted.d.ts +0 -18
- package/dist/src/untrusted.js +0 -93
- package/dist/src/view/client/assets/index-C3iaZyYT.css +0 -1
- package/dist/src/view/client/assets/index-KWi67IMz.js +0 -334
- package/dist/src/view/client/assets/logo-CNF8zs47.svg +0 -182
- package/dist/src/walk.d.ts +0 -18
- package/dist/src/walk.js +0 -27
- /package/dist/src/{extensions/wiki-link → search}/types.js +0 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lat-md-conventions
|
|
3
|
+
description: >-
|
|
4
|
+
Rules and writing conventions for this project: Diátaxis mode placement for
|
|
5
|
+
every lat.md/ document, Strunk & White prose style, mandatory @lat: code refs
|
|
6
|
+
starting at the application entrypoint, and test specs wired to their tests.
|
|
7
|
+
Load alongside lat-md whenever creating or editing files under lat.md/.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# lat.md conventions this project enforces
|
|
11
|
+
|
|
12
|
+
`lat check` fails on the first three rules below. The last three it cannot see,
|
|
13
|
+
and they matter as much. None of the six are optional. This block is generated
|
|
14
|
+
and a later `lat init` replaces it: record project guidance in `lat.md/`, never
|
|
15
|
+
here.
|
|
16
|
+
|
|
17
|
+
## Every document goes in a Diátaxis mode directory
|
|
18
|
+
|
|
19
|
+
A document belongs in exactly one of four subdirectories, and `lat check mode`
|
|
20
|
+
enforces one shape rule for each:
|
|
21
|
+
|
|
22
|
+
| Directory | Holds | Shape rule |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| `lat.md/tutorials/` | a guided first pass for someone new | an ordered list of steps, and a stated outcome |
|
|
25
|
+
| `lat.md/how-to/` | a recipe for a task that recurs | an ordered list of steps |
|
|
26
|
+
| `lat.md/reference/` | lookup facts: fields, states, limits, names | no narrative prose (no second paragraph under a heading) |
|
|
27
|
+
| `lat.md/explanation/` | why the design is what it is | no imperative commands |
|
|
28
|
+
|
|
29
|
+
A document is classified either by the directory it sits in, or by declaring
|
|
30
|
+
the mode in its own frontmatter:
|
|
31
|
+
|
|
32
|
+
```markdown
|
|
33
|
+
---
|
|
34
|
+
lat:
|
|
35
|
+
mode: explanation
|
|
36
|
+
---
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Both are enforced identically: `lat check mode` applies the shape rule to any
|
|
40
|
+
document that declares a mode, whether or not the root index carries
|
|
41
|
+
`require-mode: true`. That flag adds a separate rule: a document declaring *no*
|
|
42
|
+
mode, in no mode directory, becomes an error too.
|
|
43
|
+
|
|
44
|
+
Prefer the directory in a tree you own outright. Prefer the declaration when
|
|
45
|
+
the file cannot move, such as a document another project maintains or a tree
|
|
46
|
+
other agents are writing to while you work. Moving costs every reference to the
|
|
47
|
+
file; declaring costs nothing at read time, because frontmatter sits above the
|
|
48
|
+
first heading and outside every section.
|
|
49
|
+
|
|
50
|
+
**A document that fails its mode is usually two documents.** A file that lists
|
|
51
|
+
the states *and* argues for the design is mixed: the lookup half goes in
|
|
52
|
+
`reference/`, the reasoning half in `explanation/`, and each links the other.
|
|
53
|
+
Filing it under one mode and softening the prose until the check passes is the
|
|
54
|
+
wrong repair.
|
|
55
|
+
|
|
56
|
+
Classifying a mixed document does not make it pass. Narrative prose put under
|
|
57
|
+
`reference/` fails on contact, because a reference may not carry a second
|
|
58
|
+
paragraph under a heading, so a move is not a way to adopt the rule cheaply.
|
|
59
|
+
Split first, then place. And `explanation` is not the safe default: it bans
|
|
60
|
+
only imperative commands, so nearly any prose passes it. Declaring it is a
|
|
61
|
+
claim about the document, not somewhere to put whatever is left over. A
|
|
62
|
+
document you cannot honestly classify is better left undeclared than
|
|
63
|
+
mislabelled.
|
|
64
|
+
|
|
65
|
+
Classify before writing, not after. If a `diataxis` skill is available, use it.
|
|
66
|
+
|
|
67
|
+
## Every project has at least one `@lat:` code ref
|
|
68
|
+
|
|
69
|
+
`lat check` fails a tree that has documents and no `@lat:` ref anywhere in the
|
|
70
|
+
codebase. A graph nothing points at cannot be reached from the code, which is
|
|
71
|
+
the only reason it exists.
|
|
72
|
+
|
|
73
|
+
Start at the application entrypoint (`config/application.rb`, `src/index.ts`,
|
|
74
|
+
`main.go`, `manage.py`, whatever a new reader opens first) and point it at the
|
|
75
|
+
root index:
|
|
76
|
+
|
|
77
|
+
```ruby
|
|
78
|
+
# @lat: [[lat#Acme]]
|
|
79
|
+
module Acme
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Then one ref per section that source code actually implements, placed at that
|
|
83
|
+
code. Never in a block at the top of a file.
|
|
84
|
+
|
|
85
|
+
### An `@lat:` pointer is exempt from this project's comment conventions
|
|
86
|
+
|
|
87
|
+
A repository that minimises, budgets, or forbids comments is right about prose
|
|
88
|
+
comments and does not reach this one. An `@lat:` line is a machine directive,
|
|
89
|
+
in the same class as `# frozen_string_literal:` or `// eslint-disable`. It
|
|
90
|
+
carries no rationale, asserts nothing a reader could dispute, and cannot rot
|
|
91
|
+
quietly: `lat check` fails the moment its target moves or disappears.
|
|
92
|
+
|
|
93
|
+
Add the ref. Then, if the reasoning that would have been a comment is worth
|
|
94
|
+
keeping, put it in a `lat.md/explanation/` section and let the pointer reach it.
|
|
95
|
+
|
|
96
|
+
### The marker is a comment syntax, not a language allowlist
|
|
97
|
+
|
|
98
|
+
`//` for C-family languages; `#` for Ruby, Python, shell, Elixir, YAML, Make,
|
|
99
|
+
and everything else that comments with `#`. The scan is textual and walks every
|
|
100
|
+
non-markdown file in the project, so every language works.
|
|
101
|
+
|
|
102
|
+
Any list of example languages you find is a list of examples. Never conclude a
|
|
103
|
+
language is unsupported because it is absent from one. `lat check` prints what
|
|
104
|
+
it scanned:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
Scanned 41 .md, 622 .rb, 118 .tsx in 1.2s
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Read that line rather than guessing, and if you are still unsure, add one ref
|
|
111
|
+
and run the check. It costs one command.
|
|
112
|
+
|
|
113
|
+
(The tree-sitter grammars limit only `[[src/file.ts#symbol]]` wiki links, which
|
|
114
|
+
resolve a symbol inside source. `@lat:` refs point the other way and have no
|
|
115
|
+
such limit.)
|
|
116
|
+
|
|
117
|
+
## Test specs are wired to their tests
|
|
118
|
+
|
|
119
|
+
A document describing tests declares it in frontmatter:
|
|
120
|
+
|
|
121
|
+
```markdown
|
|
122
|
+
---
|
|
123
|
+
lat:
|
|
124
|
+
require-code-mention: true
|
|
125
|
+
---
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Every leaf section then needs exactly one `@lat:` comment at the test that
|
|
129
|
+
covers it, and every section needs at least one sentence saying what it
|
|
130
|
+
verifies and why. `lat check` reports any spec section no test claims, and any
|
|
131
|
+
ref pointing at no section.
|
|
132
|
+
|
|
133
|
+
## One specialty per document
|
|
134
|
+
|
|
135
|
+
A document is **small**, **discrete**, and does **not conflict** with any
|
|
136
|
+
other. Those are three demands on the same thing: a reader must be able to
|
|
137
|
+
find the one place a fact is written down, and trust it.
|
|
138
|
+
|
|
139
|
+
**Small: a document covers one specialty.** Not one topic area; one
|
|
140
|
+
specialty. When a document covers two, it is two documents. Past roughly forty
|
|
141
|
+
sections it has almost certainly become several, and an agent then loads all of
|
|
142
|
+
it to reach one part.
|
|
143
|
+
|
|
144
|
+
**Discrete: each document covers its own specialty.** Before writing a new
|
|
145
|
+
document, search for the specialty first:
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
lat search "the thing you are about to document"
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
An overlap has two honest repairs, and picking neither is what produces the
|
|
152
|
+
third copy. Either the two are one document and belong merged, or the part they
|
|
153
|
+
share is its own document that both link. Deciding they are "mostly different"
|
|
154
|
+
and writing anyway is how the set rots.
|
|
155
|
+
|
|
156
|
+
**Does not conflict: two documents never say different things about the same
|
|
157
|
+
specialty.** Never restate a fact another document owns. Link to it with
|
|
158
|
+
`[[section]]`. A restatement is a second copy, a second copy drifts, and drift
|
|
159
|
+
is how document B ends up contradicting document A while both look maintained.
|
|
160
|
+
|
|
161
|
+
The mode rule above is the sharpest available test of "one specialty": a
|
|
162
|
+
document that fails its mode is usually two documents. Split it. Do not soften
|
|
163
|
+
the prose until the check passes.
|
|
164
|
+
|
|
165
|
+
## Write in a tight Strunk & White voice
|
|
166
|
+
|
|
167
|
+
Diátaxis governs what a document is and where it sits. *The Elements of Style*
|
|
168
|
+
governs every sentence inside it. Preserve every fact and design constraint, and
|
|
169
|
+
make it land harder in fewer words. When in doubt, ask whether Strunk & White
|
|
170
|
+
would red-pen the line.
|
|
171
|
+
|
|
172
|
+
1. **Omit needless words.** Every word must earn its place. Cut throat-clearing
|
|
173
|
+
("What this module does is straightforward"). If it is straightforward, the
|
|
174
|
+
prose will show it.
|
|
175
|
+
2. **Prefer the active voice.** Passive voice hides the actor and saps energy.
|
|
176
|
+
Name the module, function, or caller that acts ("`scanCodeRefs` walks every
|
|
177
|
+
source file", not "source files are walked").
|
|
178
|
+
3. **Put statements in positive form.** Say what something is, not what it is
|
|
179
|
+
not ("The cache stores parsed ASTs in memory", not "The cache does not
|
|
180
|
+
persist across runs").
|
|
181
|
+
4. **Be concrete, not corporate.** Replace abstractions with specifics. Name the
|
|
182
|
+
file, symbol, flag, or state instead of gesturing at "workflows",
|
|
183
|
+
"capabilities", or "alignment".
|
|
184
|
+
5. **Brevity is courtesy.** Respect the reader's time and context window. A
|
|
185
|
+
tight sentence carries more weight than a padded paragraph.
|
|
186
|
+
6. **Let confidence speak quietly.** Do not hedge or oversell. State what the
|
|
187
|
+
code does and what the design trades off. Cut qualifiers ("very",
|
|
188
|
+
"extremely") and exclamation marks.
|
|
189
|
+
7. **One thought per sentence.** When a sentence tries to do two things, split
|
|
190
|
+
it so each thought lands.
|
|
191
|
+
8. **Reason first, conclusion second.** When a sentence contains both a reason
|
|
192
|
+
and a claim, lead with the reason so the reader follows the logic instead of
|
|
193
|
+
being told the answer and then backfilled ("Most queries touch one section,
|
|
194
|
+
so `lat section` loads only that range" rather than "`lat section` loads only
|
|
195
|
+
that range as most queries touch one section").
|
|
196
|
+
9. **Jargon is fine; obscurity is not.** Technical terms are precise when the
|
|
197
|
+
reader knows them. When introducing a project-specific term, define it in
|
|
198
|
+
plain words on first use.
|
|
199
|
+
10. **Vary sentence rhythm.** Uniform sentence length sounds robotic. Mix short
|
|
200
|
+
sentences with longer ones that build through a clause or two. A short
|
|
201
|
+
sentence after two longer ones creates emphasis.
|
|
202
|
+
11. **No em dashes and no horizontal rules.** Never use em dashes in prose;
|
|
203
|
+
they are an AI tell. Use a colon to introduce a list or elaboration, commas
|
|
204
|
+
or parentheses for an aside, and a period or semicolon between independent
|
|
205
|
+
thoughts. Never use horizontal rules (`---`, `***`, `___`) to separate
|
|
206
|
+
sections; use a blank line or a heading instead. (YAML frontmatter
|
|
207
|
+
delimiters remain `---`.)
|
|
208
|
+
|
|
209
|
+
## Read sections, not files
|
|
210
|
+
|
|
211
|
+
`lat search` prints a section id and the exact lines that section occupies.
|
|
212
|
+
Resolve it with `lat section`, or read only that line range. Opening the whole
|
|
213
|
+
file is the reflex to break, and it is the expensive one:
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
lat search "how does backend selection work"
|
|
217
|
+
lat section "cli#CLI#search#Backend selection"
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
not a `read` of `lat.md/cli.md`. Measured on lat.md's own graph, the section
|
|
221
|
+
costs 4 KB against the file's 44 KB, eleven times the context for the same
|
|
222
|
+
answer, and the answer arrives buried in forty-one sections that were not
|
|
223
|
+
asked about.
|
|
224
|
+
|
|
225
|
+
Use `lat expand` on a prompt carrying `[[refs]]` for the same reason: it
|
|
226
|
+
resolves each ref to a location and a preview rather than to a file.
|
package/templates/AGENTS.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# Before starting work
|
|
2
2
|
|
|
3
|
+
Use Lat's knowledge graph to ground each task before changing code.
|
|
4
|
+
|
|
3
5
|
- Run `lat search` to find sections relevant to your task. Read them to understand the design intent before writing code.
|
|
4
|
-
- Run `lat expand` on user prompts to expand any `[[refs]]` — this resolves section names to file locations and provides context.
|
|
5
6
|
|
|
6
7
|
# Post-task checklist (REQUIRED — do not skip)
|
|
7
8
|
|
|
8
9
|
After EVERY task, before responding to the user:
|
|
9
10
|
|
|
10
|
-
- [ ] Update `lat.md/` if you added or changed meaningful functionality, architecture, tests,
|
|
11
|
+
- [ ] Update `lat.md/` if you added or changed meaningful implemented functionality, architecture, tests, or behavior. Keep it a focused snapshot of the current implemented state, not a journal/changelog. Plans may be drafted in `lat.md/` alongside implementation, with the intent that by commit time they describe what was implemented. Otherwise, keep proposals, hypothetical designs, and future work outside `lat.md/` unless the user explicitly requests them there.
|
|
11
12
|
- [ ] Run `lat check` — all validations must pass
|
|
12
13
|
- [ ] Do not skip these steps. Do not consider your task done until both are complete.
|
|
13
14
|
|
|
@@ -15,17 +16,21 @@ After EVERY task, before responding to the user:
|
|
|
15
16
|
|
|
16
17
|
# What is lat.md?
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
Lat.md is the project's structured knowledge graph for architecture, design decisions, behavior, and tests.
|
|
20
|
+
|
|
21
|
+
The graph lives in `lat.md/` as cross-linked Markdown describing **what** the project does and **why**. Use it to ground work in actual architecture, and keep it a focused snapshot of the current implemented state rather than a journal or changelog.
|
|
19
22
|
|
|
20
23
|
Project-specific lat documentation belongs in `lat.md/`. Do not modify this generated instruction file or a generated `lat-md` `SKILL.md` to record project guidance: both are owned by lat tooling and may be replaced by a later `lat init`.
|
|
21
24
|
|
|
22
25
|
# Commands
|
|
23
26
|
|
|
27
|
+
Use these commands to navigate and validate the project knowledge graph.
|
|
28
|
+
|
|
24
29
|
```bash
|
|
25
30
|
lat locate "Section Name" # find a section by name (exact, fuzzy)
|
|
26
31
|
lat refs "file#Section" # find what references a section
|
|
27
32
|
lat search "natural language" # semantic search across all sections
|
|
28
|
-
lat
|
|
33
|
+
lat external show <handle> # inspect a pinned external source before cloning it
|
|
29
34
|
lat check # run full graph and documentation validation
|
|
30
35
|
```
|
|
31
36
|
|
|
@@ -35,10 +40,22 @@ If `lat search` fails because no API key is configured, explain to the user that
|
|
|
35
40
|
|
|
36
41
|
# Syntax primer
|
|
37
42
|
|
|
43
|
+
Lat uses stable section ids, wiki links, source links, and code references to connect documentation with implementation.
|
|
44
|
+
|
|
38
45
|
- **Section ids**: `lat.md/path/to/file#Heading#SubHeading` — full form uses project-root-relative path (e.g. `lat.md/tests/search#RAG Replay Tests`). Short form uses bare file name when unique (e.g. `search#RAG Replay Tests`, `cli#search#Indexing`).
|
|
39
|
-
- **Wiki links**: `[[target]]` or `[[target|alias]]` — cross-references between sections. Can also reference source code: `[[src/foo.ts#myFunction]]`.
|
|
40
|
-
- **
|
|
41
|
-
- **
|
|
46
|
+
- **Wiki links**: `[[target]]` or `[[target|alias]]` — cross-references between sections. Can also reference repository paths or source code: `[[schema.sql]]`, `[[src/components]]`, `[[src/foo.ts#myFunction]]`.
|
|
47
|
+
- **Link specificity**: When documenting implemented behavior, prefer the narrowest relevant source-symbol link over a whole-file link. Use whole-file or directory links when discussing the module or resource as a whole, or when no supported symbol represents the target. If prose names a symbol, link that symbol directly.
|
|
48
|
+
- **Repository path links**: Wiki links without a `#` fragment may target any existing file or directory inside the project. Unsupported formats validate but cannot be opened by Lat; fragments require a `lat.md/` section or supported source file.
|
|
49
|
+
- **Source code links**: Wiki links in `lat.md/` files can reference functions, classes, constants, and methods in supported source files. Use the full path: `[[src/config.ts#getConfigDir]]`, `[[src/server.ts#App#listen]]` (class method), `[[lib/utils.py#parse_args]]`, `[[src/lib.rs#Greeter#greet]]` (Rust impl method), `[[src/app.go#Greeter#Greet]]` (Go method), `[[src/app.h#Greeter]]` (C struct). When prose names an implementation symbol or a behavior governed by one, link the symbol instead of using a bare code span or copying its literal value. Prefer `[[src/config.ts#DEFAULT_TIMEOUT]]` (or an aliased form) over a bare identifier or copied value. `lat check` validates these exist.
|
|
50
|
+
- **Code refs**: `// @lat: [[section-id]]` (JS/TS/Rust/Go/C/PHP) or `# @lat: [[section-id]]` (Python/PHP) — ties source code to concepts
|
|
51
|
+
|
|
52
|
+
# Diagrams
|
|
53
|
+
|
|
54
|
+
Default to prose. Reserve Mermaid diagrams for concepts involving more than seven interacting subjects (such as components, states, or stages) with complex sequencing, branching, or dependencies that prose alone makes hard to follow.
|
|
55
|
+
|
|
56
|
+
The subject count alone does not justify a diagram; omit diagrams for simple sequences or relationships that a short paragraph or list explains clearly. A diagram should give users and later agents an overview of the interactions.
|
|
57
|
+
|
|
58
|
+
Keep each diagram focused on one process, use readable labels, and explain the important decisions in surrounding prose with precise source-symbol links. Prefer a small overview or several focused diagrams over one dense diagram. Use fenced `mermaid` blocks and run `lat check` to validate syntax and readability.
|
|
42
59
|
|
|
43
60
|
# Test specs
|
|
44
61
|
|
|
@@ -82,6 +99,8 @@ Do not duplicate refs. One `@lat:` comment per spec section, placed at the test
|
|
|
82
99
|
|
|
83
100
|
# Section structure
|
|
84
101
|
|
|
102
|
+
Concise opening paragraphs give every section a stable overview for validation and discovery.
|
|
103
|
+
|
|
85
104
|
Every section in `lat.md/` **must** have a leading paragraph — at least one sentence immediately after the heading, before any child headings or other block content. The first paragraph must be ≤250 characters (excluding `[[wiki link]]` content). This paragraph serves as the section's overview and is used in search results, command output, and RAG context — keeping it concise guarantees the section's essence is always captured.
|
|
86
105
|
|
|
87
106
|
```markdown
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# Before starting work
|
|
2
2
|
|
|
3
|
+
Use Lat's knowledge graph to ground each task before changing code.
|
|
4
|
+
|
|
3
5
|
- Use the `lat_search` tool to find sections relevant to your task. Read them to understand the design intent before writing code.
|
|
4
|
-
- Use the `lat_expand` tool on user prompts to expand any `[[refs]]` — this resolves section names to file locations and provides context.
|
|
5
6
|
|
|
6
7
|
# Post-task checklist (REQUIRED — do not skip)
|
|
7
8
|
|
|
8
9
|
After EVERY task, before responding to the user:
|
|
9
10
|
|
|
10
|
-
- [ ] Update `lat.md/` if you added or changed meaningful functionality, architecture, tests,
|
|
11
|
+
- [ ] Update `lat.md/` if you added or changed meaningful implemented functionality, architecture, tests, or behavior. Keep it a focused snapshot of the current implemented state, not a journal/changelog. Plans may be drafted in `lat.md/` alongside implementation, with the intent that by commit time they describe what was implemented. Otherwise, keep proposals, hypothetical designs, and future work outside `lat.md/` unless the user explicitly requests them there.
|
|
11
12
|
- [ ] Use the `lat_check` tool — all validations must pass
|
|
12
13
|
- [ ] Do not skip these steps. Do not consider your task done until both are complete.
|
|
13
14
|
|
|
@@ -15,15 +16,18 @@ After EVERY task, before responding to the user:
|
|
|
15
16
|
|
|
16
17
|
# What is lat.md?
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
Lat.md is the project's structured knowledge graph for architecture, design decisions, behavior, and tests.
|
|
20
|
+
|
|
21
|
+
The graph lives in `lat.md/` as cross-linked Markdown describing **what** the project does and **why**. Use it to ground work in actual architecture, and keep it a focused snapshot of the current implemented state rather than a journal or changelog.
|
|
19
22
|
|
|
20
23
|
# Tools
|
|
21
24
|
|
|
25
|
+
Use the Lat MCP tools to navigate and validate the project knowledge graph.
|
|
26
|
+
|
|
22
27
|
You have access to the following MCP tools from the `lat` server:
|
|
23
28
|
|
|
24
29
|
- **lat_locate** — find a section by name (exact, fuzzy)
|
|
25
30
|
- **lat_search** — semantic search across all sections
|
|
26
|
-
- **lat_expand** — expand `[[refs]]` in text to resolved locations
|
|
27
31
|
- **lat_check** — run full graph and documentation validation
|
|
28
32
|
- **lat_refs** — find what references a section
|
|
29
33
|
|
|
@@ -31,10 +35,22 @@ If `lat_search` fails because `LAT_LLM_KEY` is not set, explain to the user that
|
|
|
31
35
|
|
|
32
36
|
# Syntax primer
|
|
33
37
|
|
|
38
|
+
Lat uses stable section ids, wiki links, source links, and code references to connect documentation with implementation.
|
|
39
|
+
|
|
34
40
|
- **Section ids**: `lat.md/path/to/file#Heading#SubHeading` — full form uses project-root-relative path (e.g. `lat.md/tests/search#RAG Replay Tests`). Short form uses bare file name when unique (e.g. `search#RAG Replay Tests`, `cli#search#Indexing`).
|
|
35
|
-
- **Wiki links**: `[[target]]` or `[[target|alias]]` — cross-references between sections. Can also reference source code: `[[src/foo.ts#myFunction]]`.
|
|
36
|
-
- **
|
|
37
|
-
- **
|
|
41
|
+
- **Wiki links**: `[[target]]` or `[[target|alias]]` — cross-references between sections. Can also reference repository paths or source code: `[[schema.sql]]`, `[[src/components]]`, `[[src/foo.ts#myFunction]]`.
|
|
42
|
+
- **Link specificity**: When documenting implemented behavior, prefer the narrowest relevant source-symbol link over a whole-file link. Use whole-file or directory links when discussing the module or resource as a whole, or when no supported symbol represents the target. If prose names a symbol, link that symbol directly.
|
|
43
|
+
- **Repository path links**: Wiki links without a `#` fragment may target any existing file or directory inside the project. Unsupported formats validate but cannot be opened by Lat; fragments require a `lat.md/` section or supported source file.
|
|
44
|
+
- **Source code links**: Wiki links in `lat.md/` files can reference functions, classes, constants, and methods in supported source files. Use the full path: `[[src/config.ts#getConfigDir]]`, `[[src/server.ts#App#listen]]` (class method), `[[lib/utils.py#parse_args]]`, `[[src/lib.rs#Greeter#greet]]` (Rust impl method), `[[src/app.go#Greeter#Greet]]` (Go method), `[[src/app.h#Greeter]]` (C struct). When prose names an implementation symbol or a behavior governed by one, link the symbol instead of using a bare code span or copying its literal value. Prefer `[[src/config.ts#DEFAULT_TIMEOUT]]` (or an aliased form) over a bare identifier or copied value. `lat check` validates these exist.
|
|
45
|
+
- **Code refs**: `// @lat: [[section-id]]` (JS/TS/Rust/Go/C/PHP) or `# @lat: [[section-id]]` (Python/PHP) — ties source code to concepts
|
|
46
|
+
|
|
47
|
+
# Diagrams
|
|
48
|
+
|
|
49
|
+
Default to prose. Reserve Mermaid diagrams for concepts involving more than seven interacting subjects (such as components, states, or stages) with complex sequencing, branching, or dependencies that prose alone makes hard to follow.
|
|
50
|
+
|
|
51
|
+
The subject count alone does not justify a diagram; omit diagrams for simple sequences or relationships that a short paragraph or list explains clearly. A diagram should give users and later agents an overview of the interactions.
|
|
52
|
+
|
|
53
|
+
Keep each diagram focused on one process, use readable labels, and explain the important decisions in surrounding prose with precise source-symbol links. Prefer a small overview or several focused diagrams over one dense diagram. Use fenced `mermaid` blocks and run `lat check` to validate syntax and readability.
|
|
38
54
|
|
|
39
55
|
# Test specs
|
|
40
56
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
# lat.md conventions this project enforces
|
|
2
2
|
|
|
3
|
-
`lat check` fails on
|
|
4
|
-
|
|
5
|
-
in `lat.md/`, never
|
|
3
|
+
`lat check` fails on the first three rules below. The last three it cannot see,
|
|
4
|
+
and they matter as much. None of the six are optional. This block is generated
|
|
5
|
+
and a later `lat init` replaces it: record project guidance in `lat.md/`, never
|
|
6
|
+
here.
|
|
6
7
|
|
|
7
8
|
## Every document goes in a Diátaxis mode directory
|
|
8
9
|
|
|
@@ -13,18 +14,44 @@ enforces one shape rule for each:
|
|
|
13
14
|
| --- | --- | --- |
|
|
14
15
|
| `lat.md/tutorials/` | a guided first pass for someone new | an ordered list of steps, and a stated outcome |
|
|
15
16
|
| `lat.md/how-to/` | a recipe for a task that recurs | an ordered list of steps |
|
|
16
|
-
| `lat.md/reference/` | lookup facts: fields, states, limits, names | no narrative prose
|
|
17
|
+
| `lat.md/reference/` | lookup facts: fields, states, limits, names | no narrative prose (no second paragraph under a heading) |
|
|
17
18
|
| `lat.md/explanation/` | why the design is what it is | no imperative commands |
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
A document is classified either by the directory it sits in, or by declaring
|
|
21
|
+
the mode in its own frontmatter:
|
|
22
|
+
|
|
23
|
+
```markdown
|
|
24
|
+
---
|
|
25
|
+
lat:
|
|
26
|
+
mode: explanation
|
|
27
|
+
---
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Both are enforced identically: `lat check mode` applies the shape rule to any
|
|
31
|
+
document that declares a mode, whether or not the root index carries
|
|
32
|
+
`require-mode: true`. That flag adds a separate rule: a document declaring *no*
|
|
33
|
+
mode, in no mode directory, becomes an error too.
|
|
34
|
+
|
|
35
|
+
Prefer the directory in a tree you own outright. Prefer the declaration when
|
|
36
|
+
the file cannot move, such as a document another project maintains or a tree
|
|
37
|
+
other agents are writing to while you work. Moving costs every reference to the
|
|
38
|
+
file; declaring costs nothing at read time, because frontmatter sits above the
|
|
39
|
+
first heading and outside every section.
|
|
22
40
|
|
|
23
41
|
**A document that fails its mode is usually two documents.** A file that lists
|
|
24
42
|
the states *and* argues for the design is mixed: the lookup half goes in
|
|
25
43
|
`reference/`, the reasoning half in `explanation/`, and each links the other.
|
|
26
44
|
Filing it under one mode and softening the prose until the check passes is the
|
|
27
|
-
wrong repair.
|
|
45
|
+
wrong repair.
|
|
46
|
+
|
|
47
|
+
Classifying a mixed document does not make it pass. Narrative prose put under
|
|
48
|
+
`reference/` fails on contact, because a reference may not carry a second
|
|
49
|
+
paragraph under a heading, so a move is not a way to adopt the rule cheaply.
|
|
50
|
+
Split first, then place. And `explanation` is not the safe default: it bans
|
|
51
|
+
only imperative commands, so nearly any prose passes it. Declaring it is a
|
|
52
|
+
claim about the document, not somewhere to put whatever is left over. A
|
|
53
|
+
document you cannot honestly classify is better left undeclared than
|
|
54
|
+
mislabelled.
|
|
28
55
|
|
|
29
56
|
Classify before writing, not after. If a `diataxis` skill is available, use it.
|
|
30
57
|
|
|
@@ -34,8 +61,8 @@ Classify before writing, not after. If a `diataxis` skill is available, use it.
|
|
|
34
61
|
codebase. A graph nothing points at cannot be reached from the code, which is
|
|
35
62
|
the only reason it exists.
|
|
36
63
|
|
|
37
|
-
Start at the application entrypoint
|
|
38
|
-
`main.go`, `manage.py`, whatever a new reader opens first
|
|
64
|
+
Start at the application entrypoint (`config/application.rb`, `src/index.ts`,
|
|
65
|
+
`main.go`, `manage.py`, whatever a new reader opens first) and point it at the
|
|
39
66
|
root index:
|
|
40
67
|
|
|
41
68
|
```ruby
|
|
@@ -52,7 +79,7 @@ A repository that minimises, budgets, or forbids comments is right about prose
|
|
|
52
79
|
comments and does not reach this one. An `@lat:` line is a machine directive,
|
|
53
80
|
in the same class as `# frozen_string_literal:` or `// eslint-disable`. It
|
|
54
81
|
carries no rationale, asserts nothing a reader could dispute, and cannot rot
|
|
55
|
-
quietly
|
|
82
|
+
quietly: `lat check` fails the moment its target moves or disappears.
|
|
56
83
|
|
|
57
84
|
Add the ref. Then, if the reasoning that would have been a comment is worth
|
|
58
85
|
keeping, put it in a `lat.md/explanation/` section and let the pointer reach it.
|
|
@@ -93,3 +120,98 @@ Every leaf section then needs exactly one `@lat:` comment at the test that
|
|
|
93
120
|
covers it, and every section needs at least one sentence saying what it
|
|
94
121
|
verifies and why. `lat check` reports any spec section no test claims, and any
|
|
95
122
|
ref pointing at no section.
|
|
123
|
+
|
|
124
|
+
## One specialty per document
|
|
125
|
+
|
|
126
|
+
A document is **small**, **discrete**, and does **not conflict** with any
|
|
127
|
+
other. Those are three demands on the same thing: a reader must be able to
|
|
128
|
+
find the one place a fact is written down, and trust it.
|
|
129
|
+
|
|
130
|
+
**Small: a document covers one specialty.** Not one topic area; one
|
|
131
|
+
specialty. When a document covers two, it is two documents. Past roughly forty
|
|
132
|
+
sections it has almost certainly become several, and an agent then loads all of
|
|
133
|
+
it to reach one part.
|
|
134
|
+
|
|
135
|
+
**Discrete: each document covers its own specialty.** Before writing a new
|
|
136
|
+
document, search for the specialty first:
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
lat search "the thing you are about to document"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
An overlap has two honest repairs, and picking neither is what produces the
|
|
143
|
+
third copy. Either the two are one document and belong merged, or the part they
|
|
144
|
+
share is its own document that both link. Deciding they are "mostly different"
|
|
145
|
+
and writing anyway is how the set rots.
|
|
146
|
+
|
|
147
|
+
**Does not conflict: two documents never say different things about the same
|
|
148
|
+
specialty.** Never restate a fact another document owns. Link to it with
|
|
149
|
+
`[[section]]`. A restatement is a second copy, a second copy drifts, and drift
|
|
150
|
+
is how document B ends up contradicting document A while both look maintained.
|
|
151
|
+
|
|
152
|
+
The mode rule above is the sharpest available test of "one specialty": a
|
|
153
|
+
document that fails its mode is usually two documents. Split it. Do not soften
|
|
154
|
+
the prose until the check passes.
|
|
155
|
+
|
|
156
|
+
## Write in a tight Strunk & White voice
|
|
157
|
+
|
|
158
|
+
Diátaxis governs what a document is and where it sits. *The Elements of Style*
|
|
159
|
+
governs every sentence inside it. Preserve every fact and design constraint, and
|
|
160
|
+
make it land harder in fewer words. When in doubt, ask whether Strunk & White
|
|
161
|
+
would red-pen the line.
|
|
162
|
+
|
|
163
|
+
1. **Omit needless words.** Every word must earn its place. Cut throat-clearing
|
|
164
|
+
("What this module does is straightforward"). If it is straightforward, the
|
|
165
|
+
prose will show it.
|
|
166
|
+
2. **Prefer the active voice.** Passive voice hides the actor and saps energy.
|
|
167
|
+
Name the module, function, or caller that acts ("`scanCodeRefs` walks every
|
|
168
|
+
source file", not "source files are walked").
|
|
169
|
+
3. **Put statements in positive form.** Say what something is, not what it is
|
|
170
|
+
not ("The cache stores parsed ASTs in memory", not "The cache does not
|
|
171
|
+
persist across runs").
|
|
172
|
+
4. **Be concrete, not corporate.** Replace abstractions with specifics. Name the
|
|
173
|
+
file, symbol, flag, or state instead of gesturing at "workflows",
|
|
174
|
+
"capabilities", or "alignment".
|
|
175
|
+
5. **Brevity is courtesy.** Respect the reader's time and context window. A
|
|
176
|
+
tight sentence carries more weight than a padded paragraph.
|
|
177
|
+
6. **Let confidence speak quietly.** Do not hedge or oversell. State what the
|
|
178
|
+
code does and what the design trades off. Cut qualifiers ("very",
|
|
179
|
+
"extremely") and exclamation marks.
|
|
180
|
+
7. **One thought per sentence.** When a sentence tries to do two things, split
|
|
181
|
+
it so each thought lands.
|
|
182
|
+
8. **Reason first, conclusion second.** When a sentence contains both a reason
|
|
183
|
+
and a claim, lead with the reason so the reader follows the logic instead of
|
|
184
|
+
being told the answer and then backfilled ("Most queries touch one section,
|
|
185
|
+
so `lat section` loads only that range" rather than "`lat section` loads only
|
|
186
|
+
that range as most queries touch one section").
|
|
187
|
+
9. **Jargon is fine; obscurity is not.** Technical terms are precise when the
|
|
188
|
+
reader knows them. When introducing a project-specific term, define it in
|
|
189
|
+
plain words on first use.
|
|
190
|
+
10. **Vary sentence rhythm.** Uniform sentence length sounds robotic. Mix short
|
|
191
|
+
sentences with longer ones that build through a clause or two. A short
|
|
192
|
+
sentence after two longer ones creates emphasis.
|
|
193
|
+
11. **No em dashes and no horizontal rules.** Never use em dashes in prose;
|
|
194
|
+
they are an AI tell. Use a colon to introduce a list or elaboration, commas
|
|
195
|
+
or parentheses for an aside, and a period or semicolon between independent
|
|
196
|
+
thoughts. Never use horizontal rules (`---`, `***`, `___`) to separate
|
|
197
|
+
sections; use a blank line or a heading instead. (YAML frontmatter
|
|
198
|
+
delimiters remain `---`.)
|
|
199
|
+
|
|
200
|
+
## Read sections, not files
|
|
201
|
+
|
|
202
|
+
`lat search` prints a section id and the exact lines that section occupies.
|
|
203
|
+
Resolve it with `lat section`, or read only that line range. Opening the whole
|
|
204
|
+
file is the reflex to break, and it is the expensive one:
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
lat search "how does backend selection work"
|
|
208
|
+
lat section "cli#CLI#search#Backend selection"
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
not a `read` of `lat.md/cli.md`. Measured on lat.md's own graph, the section
|
|
212
|
+
costs 4 KB against the file's 44 KB, eleven times the context for the same
|
|
213
|
+
answer, and the answer arrives buried in forty-one sections that were not
|
|
214
|
+
asked about.
|
|
215
|
+
|
|
216
|
+
Use `lat expand` on a prompt carrying `[[refs]]` for the same reason: it
|
|
217
|
+
resolves each ref to a location and a preview rather than to a file.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type Plugin, tool } from "@opencode-ai/plugin"
|
|
2
|
-
import { execSync } from "child_process"
|
|
2
|
+
import { execSync, execFileSync } from "child_process"
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
const LAT =
|
|
4
|
+
/** Executable and prefix arguments, injected by `lat init`. */
|
|
5
|
+
const LAT = __LAT_INVOCATION__
|
|
6
6
|
|
|
7
7
|
function run(args: string[]): string {
|
|
8
|
-
return
|
|
8
|
+
return execFileSync(LAT.command, [...LAT.args, ...args], {
|
|
9
9
|
cwd: process.cwd(),
|
|
10
10
|
encoding: "utf-8",
|
|
11
11
|
timeout: 30_000,
|
|
@@ -33,7 +33,7 @@ export const LatPlugin: Plugin = async (ctx) => {
|
|
|
33
33
|
),
|
|
34
34
|
},
|
|
35
35
|
async execute(args) {
|
|
36
|
-
const cliArgs = ["search",
|
|
36
|
+
const cliArgs = ["search", args.query]
|
|
37
37
|
if (args.limit) cliArgs.push("--limit", String(args.limit))
|
|
38
38
|
const output = tryRun(cliArgs)
|
|
39
39
|
return output || "No results found."
|
|
@@ -49,7 +49,7 @@ export const LatPlugin: Plugin = async (ctx) => {
|
|
|
49
49
|
),
|
|
50
50
|
},
|
|
51
51
|
async execute(args) {
|
|
52
|
-
const output = tryRun(["section",
|
|
52
|
+
const output = tryRun(["section", args.query])
|
|
53
53
|
return output || "Section not found."
|
|
54
54
|
},
|
|
55
55
|
}),
|
|
@@ -61,7 +61,7 @@ export const LatPlugin: Plugin = async (ctx) => {
|
|
|
61
61
|
query: tool.schema.string("Section name to locate"),
|
|
62
62
|
},
|
|
63
63
|
async execute(args) {
|
|
64
|
-
const output = tryRun(["locate",
|
|
64
|
+
const output = tryRun(["locate", args.query])
|
|
65
65
|
return output || "No sections matching query."
|
|
66
66
|
},
|
|
67
67
|
}),
|
|
@@ -87,7 +87,7 @@ export const LatPlugin: Plugin = async (ctx) => {
|
|
|
87
87
|
text: tool.schema.string("Text containing [[refs]] to expand"),
|
|
88
88
|
},
|
|
89
89
|
async execute(args) {
|
|
90
|
-
const output = tryRun(["expand",
|
|
90
|
+
const output = tryRun(["expand", args.text])
|
|
91
91
|
return output || args.text
|
|
92
92
|
},
|
|
93
93
|
}),
|
|
@@ -101,7 +101,7 @@ export const LatPlugin: Plugin = async (ctx) => {
|
|
|
101
101
|
),
|
|
102
102
|
},
|
|
103
103
|
async execute(args) {
|
|
104
|
-
const output = tryRun(["refs",
|
|
104
|
+
const output = tryRun(["refs", args.query])
|
|
105
105
|
return output || "No references found."
|
|
106
106
|
},
|
|
107
107
|
}),
|