lat.md 0.1.1 → 0.1.2
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 +2 -2
- package/templates/AGENTS.md +34 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lat.md",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "A knowledge graph for your codebase, written in markdown",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@10.30.2",
|
|
@@ -57,4 +57,4 @@
|
|
|
57
57
|
"unified": "^11.0.0",
|
|
58
58
|
"unist-util-visit": "^5.0.0"
|
|
59
59
|
}
|
|
60
|
-
}
|
|
60
|
+
}
|
package/templates/AGENTS.md
CHANGED
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Before starting work
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
- Run `lat search` to find sections relevant to your task. Read them to understand the design intent before writing code.
|
|
4
|
+
- Run `lat prompt` on user prompts to expand any `[[refs]]` — this resolves section names to file locations and provides context.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
# Post-task checklist (REQUIRED — do not skip)
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
After EVERY task, before responding to the user:
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
- [ ] Update `lat.md/` if you added or changed any functionality, architecture, tests, or behavior
|
|
11
|
+
- [ ] Run `lat check` — all wiki links and code refs must pass
|
|
12
|
+
- [ ] Do not skip these steps. Do not consider your task done until both are complete.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# What is lat.md?
|
|
17
|
+
|
|
18
|
+
This project uses [lat.md](https://www.npmjs.com/package/lat.md) to maintain a structured knowledge graph of its architecture, design decisions, and test specs in the `lat.md/` directory. It is a set of cross-linked markdown files that describe **what** this project does and **why** — the domain concepts, key design decisions, business logic, and test specifications. Use it to ground your work in the actual architecture rather than guessing.
|
|
19
|
+
|
|
20
|
+
# Commands
|
|
10
21
|
|
|
11
22
|
```bash
|
|
12
23
|
lat locate "Section Name" # find a section by name (exact, fuzzy)
|
|
@@ -16,20 +27,30 @@ lat prompt "user prompt text" # expand [[refs]] to resolved locations
|
|
|
16
27
|
lat check # validate all links and code refs
|
|
17
28
|
```
|
|
18
29
|
|
|
19
|
-
|
|
30
|
+
Run `lat --help` when in doubt about available commands or options.
|
|
31
|
+
|
|
32
|
+
If `lat search` fails because `LAT_LLM_KEY` is not set, explain to the user that semantic search requires an API key (`export LAT_LLM_KEY=sk-...` for OpenAI or `export LAT_LLM_KEY=vck_...` for Vercel). If the user doesn't want to set it up, use `lat locate` for direct lookups instead.
|
|
33
|
+
|
|
34
|
+
# Syntax primer
|
|
20
35
|
|
|
21
36
|
- **Section ids**: `file-stem#Heading#SubHeading` (e.g. `cli#search#Indexing`)
|
|
22
37
|
- **Wiki links**: `[[target]]` or `[[target|alias]]` — cross-references between sections
|
|
23
38
|
- **Code refs**: `// @lat: [[section-id]]` (JS/TS) or `# @lat: [[section-id]]` (Python) — ties source code to concepts
|
|
24
39
|
|
|
25
|
-
|
|
40
|
+
# Test specs
|
|
26
41
|
|
|
27
|
-
|
|
42
|
+
Key tests can be described as sections in `lat.md/` files (e.g. `tests.md`). Add frontmatter to require that every leaf section is referenced by a `// @lat:` or `# @lat:` comment in test code:
|
|
28
43
|
|
|
29
|
-
|
|
44
|
+
```markdown
|
|
45
|
+
---
|
|
46
|
+
lat:
|
|
47
|
+
require-code-mention: true
|
|
48
|
+
---
|
|
49
|
+
# Tests
|
|
30
50
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
51
|
+
## User login
|
|
52
|
+
### Rejects expired tokens
|
|
53
|
+
### Handles missing password
|
|
54
|
+
```
|
|
34
55
|
|
|
35
|
-
|
|
56
|
+
Each test in code should reference its spec: `// @lat: [[tests#User login#Rejects expired tokens]]`. Running `lat check` will flag any spec section not covered by a code reference, and any code reference pointing to a nonexistent section.
|