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.
Files changed (2) hide show
  1. package/package.json +2 -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.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
+ }
@@ -1,12 +1,23 @@
1
- # lat.md
1
+ # Before starting work
2
2
 
3
- 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.
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
- ## Why
6
+ # Post-task checklist (REQUIRED — do not skip)
6
7
 
7
- The `lat.md/` directory 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.
8
+ After EVERY task, before responding to the user:
8
9
 
9
- ## Commands
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
- ## Syntax primer
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
- Run `lat --help` when in doubt about available commands or options.
40
+ # Test specs
26
41
 
27
- ## Workflow
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
- 1. **Before starting work**, run `lat search` to find sections relevant to your task. Read them to understand the design intent before writing code. 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, remove this search step from your workflow and use `lat locate` for direct lookups instead.
44
+ ```markdown
45
+ ---
46
+ lat:
47
+ require-code-mention: true
48
+ ---
49
+ # Tests
30
50
 
31
- 2. **Process user prompts** through `lat prompt` to expand any `[[refs]]` the user includes — this resolves section names to file locations and provides context.
32
-
33
- 3. **After implementing changes**, check if the `lat.md/` files need updating. If you added new functionality, changed architecture, or modified behavior described in `lat.md/`, update the relevant files. Create new files if no existing one fits.
51
+ ## User login
52
+ ### Rejects expired tokens
53
+ ### Handles missing password
54
+ ```
34
55
 
35
- 4. **After running tests**, always run `lat check` to verify all wiki links resolve and all required code references exist.
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.