@lore-ai/cli 0.1.6
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 +178 -0
- package/dist/bin/lore.js +14666 -0
- package/dist/bin/lore.js.map +1 -0
- package/dist/ui/assets/Analytics-W2ANIC2s.js +1 -0
- package/dist/ui/assets/ConversationDetail-Ct-hROwS.js +5 -0
- package/dist/ui/assets/Conversations-iK7E6GEl.js +1 -0
- package/dist/ui/assets/MarkdownPreview-2zDiish4.js +17 -0
- package/dist/ui/assets/MarkdownPreview-ZgkIHsf0.css +1 -0
- package/dist/ui/assets/Mcps-CCT1FQ4H.js +1 -0
- package/dist/ui/assets/Overview-B_jOY8il.js +1 -0
- package/dist/ui/assets/PhaseReview-B_DDY9YB.js +1 -0
- package/dist/ui/assets/RepoScans-FxiMynYO.js +2 -0
- package/dist/ui/assets/RepoSelector-DmPRS8kf.js +1 -0
- package/dist/ui/assets/ResizablePanels-Bbb4S6Ss.js +1 -0
- package/dist/ui/assets/Review-KjvS-DNP.js +3 -0
- package/dist/ui/assets/ScanConversation-BonEB7pv.js +1 -0
- package/dist/ui/assets/Scans-DXf2sNms.js +1 -0
- package/dist/ui/assets/Skills-MvVWWoB2.js +1 -0
- package/dist/ui/assets/ToolUsage-DA5MJNwl.js +33 -0
- package/dist/ui/assets/Vetting-BRGVrtOA.js +1 -0
- package/dist/ui/assets/index-CVSL0ryk.js +12 -0
- package/dist/ui/assets/index-DYKYIfPr.css +1 -0
- package/dist/ui/assets/markdown-CZuQZQX5.js +35 -0
- package/dist/ui/index.html +15 -0
- package/package.json +96 -0
- package/prompts/analyze-feedback.md +67 -0
- package/prompts/apply-refs-update.md +149 -0
- package/prompts/apply-skill-update.md +151 -0
- package/prompts/check-relevance.md +137 -0
- package/prompts/classify-conversations.md +78 -0
- package/prompts/cluster-repo-summaries.md +76 -0
- package/prompts/detect-staleness.md +42 -0
- package/prompts/distill-changes.md +62 -0
- package/prompts/distill-decisions.md +48 -0
- package/prompts/distill-patterns.md +39 -0
- package/prompts/generate-changelog.md +42 -0
- package/prompts/generate-references.md +192 -0
- package/prompts/generate-repo-skill.md +387 -0
- package/prompts/global-summary.md +55 -0
- package/prompts/orchestrate-merge.md +70 -0
- package/prompts/pr-description.md +49 -0
- package/prompts/research-repo.md +121 -0
- package/prompts/summarize-conversation.md +64 -0
- package/prompts/test-mcp.md +62 -0
- package/prompts/test-skill.md +72 -0
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
<role>
|
|
2
|
+
You are a technical writer generating a multi-file development skill for an AI coding agent.
|
|
3
|
+
You have Bash access to read existing files, write generated files, and report progress.
|
|
4
|
+
|
|
5
|
+
Write each generated file directly to disk. Your stdout output is only for confirmation summaries.
|
|
6
|
+
</role>
|
|
7
|
+
|
|
8
|
+
<tools>
|
|
9
|
+
You have Bash access. Use it for:
|
|
10
|
+
|
|
11
|
+
1. **Read the existing skill** (if updating) to merge with new findings:
|
|
12
|
+
```bash
|
|
13
|
+
cat "{{SKILL_DIR}}/SKILL.md"
|
|
14
|
+
cat "{{SKILL_DIR}}/established-patterns.md"
|
|
15
|
+
cat "{{SKILL_DIR}}/guidelines.md"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
2. **List existing files** to see the current skill structure:
|
|
19
|
+
```bash
|
|
20
|
+
ls "{{SKILL_DIR}}/"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
3. **Write each generated file to disk** using a heredoc:
|
|
24
|
+
```bash
|
|
25
|
+
mkdir -p "{{SKILL_DIR}}"
|
|
26
|
+
cat > "{{SKILL_DIR}}/SKILL.md" << 'LORE_EOF'
|
|
27
|
+
(full content including frontmatter)
|
|
28
|
+
LORE_EOF
|
|
29
|
+
```
|
|
30
|
+
Use `cat >` with the `LORE_EOF` heredoc delimiter for EVERY file you write.
|
|
31
|
+
The single quotes around 'LORE_EOF' prevent shell variable expansion.
|
|
32
|
+
|
|
33
|
+
4. **Report progress** after writing each file to disk (best-effort, silent on failure):
|
|
34
|
+
```bash
|
|
35
|
+
echo '{"file":"FILENAME","completed":N,"total":{{TOTAL_FILES}},"phase":"gen-core"}' > "{{PROGRESS_FILE}}"
|
|
36
|
+
curl -s -X POST http://localhost:{{UI_PORT}}/api/events/progress \
|
|
37
|
+
-H 'Content-Type: application/json' \
|
|
38
|
+
-d '{"file":"FILENAME","completed":N,"total":{{TOTAL_FILES}},"phase":"gen-core"}' 2>/dev/null || true
|
|
39
|
+
```
|
|
40
|
+
The `echo` line writes a local progress file so the CLI can show progress even when the web UI is not running. Always run BOTH lines.
|
|
41
|
+
|
|
42
|
+
If an existing skill directory exists, read it before writing to preserve valuable content.
|
|
43
|
+
If the directory does not exist, create it with `mkdir -p` and generate from scratch.
|
|
44
|
+
</tools>
|
|
45
|
+
|
|
46
|
+
<research_findings>
|
|
47
|
+
{{RESEARCH_DOC}}
|
|
48
|
+
</research_findings>
|
|
49
|
+
|
|
50
|
+
<installed_skills>
|
|
51
|
+
The user has the following skills already installed and available to the AI agent.
|
|
52
|
+
Do NOT re-document patterns, workflows, or conventions already covered by these
|
|
53
|
+
skills. Instead, add a brief cross-reference when relevant:
|
|
54
|
+
"For [topic], see the [skill-name] skill."
|
|
55
|
+
This keeps the generated guide focused on repo-specific knowledge only.
|
|
56
|
+
|
|
57
|
+
{{INSTALLED_SKILLS_DIGEST}}
|
|
58
|
+
</installed_skills>
|
|
59
|
+
|
|
60
|
+
<installed_mcps>
|
|
61
|
+
The user has the following public MCP servers configured. Public MCPs (available via
|
|
62
|
+
npm/pypi) that are actively used should be documented in the generated SKILL.md —
|
|
63
|
+
include how the repo leverages them, relevant tool names, and integration patterns.
|
|
64
|
+
|
|
65
|
+
{{INSTALLED_MCPS_DIGEST}}
|
|
66
|
+
</installed_mcps>
|
|
67
|
+
|
|
68
|
+
<clustered_knowledge>
|
|
69
|
+
Clustered conversation knowledge for this repo (themes, decisions, patterns, conflicts resolved from AI coding conversations):
|
|
70
|
+
|
|
71
|
+
{{CLUSTERED_KNOWLEDGE}}
|
|
72
|
+
</clustered_knowledge>
|
|
73
|
+
|
|
74
|
+
<git_history>
|
|
75
|
+
Recent git activity:
|
|
76
|
+
|
|
77
|
+
{{GIT_LOG}}
|
|
78
|
+
</git_history>
|
|
79
|
+
|
|
80
|
+
<context>
|
|
81
|
+
Skill directory: {{SKILL_DIR}}
|
|
82
|
+
</context>
|
|
83
|
+
|
|
84
|
+
<task>
|
|
85
|
+
Synthesize the research findings, clustered conversation knowledge, and git history into a multi-file skill.
|
|
86
|
+
If an existing skill exists at {{SKILL_DIR}}, read it via Bash and merge new findings — preserve valuable content and add new insights.
|
|
87
|
+
|
|
88
|
+
Workflow:
|
|
89
|
+
1. Check if existing skill files exist (read via Bash)
|
|
90
|
+
2. Generate/update each file
|
|
91
|
+
3. Write each file to disk via Bash (`cat > "{{SKILL_DIR}}/FILENAME" << 'LORE_EOF'`)
|
|
92
|
+
4. Report progress after writing each file
|
|
93
|
+
|
|
94
|
+
Write MULTIPLE files to disk. At minimum write SKILL.md. Add supporting files only when
|
|
95
|
+
there is substantive content to fill them — never generate empty or placeholder files.
|
|
96
|
+
|
|
97
|
+
5. **Generate trigger test cases** alongside skill files:
|
|
98
|
+
```bash
|
|
99
|
+
cat > "{{SKILL_DIR}}/test-triggers.json" << 'LORE_EOF'
|
|
100
|
+
{
|
|
101
|
+
"shouldTrigger": [
|
|
102
|
+
"natural-language query that should activate this skill",
|
|
103
|
+
"another phrasing that should trigger it",
|
|
104
|
+
"a third variant"
|
|
105
|
+
],
|
|
106
|
+
"shouldNotTrigger": [
|
|
107
|
+
"query about an unrelated topic",
|
|
108
|
+
"query that might seem related but should not trigger"
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
LORE_EOF
|
|
112
|
+
```
|
|
113
|
+
Generate 3-5 shouldTrigger phrases and 2-3 shouldNotTrigger phrases based on the skill's description field.
|
|
114
|
+
</task>
|
|
115
|
+
|
|
116
|
+
<output_format>
|
|
117
|
+
Write each file to disk using Bash heredoc:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
mkdir -p "{{SKILL_DIR}}"
|
|
121
|
+
cat > "{{SKILL_DIR}}/SKILL.md" << 'LORE_EOF'
|
|
122
|
+
(content)
|
|
123
|
+
LORE_EOF
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Self-validation before finalizing**: After writing all files, verify:
|
|
127
|
+
- [ ] Every section in SKILL.md has substantive content (no placeholders like "[TODO]" or "No data available")
|
|
128
|
+
- [ ] Code examples are from the actual repo (real file paths), not generic/theoretical
|
|
129
|
+
- [ ] The `description` field includes WHAT, WHEN (natural-language phrases), and EXCLUSIONS
|
|
130
|
+
- [ ] All file paths in the Key Entry Points table actually exist in the repo
|
|
131
|
+
- [ ] established-patterns.md has both correct usage AND anti-pattern examples for each pattern
|
|
132
|
+
- [ ] guidelines.md does NOT duplicate content from established-patterns.md (cross-references only)
|
|
133
|
+
- [ ] SKILL.md is under 500 lines
|
|
134
|
+
|
|
135
|
+
If any check fails, fix the issue before outputting the summary.
|
|
136
|
+
|
|
137
|
+
After all files are written, output a summary: `WRITTEN: SKILL.md, established-patterns.md, guidelines.md`
|
|
138
|
+
|
|
139
|
+
## SKILL.md Structure
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
---
|
|
143
|
+
name: {{SKILL_NAME}}
|
|
144
|
+
description: |
|
|
145
|
+
[GENERATE: third-person, max 1024 chars. Structure as THREE parts:
|
|
146
|
+
|
|
147
|
+
PART 1 — WHAT: "Development guide for org/repo. Covers X architecture, Y patterns, Z conventions."
|
|
148
|
+
PART 2 — WHEN (natural-language trigger phrases): "Use when working in this repo, asking about [specific workflow], debugging [specific system], adding [specific component type], or modifying [specific module]." Write 3-5 phrases a developer would naturally say — not a keyword list.
|
|
149
|
+
PART 3 — EXCLUSIONS (negative triggers): "Do NOT use for [unrelated task the agent might confuse with this repo]." Add 1-2 exclusion clauses to prevent over-triggering against other installed skills.
|
|
150
|
+
|
|
151
|
+
Good example: "Development guide for acme/payments. Covers Stripe integration, webhook processing, idempotency patterns. Use when adding payment methods, debugging webhook failures, modifying checkout flow, or asking about subscription lifecycle. Do NOT use for general billing questions handled by the billing-ops skill."
|
|
152
|
+
Bad example: "Development guide for acme/payments. Triggers on: Stripe, webhook, payment, checkout, subscription."]
|
|
153
|
+
lastUpdated: "{{TIMESTAMP}}"
|
|
154
|
+
generatedBy: lore
|
|
155
|
+
conversationCount: {{CONVERSATION_COUNT}}
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
# [Repo Name] Development Guide
|
|
159
|
+
|
|
160
|
+
## Quick Reference
|
|
161
|
+
|
|
162
|
+
| Task | Action |
|
|
163
|
+
|------|--------|
|
|
164
|
+
| [Common task 1] | [Specific action or file to read] |
|
|
165
|
+
| [Common task 2] | [Specific action or file to read] |
|
|
166
|
+
| Established patterns | See [established-patterns.md](established-patterns.md) |
|
|
167
|
+
| Architecture/guidelines | See [guidelines.md](guidelines.md) |
|
|
168
|
+
|
|
169
|
+
## Architecture Overview
|
|
170
|
+
|
|
171
|
+
[2-4 paragraphs: purpose, layers, data flow. Concise — agent is smart.]
|
|
172
|
+
|
|
173
|
+
## Key Entry Points
|
|
174
|
+
|
|
175
|
+
| File | Purpose |
|
|
176
|
+
|------|---------|
|
|
177
|
+
| `path/to/file.ts` | [One-line description] |
|
|
178
|
+
| `path/to/other.ts` | [One-line description] |
|
|
179
|
+
|
|
180
|
+
## Development Workflow
|
|
181
|
+
|
|
182
|
+
### New Feature
|
|
183
|
+
|
|
184
|
+
1. [ ] Analyze: [what to examine first]
|
|
185
|
+
2. [ ] Design: [key decisions to make]
|
|
186
|
+
3. [ ] Implement: [which patterns to follow]
|
|
187
|
+
4. [ ] Validate: [how to verify correctness]
|
|
188
|
+
|
|
189
|
+
### Bug Fix
|
|
190
|
+
|
|
191
|
+
1. [ ] Locate: [where to look, how to reproduce]
|
|
192
|
+
2. [ ] Fix: [patterns to follow]
|
|
193
|
+
3. [ ] Test: [how to verify]
|
|
194
|
+
|
|
195
|
+
## Coding Patterns (Summary)
|
|
196
|
+
|
|
197
|
+
[Brief summary of the 3-5 most important patterns. For full details with code examples and rules,
|
|
198
|
+
see [established-patterns.md](established-patterns.md).]
|
|
199
|
+
|
|
200
|
+
## Architecture Decisions
|
|
201
|
+
|
|
202
|
+
[Key decisions extracted from conversations. Format: "Decision — Rationale"]
|
|
203
|
+
|
|
204
|
+
## Conventions
|
|
205
|
+
|
|
206
|
+
[Naming, file organization, code style — concise bullet points]
|
|
207
|
+
|
|
208
|
+
## Validation Checkpoints
|
|
209
|
+
|
|
210
|
+
After any implementation:
|
|
211
|
+
|
|
212
|
+
- [ ] [Check 1 relevant to this repo]
|
|
213
|
+
- [ ] [Check 2 relevant to this repo]
|
|
214
|
+
- [ ] [Check 3 relevant to this repo]
|
|
215
|
+
|
|
216
|
+
## Known Issues / Troubleshooting
|
|
217
|
+
|
|
218
|
+
| Symptom | Cause | Fix |
|
|
219
|
+
|---------|-------|-----|
|
|
220
|
+
| [Common error or gotcha from conversations] | [Root cause] | [How to fix or work around] |
|
|
221
|
+
|
|
222
|
+
[Surface gotchas, warnings, and common pitfalls discovered in conversations (from the `importantNotes`
|
|
223
|
+
field in conversation summaries). Only include issues that a developer would realistically encounter.
|
|
224
|
+
Omit this section if no substantive issues were found.]
|
|
225
|
+
|
|
226
|
+
## Recent Changes
|
|
227
|
+
|
|
228
|
+
| Date | Description |
|
|
229
|
+
|------|-------------|
|
|
230
|
+
| YYYY-MM-DD | [Change description] |
|
|
231
|
+
|
|
232
|
+
## Additional Resources
|
|
233
|
+
|
|
234
|
+
- [Established Patterns](established-patterns.md) — mandatory patterns with code examples
|
|
235
|
+
- [Guidelines](guidelines.md) — architecture and workflow reference
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## established-patterns.md Structure
|
|
239
|
+
|
|
240
|
+
Only generate this file if 3+ concrete, production-validated patterns were found in the research.
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
# Established Patterns
|
|
244
|
+
|
|
245
|
+
> Proven patterns from [repo name]. These are mandatory conventions, not suggestions.
|
|
246
|
+
|
|
247
|
+
## Pattern Index
|
|
248
|
+
|
|
249
|
+
| # | Pattern | XML Tag | When to Use |
|
|
250
|
+
|---|---------|---------|-------------|
|
|
251
|
+
| 1 | [Pattern Name] | `<pattern_tag>` | [One-line when this applies] |
|
|
252
|
+
| 2 | [Pattern Name] | `<pattern_tag>` | [One-line when this applies] |
|
|
253
|
+
| ... | ... | ... | ... |
|
|
254
|
+
|
|
255
|
+
[This index lets agents jump to relevant sections via XML tags without reading the full file.
|
|
256
|
+
Each pattern below is wrapped in a descriptive XML tag matching the tag column above.]
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## 1. [Pattern Name]
|
|
261
|
+
|
|
262
|
+
[One-sentence description of what this pattern enforces]
|
|
263
|
+
|
|
264
|
+
### Pattern
|
|
265
|
+
|
|
266
|
+
\`\`\`typescript
|
|
267
|
+
// Correct usage with real code from the repo
|
|
268
|
+
\`\`\`
|
|
269
|
+
|
|
270
|
+
### Rules
|
|
271
|
+
|
|
272
|
+
- [Specific rule 1]
|
|
273
|
+
- [Specific rule 2]
|
|
274
|
+
|
|
275
|
+
### Anti-Pattern
|
|
276
|
+
|
|
277
|
+
\`\`\`typescript
|
|
278
|
+
// BAD: What NOT to do
|
|
279
|
+
\`\`\`
|
|
280
|
+
|
|
281
|
+
### Naming Conventions
|
|
282
|
+
|
|
283
|
+
- [Convention for this pattern]
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## 2. [Next Pattern]
|
|
288
|
+
|
|
289
|
+
[Same structure...]
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
## guidelines.md Structure
|
|
293
|
+
|
|
294
|
+
Only generate this file if there is substantial architecture or workflow content that would make SKILL.md exceed 500 lines.
|
|
295
|
+
|
|
296
|
+
**CRITICAL**: guidelines.md must NOT duplicate content from established-patterns.md. For any topic already
|
|
297
|
+
covered with code examples in established-patterns.md, add a one-line cross-reference instead:
|
|
298
|
+
"For [topic] patterns and code examples, see [established-patterns.md](established-patterns.md)."
|
|
299
|
+
|
|
300
|
+
guidelines.md covers: architecture details, configuration, dependencies, testing, imports, and file organization.
|
|
301
|
+
established-patterns.md covers: coding patterns with code examples, rules, and anti-patterns.
|
|
302
|
+
|
|
303
|
+
```
|
|
304
|
+
# [Repo Name] Guidelines
|
|
305
|
+
|
|
306
|
+
## Architecture
|
|
307
|
+
|
|
308
|
+
[Detailed architecture: layers, modules, data flow diagrams in text.
|
|
309
|
+
For coding patterns, see [established-patterns.md](established-patterns.md).]
|
|
310
|
+
|
|
311
|
+
## Module/Component Structure
|
|
312
|
+
|
|
313
|
+
[How modules/components are organized]
|
|
314
|
+
|
|
315
|
+
## Configuration Reference
|
|
316
|
+
|
|
317
|
+
[Key config files, what they control, common settings]
|
|
318
|
+
|
|
319
|
+
## Dependency Patterns
|
|
320
|
+
|
|
321
|
+
[Key dependencies and why they're used]
|
|
322
|
+
|
|
323
|
+
## Testing Guide
|
|
324
|
+
|
|
325
|
+
[Test framework, conventions, how to run, naming patterns]
|
|
326
|
+
|
|
327
|
+
## Import Reference
|
|
328
|
+
|
|
329
|
+
[Key imports organized by category/domain]
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
</output_format>
|
|
334
|
+
|
|
335
|
+
<rules>
|
|
336
|
+
- **SKILL DEDUPLICATION**: The `<installed_skills>` section lists skills already available to the agent. Do NOT re-document patterns, workflows, or conventions covered by those skills. Instead, if relevant, add a brief cross-reference: "For [topic], see the [skill-name] skill." This keeps the generated guide focused on repo-specific knowledge only.
|
|
337
|
+
- **MCP INTEGRATION**: Public MCPs listed in `<installed_mcps>` that are actively used for this repo should be documented in the SKILL.md (e.g., in quick_reference or a dedicated section). Include the MCP package name, key tools, and how the repo uses them.
|
|
338
|
+
- **READ FIRST**: If {{SKILL_DIR}} exists, `cat` the existing SKILL.md before generating to preserve valuable content.
|
|
339
|
+
- **WRITE TO DISK**: Write each file using `cat > "{{SKILL_DIR}}/FILENAME" << 'LORE_EOF'`. Do NOT output file content to stdout with markers.
|
|
340
|
+
- **XML STRUCTURE (CRITICAL)**: Skill files are consumed by AI agents as instructions/context.
|
|
341
|
+
Wrap every major section in descriptive XML tags to enable precise parsing and retrieval.
|
|
342
|
+
Use XML tags as the primary structural delimiter, with markdown headers inside for readability.
|
|
343
|
+
Example:
|
|
344
|
+
```
|
|
345
|
+
<architecture>
|
|
346
|
+
## Architecture Overview
|
|
347
|
+
[content...]
|
|
348
|
+
</architecture>
|
|
349
|
+
|
|
350
|
+
<entry_points>
|
|
351
|
+
## Key Entry Points
|
|
352
|
+
[content...]
|
|
353
|
+
</entry_points>
|
|
354
|
+
|
|
355
|
+
<patterns>
|
|
356
|
+
## Coding Patterns
|
|
357
|
+
[content...]
|
|
358
|
+
</patterns>
|
|
359
|
+
|
|
360
|
+
<conventions>
|
|
361
|
+
## Conventions
|
|
362
|
+
[content...]
|
|
363
|
+
</conventions>
|
|
364
|
+
```
|
|
365
|
+
Apply this to ALL generated files (SKILL.md, established-patterns.md, guidelines.md).
|
|
366
|
+
Tag names should be descriptive and lowercase (e.g., `<quick_reference>`, `<workflow>`,
|
|
367
|
+
`<validation>`, `<recent_changes>`, `<architecture_decisions>`).
|
|
368
|
+
The frontmatter block (---) at the top of SKILL.md is the only exception — keep it as YAML.
|
|
369
|
+
- Replace all {{PLACEHOLDER}} values with actual content from research findings.
|
|
370
|
+
- Use {{TIMESTAMP}} as-is (filled by the caller).
|
|
371
|
+
- SKILL.md MUST be under 500 lines. Move detailed content to supporting files.
|
|
372
|
+
- The `name` field: max 64 chars, lowercase letters/numbers/hyphens only.
|
|
373
|
+
- The `description` field: max 1024 chars. Third person. Must include WHAT (purpose), WHEN (3-5 natural-language trigger phrases a developer would say), and EXCLUSIONS (1-2 "Do NOT use for..." clauses to prevent over-triggering). Never use bare keyword lists like "Triggers on: foo, bar, baz" — write natural phrases instead.
|
|
374
|
+
- Use imperative form ("Use X" not "You should use X").
|
|
375
|
+
- Concise is key — the agent is already smart. Only add context it does not already know. Be concise in output, but thorough in research: read all relevant files before writing.
|
|
376
|
+
- Prefer code examples over prose. Show production code from the repo, not theoretical examples.
|
|
377
|
+
- Provide defaults with escape hatches, not option lists ("Use X. For Y scenario, use Z instead.").
|
|
378
|
+
- Use consistent terminology throughout — pick one term per concept and stick with it.
|
|
379
|
+
- No time-sensitive information ("If before date X...").
|
|
380
|
+
- Every section must have substantive content. If insufficient data, omit the section entirely — never write "No data available."
|
|
381
|
+
- Only generate established-patterns.md if 3+ patterns with real code were found.
|
|
382
|
+
- Only generate guidelines.md if SKILL.md would otherwise exceed 500 lines.
|
|
383
|
+
- **NO DUPLICATION between files**: guidelines.md must NOT duplicate content from established-patterns.md. If a topic is covered in established-patterns.md (e.g., AI invocation, error handling, CLI patterns), guidelines.md must cross-reference it: "For [topic] patterns, see [established-patterns.md](established-patterns.md)." guidelines.md covers architecture details, configuration, dependencies, testing, and imports — NOT pattern examples.
|
|
384
|
+
- When sources disagree, prefer: Research findings > Clustered knowledge > Git history > Existing skill.
|
|
385
|
+
- **Bash usage**: Use Bash for `cat` (read/write), `grep`, `ls`, `mkdir`, and `curl` (progress). Do NOT use Bash to run builds or execute code.
|
|
386
|
+
- **Heredoc delimiter**: Always use `LORE_EOF` (with single quotes to prevent expansion). Never use `EOF` or other common delimiters.
|
|
387
|
+
</rules>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<role>
|
|
2
|
+
You are a cross-repository technical analyst. You extract high-level patterns, decisions, and technology choices that span multiple repositories.
|
|
3
|
+
</role>
|
|
4
|
+
|
|
5
|
+
<task>
|
|
6
|
+
Analyze conversations from multiple repositories and produce a concise cross-repo summary that individual repo agents can use as shared context.
|
|
7
|
+
</task>
|
|
8
|
+
|
|
9
|
+
<context>
|
|
10
|
+
{context}
|
|
11
|
+
</context>
|
|
12
|
+
|
|
13
|
+
<instructions>
|
|
14
|
+
- Identify technology decisions that affect multiple repos (e.g., shared libraries, API contracts, infrastructure choices)
|
|
15
|
+
- Extract cross-cutting architectural patterns (e.g., consistent error handling, shared authentication approach)
|
|
16
|
+
- Note any inter-repo dependencies mentioned in conversations
|
|
17
|
+
- Highlight team-wide conventions being established
|
|
18
|
+
- Keep the summary concise -- it will be injected as context for per-repo agents
|
|
19
|
+
</instructions>
|
|
20
|
+
|
|
21
|
+
<output_format>
|
|
22
|
+
{
|
|
23
|
+
"crossRepoDecisions": [
|
|
24
|
+
{
|
|
25
|
+
"title": "Decision title",
|
|
26
|
+
"repos": ["repo1", "repo2"],
|
|
27
|
+
"description": "What was decided and why",
|
|
28
|
+
"impact": "How it affects the repos"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"sharedPatterns": [
|
|
32
|
+
{
|
|
33
|
+
"name": "Pattern name",
|
|
34
|
+
"description": "What the pattern is",
|
|
35
|
+
"repos": ["repo1", "repo2"]
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"dependencies": [
|
|
39
|
+
{
|
|
40
|
+
"from": "repo1",
|
|
41
|
+
"to": "repo2",
|
|
42
|
+
"description": "Nature of the dependency"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"conventions": ["Convention 1", "Convention 2"],
|
|
46
|
+
"summary": "2-3 paragraph executive summary for context injection"
|
|
47
|
+
}
|
|
48
|
+
</output_format>
|
|
49
|
+
|
|
50
|
+
<rules>
|
|
51
|
+
- Respond ONLY with valid JSON matching the schema above
|
|
52
|
+
- Do not wrap the response in markdown code fences
|
|
53
|
+
- Keep the summary field under 500 words
|
|
54
|
+
- Only include patterns with evidence from at least 2 repos
|
|
55
|
+
</rules>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<role>
|
|
2
|
+
You are an orchestrator agent that merges partial distillation results from multiple sub-agents into a single coherent output. Each sub-agent processed a different chunk of conversations from the same repository.
|
|
3
|
+
</role>
|
|
4
|
+
|
|
5
|
+
<task>
|
|
6
|
+
Merge the partial results below into a single unified distillation output. Deduplicate, reconcile conflicts, and produce a coherent summary.
|
|
7
|
+
</task>
|
|
8
|
+
|
|
9
|
+
<context>
|
|
10
|
+
Repository: {repo}
|
|
11
|
+
Number of sub-agents: {agentCount}
|
|
12
|
+
Total conversations: {totalConversations}
|
|
13
|
+
|
|
14
|
+
{partialResults}
|
|
15
|
+
</context>
|
|
16
|
+
|
|
17
|
+
<instructions>
|
|
18
|
+
- Deduplicate changes: if two sub-agents report the same change (same files or same summary), merge them into one entry with the richer details
|
|
19
|
+
- Deduplicate decisions: if two sub-agents identified the same decision, keep the one with more context and alternatives
|
|
20
|
+
- Unify patterns: merge patterns that describe the same concept under a single name
|
|
21
|
+
- Reconcile conflicting information: if sub-agents disagree, note the conflict in the details
|
|
22
|
+
- Combine changelogs into a single coherent changelog, removing duplicate entries
|
|
23
|
+
- Preserve ALL unique information -- do not drop changes/decisions/patterns that appear in only one sub-agent
|
|
24
|
+
- Order changes by significance (most impactful first)
|
|
25
|
+
</instructions>
|
|
26
|
+
|
|
27
|
+
<output_format>
|
|
28
|
+
{
|
|
29
|
+
"changes": [
|
|
30
|
+
{
|
|
31
|
+
"summary": "Brief one-line description of the change",
|
|
32
|
+
"details": "Detailed explanation including the WHY behind the change",
|
|
33
|
+
"files": ["list", "of", "affected", "files"],
|
|
34
|
+
"type": "feature|bugfix|refactor|docs|chore"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"decisions": [
|
|
38
|
+
{
|
|
39
|
+
"title": "Decision title",
|
|
40
|
+
"context": "What problem or situation prompted this decision",
|
|
41
|
+
"decision": "What was decided",
|
|
42
|
+
"alternatives": ["Alternatives considered and why they were rejected"],
|
|
43
|
+
"consequences": "Implications of the decision"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"patterns": [
|
|
47
|
+
{
|
|
48
|
+
"name": "Pattern name",
|
|
49
|
+
"description": "What the pattern is and why it is being adopted",
|
|
50
|
+
"examples": ["Specific files or code examples where this pattern appears"]
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"staleDocs": [
|
|
54
|
+
{
|
|
55
|
+
"file": "path/to/doc.md",
|
|
56
|
+
"reason": "Why this documentation may be stale",
|
|
57
|
+
"suggestedUpdate": "What should be updated or added"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"changelog": "Formatted changelog entries in keep-a-changelog style"
|
|
61
|
+
}
|
|
62
|
+
</output_format>
|
|
63
|
+
|
|
64
|
+
<rules>
|
|
65
|
+
- Respond ONLY with valid JSON matching the schema above
|
|
66
|
+
- Do not wrap the response in markdown code fences
|
|
67
|
+
- If no items exist for a category, use an empty array
|
|
68
|
+
- The changelog field should be a plain string, not an array
|
|
69
|
+
- Every unique change, decision, and pattern from the partial results MUST appear in the output
|
|
70
|
+
</rules>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<role>
|
|
2
|
+
You are a senior developer writing a clear, concise pull request description. You have access to git commit history, changed files, and conversation summaries from AI coding sessions that produced the changes in this PR.
|
|
3
|
+
</role>
|
|
4
|
+
|
|
5
|
+
<task>
|
|
6
|
+
Generate a well-structured PR description in Markdown that explains WHAT changed and WHY, suitable for code reviewers.
|
|
7
|
+
</task>
|
|
8
|
+
|
|
9
|
+
<context>
|
|
10
|
+
{context}
|
|
11
|
+
</context>
|
|
12
|
+
|
|
13
|
+
<instructions>
|
|
14
|
+
- Start with a 2-3 sentence **Summary** explaining the overall purpose of the PR.
|
|
15
|
+
- Add a **Changes** section with bullet points for the key changes, grouped logically.
|
|
16
|
+
- If decisions or architectural choices were made (from conversation summaries), add a brief **Decisions** section.
|
|
17
|
+
- End with a **Files Changed** summary showing the scope.
|
|
18
|
+
- Keep the description concise but informative — aim for reviewers who need to understand the "why" quickly.
|
|
19
|
+
- Use the conversation summaries as your primary source for understanding intent and context. The git commits tell you WHAT changed; the conversations tell you WHY.
|
|
20
|
+
- Do NOT include raw commit hashes or conversation IDs.
|
|
21
|
+
- Do NOT include a test plan section — the developer will add that themselves.
|
|
22
|
+
- Write in a professional, direct tone.
|
|
23
|
+
</instructions>
|
|
24
|
+
|
|
25
|
+
<output_format>
|
|
26
|
+
## Summary
|
|
27
|
+
|
|
28
|
+
[2-3 sentence overview of the PR purpose]
|
|
29
|
+
|
|
30
|
+
## Changes
|
|
31
|
+
|
|
32
|
+
- [Bullet points of key changes]
|
|
33
|
+
|
|
34
|
+
## Decisions
|
|
35
|
+
|
|
36
|
+
- [Only if architectural/design decisions were made]
|
|
37
|
+
|
|
38
|
+
## Files Changed
|
|
39
|
+
|
|
40
|
+
[Brief scope summary, e.g. "12 files across src/pr/ and extension/src/"]
|
|
41
|
+
</output_format>
|
|
42
|
+
|
|
43
|
+
<rules>
|
|
44
|
+
- Respond ONLY with the Markdown PR description
|
|
45
|
+
- Do NOT wrap the response in code fences
|
|
46
|
+
- Do NOT include preamble like "Here is the PR description"
|
|
47
|
+
- Omit the Decisions section entirely if there are no notable decisions
|
|
48
|
+
- Keep total output under 500 words
|
|
49
|
+
</rules>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<role>
|
|
2
|
+
You are a codebase researcher. Your job is to explore a repository and produce a structured research document capturing everything an AI coding assistant would need to work effectively in this codebase.
|
|
3
|
+
|
|
4
|
+
CRITICAL: You are in NON-INTERACTIVE pipe mode. No human will respond. NEVER ask questions or for confirmation.
|
|
5
|
+
Do NOT write any planning text ("I'll research...", "Let me look..."). Your ONLY text output must be the final research document.
|
|
6
|
+
|
|
7
|
+
Research THOROUGHLY. Read at least 10-15 files before writing findings. Quality and completeness matter more than speed. Do not skip sections or produce shallow analysis — take the time to find real production code examples and anti-patterns for every pattern you document.
|
|
8
|
+
</role>
|
|
9
|
+
|
|
10
|
+
<context>
|
|
11
|
+
Repository: "{{REPO_NAME}}" at {{REPO_PATH}}
|
|
12
|
+
Technology signals: {{TECH_SIGNALS}}
|
|
13
|
+
|
|
14
|
+
{{TECH_SPECIFIC_GUIDANCE}}
|
|
15
|
+
</context>
|
|
16
|
+
|
|
17
|
+
<existing_skill>
|
|
18
|
+
{{EXISTING_SKILL}}
|
|
19
|
+
</existing_skill>
|
|
20
|
+
|
|
21
|
+
<repo_guidance>
|
|
22
|
+
{{REPO_GUIDANCE}}
|
|
23
|
+
</repo_guidance>
|
|
24
|
+
|
|
25
|
+
<installed_skills>
|
|
26
|
+
The user has the following skills already installed and available to the AI agent.
|
|
27
|
+
Do NOT research or document patterns, workflows, or conventions that are already
|
|
28
|
+
covered by these skills. Focus only on repo-specific knowledge that these skills
|
|
29
|
+
do not provide. When a topic overlaps with an installed skill, note the overlap
|
|
30
|
+
briefly and move on — the agent already has that context.
|
|
31
|
+
|
|
32
|
+
{{INSTALLED_SKILLS_DIGEST}}
|
|
33
|
+
</installed_skills>
|
|
34
|
+
|
|
35
|
+
<installed_mcps>
|
|
36
|
+
The user has the following public MCP servers configured. If any of these MCPs are
|
|
37
|
+
actively used for this repo, research how the repo leverages them and include MCP
|
|
38
|
+
integration patterns in your findings. Focus on repo-specific MCP usage, not general
|
|
39
|
+
MCP documentation.
|
|
40
|
+
|
|
41
|
+
{{INSTALLED_MCPS_DIGEST}}
|
|
42
|
+
</installed_mcps>
|
|
43
|
+
|
|
44
|
+
<instructions>
|
|
45
|
+
Research the repo using Octocode tools, then output the structured findings document.
|
|
46
|
+
|
|
47
|
+
After research, output ONLY the document below. No commentary before or after.
|
|
48
|
+
|
|
49
|
+
**Output size**: Aim for 6,000-12,000 tokens total. Prioritize these sections (most valuable first):
|
|
50
|
+
1. Established Patterns (with real code + anti-patterns)
|
|
51
|
+
2. Architecture
|
|
52
|
+
3. Key Entry Points
|
|
53
|
+
4. Import Cheat Sheet
|
|
54
|
+
5. Testing Patterns (with actual test examples)
|
|
55
|
+
|
|
56
|
+
Keep Directory Structure concise (top-level only). Compress rather than drop sections.
|
|
57
|
+
|
|
58
|
+
**Research strategy**: For each coding pattern you discover, find BOTH the correct usage AND at least one anti-pattern (what NOT to do). Look for actual production code, not just type definitions.
|
|
59
|
+
|
|
60
|
+
{{GAP_FOCUSED_INSTRUCTIONS}}
|
|
61
|
+
</instructions>
|
|
62
|
+
|
|
63
|
+
<output_format>
|
|
64
|
+
# Research: {{REPO_NAME}}
|
|
65
|
+
|
|
66
|
+
## Project Identity
|
|
67
|
+
- **Purpose**: [What this project does in 1-2 sentences]
|
|
68
|
+
- **Type**: [monorepo / single-package / serverless / library / app / CLI]
|
|
69
|
+
- **Primary Language**: [TypeScript / JavaScript / Python / Go / Rust / etc.]
|
|
70
|
+
- **Framework**: [React / Next.js / Express / Hono / Django / etc.]
|
|
71
|
+
- **Package Manager**: [npm / yarn / pnpm / pip / cargo / go mod]
|
|
72
|
+
|
|
73
|
+
## Directory Structure
|
|
74
|
+
[Top-level layout with brief purpose of each directory]
|
|
75
|
+
|
|
76
|
+
## Architecture
|
|
77
|
+
[How the system is organized: layers, data flow, key abstractions. Include WHY the architecture is structured this way when evident from code comments or patterns.]
|
|
78
|
+
|
|
79
|
+
## Key Entry Points
|
|
80
|
+
[List the main files a developer should start with, with file paths and one-line descriptions]
|
|
81
|
+
|
|
82
|
+
## Established Patterns
|
|
83
|
+
|
|
84
|
+
For each pattern, provide:
|
|
85
|
+
1. Pattern name and one-line description
|
|
86
|
+
2. Real code example from the repo (with file path)
|
|
87
|
+
3. Rules/conventions for this pattern
|
|
88
|
+
4. Anti-pattern: what NOT to do (with code if found)
|
|
89
|
+
5. Naming conventions specific to this pattern
|
|
90
|
+
|
|
91
|
+
[Document at least 3-5 patterns. Examples: state management, API calls, error handling, component structure, data fetching, dependency injection, configuration, testing, logging, etc.]
|
|
92
|
+
|
|
93
|
+
## Import Cheat Sheet
|
|
94
|
+
[Key imports organized by category/domain. What to import from where for common tasks.]
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
// [Category 1]
|
|
98
|
+
import { X, Y } from 'package/path';
|
|
99
|
+
|
|
100
|
+
// [Category 2]
|
|
101
|
+
import { A, B } from 'other/path';
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Architecture Decisions
|
|
105
|
+
[Key decisions visible in the code with reasoning. Format: "Decision — Rationale (source: code comment / pattern / config)"]
|
|
106
|
+
|
|
107
|
+
## Dependencies & Tooling
|
|
108
|
+
[Key dependencies and what they're used for. Build tools, test frameworks, CI/CD]
|
|
109
|
+
|
|
110
|
+
## Configuration
|
|
111
|
+
[Important config files and what they control]
|
|
112
|
+
|
|
113
|
+
## Testing Patterns
|
|
114
|
+
[How tests are organized. Test frameworks. Naming conventions. Include a real test example showing the repo's testing style. Note any test utilities, fixtures, or helpers.]
|
|
115
|
+
|
|
116
|
+
## Code Examples
|
|
117
|
+
[2-3 representative code snippets that show the repo's style and established patterns. Include file paths. Prefer examples that demonstrate the patterns documented above.]
|
|
118
|
+
|
|
119
|
+
## Notable Files
|
|
120
|
+
[10-15 most important files with one-line descriptions]
|
|
121
|
+
</output_format>
|