libgrite_cli/
agents_md.rs1pub const GRITE_AGENTS_SECTION: &str = r#"## Grite
3
4This repository uses **Grite** as the canonical task and memory system. **Always use grite commands** (not git) for task/issue tracking.
5
6### When to use grite
7
8- **"What tasks are done/open?"** -> `grite issue list`
9- **"What did I work on?"** -> `grite issue list --state closed`
10- **"What do I know about X?"** -> `grite issue list --label memory`
11- **"What should I work on next?"** -> `grite issue dep topo --state open`
12- **"What does function X do?"** -> `grite context query X`
13- **Starting a new task** -> `grite issue create`
14- **Making progress** -> `grite issue comment`
15- **Task A depends on B** -> `grite issue dep add`
16
17### Startup routine
18
19Run at the beginning of each session:
20
21```bash
22grite sync --pull --json
23grite issue list --json
24grite issue dep topo --state open --json
25```
26
27### Creating tasks/memories
28
29```bash
30# Create a task
31grite issue create --title "Task title" --body "Description" --label agent:todo --json
32
33# Store a discovery as memory
34grite issue create --title "[Memory] Topic" --body "What you learned..." --label memory --json
35```
36
37### Working on issues
38
39```bash
40# Add a comment with your plan before coding
41grite issue comment <ID> --body "Plan: ..." --json
42
43# Add checkpoint comments after milestones
44grite issue comment <ID> --body "Checkpoint: what changed, why, tests run" --json
45
46# Close when done
47grite issue close <ID> --json
48grite sync --push --json
49```
50
51### Querying tasks
52
53```bash
54# All issues
55grite issue list --json
56
57# Open tasks
58grite issue list --state open --json
59
60# Completed tasks
61grite issue list --state closed --json
62
63# Memories
64grite issue list --label memory --json
65```
66
67### Dependencies
68
69Track task ordering and blockers with a dependency DAG:
70
71```bash
72# Task A depends on Task B (B must complete first)
73grite issue dep add <A> --target <B> --type depends_on --json
74
75# Task A blocks Task B (A must complete first)
76grite issue dep add <A> --target <B> --type blocks --json
77
78# Mark tasks as related (no ordering constraint)
79grite issue dep add <A> --target <B> --type related_to --json
80
81# List what an issue depends on
82grite issue dep list <ID> --json
83
84# List what depends on an issue (reverse)
85grite issue dep list <ID> --reverse --json
86
87# Get execution order (topological sort of open tasks)
88grite issue dep topo --state open --json
89```
90
91**Always run `dep topo`** at session start to determine which task to work on next.
92
93### Context store
94
95Index and query codebase structure for fast navigation:
96
97```bash
98# Index all tracked files (skips unchanged files)
99grite context index --json
100
101# Index specific files or patterns
102grite context index --path src/main.py --json
103grite context index --pattern "*.rs" --json
104
105# Query for a symbol (function, class, struct, etc.)
106grite context query <symbol_name> --json
107
108# Show all symbols in a file
109grite context show <file_path> --json
110
111# Set project-level context (conventions, architecture notes)
112grite context set <key> <value> --json
113
114# View all project context
115grite context project --json
116```
117
118**Index after significant code changes** to keep the symbol database current.
119
120### Key flags
121
122- `--json` - Use for all commands (machine-readable output)
123- `--quiet` - Suppress human output
124"#;