Add agents.md and skills

This commit is contained in:
Jon Staab
2026-04-08 15:00:28 -07:00
parent 2d36400ba0
commit f0b26408f8
4 changed files with 324 additions and 0 deletions
+86
View File
@@ -0,0 +1,86 @@
---
name: research-chapter
description: Research how reference implementations handle a chapter's topic
---
# Research Chapter
You are researching nostr library implementations to prepare for writing a chapter of a
literate programming book. The chapter name is provided as an argument: `$ARGUMENTS`.
## Step 1: Gather Topic Context
Before doing any research, ask the user to provide a brief summary of what this chapter
should cover. What concepts, data structures, protocols, or functionality should the
research focus on? Wait for their response before proceeding.
## Step 2: Research Reference Implementations
Once you have the topic summary, spawn **one sub-agent per reference implementation** in
`./ref/` to analyze them in parallel. Each sub-agent should:
1. Search the reference implementation for code relevant to the chapter topic
2. Analyze in depth:
- What data structures and constructs are used?
- What programming style or patterns are employed?
- What are the dependencies (both internal and external)?
- Is the implementation coupled to other parts of the library, or self-contained?
- Are there any notable design decisions, trade-offs, or limitations?
3. Return a detailed summary focusing **only on functionality relevant to the chapter topic**
— ignore unrelated parts of the library
The six reference implementations to analyze:
- `ref/applesauce` (TypeScript — noStrudel ecosystem)
- `ref/ndk` (TypeScript — Nostr Development Kit)
- `ref/nostr-gadgets` (TypeScript — high-level utilities, JSR)
- `ref/nostr-tools` (TypeScript — low-level tools, minimal deps)
- `ref/rust-nostr` (Rust — full implementation, multiple crates)
- `ref/welshman` (TypeScript — extracted from Coracle client)
## Step 3: Write Research File
Compile all sub-agent results into a single research document and write it to:
`./book/research/$ARGUMENTS.md`
The research file should have this structure:
```markdown
# Research: <Chapter Name>
## Topic Summary
<The topic summary provided by the user in Step 1>
## Reference Implementation Analysis
### applesauce
<detailed findings>
### ndk
<detailed findings>
### nostr-gadgets
<detailed findings>
### nostr-tools
<detailed findings>
### rust-nostr
<detailed findings>
### welshman
<detailed findings>
## Common Patterns
<Cross-cutting observations: what approaches are shared, where do implementations
diverge, what seems to work well>
## Considerations for Our Implementation
<Notes on dependencies, API design choices, and anything relevant to writing a Rust
implementation in a literate programming style>
```
After writing the file, tell the user the research is complete and they can proceed with
`/plan-chapter $ARGUMENTS`.