@prmichaelsen/reddit-mcp 0.1.0
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/.claude/settings.local.json +23 -0
- package/.env.example +13 -0
- package/AGENT.md +1772 -0
- package/README.md +54 -0
- package/agent/commands/acp.clarification-capture.md +386 -0
- package/agent/commands/acp.clarification-create.md +432 -0
- package/agent/commands/acp.clarifications-research.md +326 -0
- package/agent/commands/acp.command-create.md +432 -0
- package/agent/commands/acp.design-create.md +286 -0
- package/agent/commands/acp.design-reference.md +355 -0
- package/agent/commands/acp.index.md +423 -0
- package/agent/commands/acp.init.md +546 -0
- package/agent/commands/acp.package-create.md +895 -0
- package/agent/commands/acp.package-info.md +212 -0
- package/agent/commands/acp.package-install.md +539 -0
- package/agent/commands/acp.package-list.md +280 -0
- package/agent/commands/acp.package-publish.md +541 -0
- package/agent/commands/acp.package-remove.md +293 -0
- package/agent/commands/acp.package-search.md +307 -0
- package/agent/commands/acp.package-update.md +361 -0
- package/agent/commands/acp.package-validate.md +540 -0
- package/agent/commands/acp.pattern-create.md +386 -0
- package/agent/commands/acp.plan.md +577 -0
- package/agent/commands/acp.proceed.md +882 -0
- package/agent/commands/acp.project-create.md +675 -0
- package/agent/commands/acp.project-info.md +312 -0
- package/agent/commands/acp.project-list.md +226 -0
- package/agent/commands/acp.project-remove.md +379 -0
- package/agent/commands/acp.project-set.md +227 -0
- package/agent/commands/acp.project-update.md +307 -0
- package/agent/commands/acp.projects-restore.md +228 -0
- package/agent/commands/acp.projects-sync.md +347 -0
- package/agent/commands/acp.report.md +407 -0
- package/agent/commands/acp.resume.md +239 -0
- package/agent/commands/acp.sessions.md +301 -0
- package/agent/commands/acp.status.md +293 -0
- package/agent/commands/acp.sync.md +364 -0
- package/agent/commands/acp.task-create.md +500 -0
- package/agent/commands/acp.update.md +302 -0
- package/agent/commands/acp.validate.md +466 -0
- package/agent/commands/acp.version-check-for-updates.md +276 -0
- package/agent/commands/acp.version-check.md +191 -0
- package/agent/commands/acp.version-update.md +289 -0
- package/agent/commands/command.template.md +339 -0
- package/agent/commands/git.commit.md +526 -0
- package/agent/commands/git.init.md +514 -0
- package/agent/design/.gitkeep +0 -0
- package/agent/design/design.template.md +154 -0
- package/agent/design/requirements.md +332 -0
- package/agent/design/requirements.template.md +387 -0
- package/agent/index/.gitkeep +0 -0
- package/agent/index/local.main.template.yaml +37 -0
- package/agent/manifest.template.yaml +13 -0
- package/agent/manifest.yaml +61 -0
- package/agent/milestones/.gitkeep +0 -0
- package/agent/milestones/milestone-1-foundation-listings-mvp.md +140 -0
- package/agent/milestones/milestone-1-{title}.template.md +206 -0
- package/agent/milestones/milestone-2-content-interaction.md +56 -0
- package/agent/milestones/milestone-3-users-and-messaging.md +54 -0
- package/agent/milestones/milestone-4-subreddits-and-flair.md +56 -0
- package/agent/milestones/milestone-5-moderation.md +53 -0
- package/agent/milestones/milestone-6-advanced-features-and-polish.md +56 -0
- package/agent/package.template.yaml +86 -0
- package/agent/patterns/.gitkeep +0 -0
- package/agent/patterns/bootstrap.template.md +1237 -0
- package/agent/patterns/pattern.template.md +382 -0
- package/agent/progress.template.yaml +161 -0
- package/agent/progress.yaml +223 -0
- package/agent/schemas/package.schema.yaml +276 -0
- package/agent/scripts/acp.common.sh +1781 -0
- package/agent/scripts/acp.yaml-parser.sh +985 -0
- package/agent/tasks/.gitkeep +0 -0
- package/agent/tasks/milestone-1-foundation-listings-mvp/task-1-project-scaffolding.md +75 -0
- package/agent/tasks/milestone-1-foundation-listings-mvp/task-2-reddit-oauth.md +71 -0
- package/agent/tasks/milestone-1-foundation-listings-mvp/task-3-reddit-api-client.md +71 -0
- package/agent/tasks/milestone-1-foundation-listings-mvp/task-4-listing-tools.md +65 -0
- package/agent/tasks/milestone-1-foundation-listings-mvp/task-5-search-tools.md +43 -0
- package/agent/tasks/milestone-1-foundation-listings-mvp/task-6-testing-verification.md +49 -0
- package/agent/tasks/milestone-2-content-interaction/task-7-post-tools.md +56 -0
- package/agent/tasks/milestone-2-content-interaction/task-8-comment-tools.md +49 -0
- package/agent/tasks/milestone-2-content-interaction/task-9-vote-save-report-tools.md +50 -0
- package/agent/tasks/milestone-3-users-and-messaging/task-10-account-tools.md +44 -0
- package/agent/tasks/milestone-3-users-and-messaging/task-11-user-profile-tools.md +50 -0
- package/agent/tasks/milestone-3-users-and-messaging/task-12-private-message-tools.md +50 -0
- package/agent/tasks/milestone-4-subreddits-and-flair/task-13-subreddit-tools.md +47 -0
- package/agent/tasks/milestone-4-subreddits-and-flair/task-14-flair-tools.md +46 -0
- package/agent/tasks/milestone-4-subreddits-and-flair/task-15-http-transport.md +53 -0
- package/agent/tasks/milestone-5-moderation/task-16-mod-action-tools.md +48 -0
- package/agent/tasks/milestone-5-moderation/task-17-mod-listing-tools.md +47 -0
- package/agent/tasks/milestone-5-moderation/task-18-mod-management-tools.md +42 -0
- package/agent/tasks/milestone-6-advanced-features-and-polish/task-19-multireddit-tools.md +49 -0
- package/agent/tasks/milestone-6-advanced-features-and-polish/task-20-wiki-tools.md +47 -0
- package/agent/tasks/milestone-6-advanced-features-and-polish/task-21-documentation-polish.md +65 -0
- package/agent/tasks/task-1-{title}.template.md +244 -0
- package/dist/auth/oauth.d.ts +15 -0
- package/dist/auth/oauth.d.ts.map +1 -0
- package/dist/client/reddit.d.ts +28 -0
- package/dist/client/reddit.d.ts.map +1 -0
- package/dist/factory.d.ts +2 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/factory.js +30394 -0
- package/dist/factory.js.map +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31955 -0
- package/dist/index.js.map +7 -0
- package/dist/server.d.ts +5 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +30401 -0
- package/dist/server.js.map +7 -0
- package/dist/tools/listings.d.ts +4 -0
- package/dist/tools/listings.d.ts.map +1 -0
- package/dist/tools/search.d.ts +4 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/transport/http.d.ts +7 -0
- package/dist/transport/http.d.ts.map +1 -0
- package/dist/types/index.d.ts +78 -0
- package/dist/types/index.d.ts.map +1 -0
- package/esbuild.build.js +21 -0
- package/jest.config.js +18 -0
- package/package.json +46 -0
- package/src/auth/oauth.ts +200 -0
- package/src/client/reddit.ts +245 -0
- package/src/factory.ts +5 -0
- package/src/index.ts +31 -0
- package/src/server.ts +36 -0
- package/src/tools/listings.ts +202 -0
- package/src/tools/search.ts +85 -0
- package/src/transport/http.ts +49 -0
- package/src/types/index.ts +83 -0
- package/tests/fixtures/reddit-responses.ts +132 -0
- package/tests/helpers/mock-client.ts +36 -0
- package/tests/unit/auth.test.ts +89 -0
- package/tests/unit/client.test.ts +218 -0
- package/tests/unit/listings.test.ts +113 -0
- package/tests/unit/search.test.ts +59 -0
- package/tests/unit/server.test.ts +14 -0
- package/tsconfig.json +21 -0
package/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# reddit-mcp
|
|
2
|
+
|
|
3
|
+
MCP server wrapping the Reddit API for AI agents.
|
|
4
|
+
|
|
5
|
+
> Built with [Agent Context Protocol](https://github.com/prmichaelsen/agent-context-protocol)
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
[Add installation and usage instructions here]
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- Feature 1
|
|
14
|
+
- Feature 2
|
|
15
|
+
- Feature 3
|
|
16
|
+
|
|
17
|
+
## Development
|
|
18
|
+
|
|
19
|
+
This project uses the Agent Context Protocol for development:
|
|
20
|
+
|
|
21
|
+
- `@acp.init` - Initialize agent context
|
|
22
|
+
- `@acp.plan` - Plan milestones and tasks
|
|
23
|
+
- `@acp.proceed` - Continue with next task
|
|
24
|
+
- `@acp.status` - Check project status
|
|
25
|
+
|
|
26
|
+
See [AGENT.md](./AGENT.md) for complete ACP documentation.
|
|
27
|
+
|
|
28
|
+
## Project Structure
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
reddit-mcp/
|
|
32
|
+
├── AGENT.md # ACP methodology
|
|
33
|
+
├── agent/ # ACP directory
|
|
34
|
+
│ ├── design/ # Design documents
|
|
35
|
+
│ ├── milestones/ # Project milestones
|
|
36
|
+
│ ├── tasks/ # Task breakdown
|
|
37
|
+
│ ├── patterns/ # Architectural patterns
|
|
38
|
+
│ └── progress.yaml # Progress tracking
|
|
39
|
+
└── (your project files)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Getting Started
|
|
43
|
+
|
|
44
|
+
1. Initialize context: `@acp.init`
|
|
45
|
+
2. Plan your project: `@acp.plan`
|
|
46
|
+
3. Start building: `@acp.proceed`
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
MIT
|
|
51
|
+
|
|
52
|
+
## Author
|
|
53
|
+
|
|
54
|
+
Patrick Michaelsen
|
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
# Directive: clarification-capture
|
|
2
|
+
|
|
3
|
+
> **🤖 Agent Directive**: This is a **SHARED DIRECTIVE**, not a user-invocable command.
|
|
4
|
+
> It is referenced by create commands (`design-create`, `task-create`, `pattern-create`, `command-create`) to capture clarification decisions into entity documents.
|
|
5
|
+
>
|
|
6
|
+
> **Do NOT invoke this directive directly.** It is called internally by create commands when context capture is needed.
|
|
7
|
+
>
|
|
8
|
+
> If you are a create command reading this file, follow the steps below to capture clarification context and generate a "Key Design Decisions" section for the entity being created.
|
|
9
|
+
|
|
10
|
+
**Namespace**: acp
|
|
11
|
+
**Version**: 1.0.0
|
|
12
|
+
**Created**: 2026-03-04
|
|
13
|
+
**Last Updated**: 2026-03-04
|
|
14
|
+
**Status**: Active
|
|
15
|
+
**Scripts**: None
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
**Purpose**: Capture decisions from ephemeral clarification files and chat context into permanent entity documents
|
|
20
|
+
**Category**: Workflow (Internal Directive)
|
|
21
|
+
**Frequency**: Called by create commands when context is available
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Arguments
|
|
26
|
+
|
|
27
|
+
These arguments are passed through from the calling create command. The create command parses them and passes the relevant context to this directive.
|
|
28
|
+
|
|
29
|
+
**CLI-Style Arguments**:
|
|
30
|
+
|
|
31
|
+
| Argument | Alias | Behavior |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| `--from-clarification <file>` | `--from-clar` | Capture from a specific clarification file |
|
|
34
|
+
| `--from-clarifications` | `--from-clars` | Capture from all recent clarifications |
|
|
35
|
+
| `--from-chat-context` | `--from-chat` | Capture decisions from chat conversation |
|
|
36
|
+
| `--from-context` | (none) | Shorthand for all sources (clarifications + chat) |
|
|
37
|
+
| `--include-clarifications` | (none) | Alias for `--from-clars`, enforces Key Design Decisions section |
|
|
38
|
+
|
|
39
|
+
**Natural Language**:
|
|
40
|
+
- `@acp.design-create --from-clar` → Capture from clarifications in session
|
|
41
|
+
- `@acp.design-create --from-chat` → Capture from chat conversation
|
|
42
|
+
- `@acp.design-create --from-context` → Capture from all sources
|
|
43
|
+
- `@acp.design-create` (no flags) → **Auto-detect**: equivalent to implicit `--from-context`
|
|
44
|
+
|
|
45
|
+
**Default Behavior**: When no `--from-*` flags are specified, the directive auto-detects clarifications and context in the current session. This is the common case.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## What This Directive Does
|
|
50
|
+
|
|
51
|
+
This directive captures design decisions from ephemeral sources (clarifications, chat conversation) and embeds them as a "Key Design Decisions" section in the entity document being created. This prevents loss of design rationale — clarifications are workflow-only files that are never committed to version control.
|
|
52
|
+
|
|
53
|
+
The directive is called internally by create commands after context detection and key file reading, but before entity file generation. It produces a markdown section that the create command inserts into the generated entity document.
|
|
54
|
+
|
|
55
|
+
**Key behaviors**:
|
|
56
|
+
- Auto-detects clarifications in the session by default (no flags needed)
|
|
57
|
+
- Warns the user if uncaptured clarification decisions are detected
|
|
58
|
+
- Resolves conflicts between multiple clarifications by flagging for user
|
|
59
|
+
- Synthesizes decisions into category-grouped summary tables
|
|
60
|
+
- Updates captured clarification status to "Captured"
|
|
61
|
+
- Never includes clarification file references in output (clarifications are ephemeral and volatile)
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Prerequisites
|
|
66
|
+
|
|
67
|
+
- [ ] Called from within a create command (design-create, task-create, pattern-create, or command-create)
|
|
68
|
+
- [ ] `agent/clarifications/` directory exists (if capturing from clarifications)
|
|
69
|
+
- [ ] At least one clarification or chat context available
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Steps
|
|
74
|
+
|
|
75
|
+
### 1. Detect Context Sources
|
|
76
|
+
|
|
77
|
+
Determine which sources to capture from based on arguments or auto-detection.
|
|
78
|
+
|
|
79
|
+
**Actions**:
|
|
80
|
+
- If `--from-clar <file>` specified: Use that specific clarification file
|
|
81
|
+
- If `--from-clars` specified: Use all recent clarifications
|
|
82
|
+
- If `--from-chat` specified: Synthesize decisions from chat conversation
|
|
83
|
+
- If `--from-context` specified: Use all sources (clarifications + chat)
|
|
84
|
+
- If **no flags** specified (default): Auto-detect — scan for clarifications in session and chat context. Equivalent to implicit `--from-context`.
|
|
85
|
+
|
|
86
|
+
**Expected Outcome**: List of context sources identified
|
|
87
|
+
|
|
88
|
+
### 2. Read Clarification Files
|
|
89
|
+
|
|
90
|
+
If clarifications are a source, read and parse them.
|
|
91
|
+
|
|
92
|
+
**Actions**:
|
|
93
|
+
- List files in `agent/clarifications/` (exclude `*.template.md`)
|
|
94
|
+
- Filter by status: read files with status "Completed", "Awaiting Responses", or "Captured"
|
|
95
|
+
- If `--from-clar <file>`: Read only the specified file
|
|
96
|
+
- If `--from-clars` or auto-detect: Read all qualifying files
|
|
97
|
+
- Parse each clarification's Items, Questions, and responses (lines starting with `>`)
|
|
98
|
+
- Order by recency (file modification time or clarification number)
|
|
99
|
+
|
|
100
|
+
**Priority rule**: More recent clarification responses supersede older ones. Within a single clarification, all items are equal weight.
|
|
101
|
+
|
|
102
|
+
**Expected Outcome**: Clarification responses parsed and ordered
|
|
103
|
+
|
|
104
|
+
### 3. Warn About Partial Clarifications
|
|
105
|
+
|
|
106
|
+
If any clarification has unanswered questions, warn the user.
|
|
107
|
+
|
|
108
|
+
**Actions**:
|
|
109
|
+
- Scan each clarification for questions with empty `>` response lines
|
|
110
|
+
- If unanswered questions found, display warning:
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
⚠️ Partial clarification detected: clarification-{N}-{title}.md
|
|
114
|
+
{X} of {Y} questions unanswered.
|
|
115
|
+
|
|
116
|
+
Proceed with answered portions only? (yes/no)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
- If user says yes: Continue with answered portions
|
|
120
|
+
- If user says no: Halt capture and let user complete the clarification first
|
|
121
|
+
|
|
122
|
+
**Expected Outcome**: User informed of partial clarifications, decision made
|
|
123
|
+
|
|
124
|
+
### 4. Resolve Conflicts
|
|
125
|
+
|
|
126
|
+
If multiple clarifications contain conflicting decisions, flag for user resolution.
|
|
127
|
+
|
|
128
|
+
**Actions**:
|
|
129
|
+
- Compare responses across clarifications for overlapping topics
|
|
130
|
+
- If conflicting decisions detected:
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
⚠️ Conflicting decisions detected:
|
|
134
|
+
|
|
135
|
+
Topic: {topic}
|
|
136
|
+
|
|
137
|
+
Clarification {A}: "{response A}"
|
|
138
|
+
Clarification {B}: "{response B}"
|
|
139
|
+
|
|
140
|
+
The more recent answer is "{response B}" (clarification {B}).
|
|
141
|
+
Use this? (yes/no/custom)
|
|
142
|
+
yes → Use clarification {B}
|
|
143
|
+
no → Use clarification {A}
|
|
144
|
+
custom → Provide a different answer
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
- Wait for user resolution
|
|
148
|
+
- Never silently merge conflicting decisions
|
|
149
|
+
- Never capture both sides of a conflict
|
|
150
|
+
|
|
151
|
+
**Expected Outcome**: All conflicts resolved
|
|
152
|
+
|
|
153
|
+
### 5. Synthesize Chat Context
|
|
154
|
+
|
|
155
|
+
If chat context is a source (`--from-chat` or auto-detect), extract decisions from the conversation.
|
|
156
|
+
|
|
157
|
+
**Actions**:
|
|
158
|
+
- Review chat history for design decisions, preferences, and requirements expressed by the user
|
|
159
|
+
- Extract decision/choice/rationale triples from conversational context
|
|
160
|
+
- Merge with clarification decisions (chat context has equal weight to clarifications)
|
|
161
|
+
|
|
162
|
+
**Expected Outcome**: Chat decisions extracted and merged
|
|
163
|
+
|
|
164
|
+
### 6. Generate Key Design Decisions Section
|
|
165
|
+
|
|
166
|
+
Create the markdown section for embedding in the entity document.
|
|
167
|
+
|
|
168
|
+
**Actions**:
|
|
169
|
+
- Group all captured decisions by agent-inferred category (e.g., "Architecture", "Scope", "Format", "Lifecycle")
|
|
170
|
+
- Categories are inferred from content — there is no predefined list
|
|
171
|
+
- Format as category-grouped tables:
|
|
172
|
+
|
|
173
|
+
```markdown
|
|
174
|
+
## Key Design Decisions (Optional)
|
|
175
|
+
|
|
176
|
+
### {Category 1}
|
|
177
|
+
|
|
178
|
+
| Decision | Choice | Rationale |
|
|
179
|
+
|---|---|---|
|
|
180
|
+
| {decision} | {choice} | {rationale} |
|
|
181
|
+
| {decision} | {choice} | {rationale} |
|
|
182
|
+
|
|
183
|
+
### {Category 2}
|
|
184
|
+
|
|
185
|
+
| Decision | Choice | Rationale |
|
|
186
|
+
|---|---|---|
|
|
187
|
+
| {decision} | {choice} | {rationale} |
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
- **Do NOT include clarification file references** — clarifications are ephemeral and volatile. File numbers will not match across different developer checkouts.
|
|
191
|
+
- If no decisions to capture, omit the section entirely
|
|
192
|
+
|
|
193
|
+
**Expected Outcome**: Key Design Decisions markdown section generated
|
|
194
|
+
|
|
195
|
+
### 7. Update Clarification Status
|
|
196
|
+
|
|
197
|
+
After successful capture, update the status of captured clarification files.
|
|
198
|
+
|
|
199
|
+
**Actions**:
|
|
200
|
+
- For each clarification file that was captured from:
|
|
201
|
+
- Update `**Status**:` line from current value to `Captured`
|
|
202
|
+
- Do NOT delete clarification files
|
|
203
|
+
- Do NOT prompt to delete clarification files
|
|
204
|
+
|
|
205
|
+
**Expected Outcome**: Clarification statuses updated to "Captured"
|
|
206
|
+
|
|
207
|
+
### 8. Return Section to Calling Command
|
|
208
|
+
|
|
209
|
+
Pass the generated Key Design Decisions section back to the create command for insertion into the entity document.
|
|
210
|
+
|
|
211
|
+
**Expected Outcome**: Create command receives the section and inserts it into the generated entity file
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Warning UX: Uncaptured Decisions
|
|
216
|
+
|
|
217
|
+
When a create command detects clarifications in the session but the user hasn't explicitly included capture flags, the auto-detect behavior triggers this flow:
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
⚠️ Clarification decisions detected in this session that have not been captured.
|
|
221
|
+
Clarifications are not committed to version control.
|
|
222
|
+
Decisions not captured in this document will be lost.
|
|
223
|
+
|
|
224
|
+
Detected:
|
|
225
|
+
• clarification-{N}-{title}.md ({status}, {X} questions answered)
|
|
226
|
+
|
|
227
|
+
Include these decisions in the document? (yes/no)
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
- If yes: Proceed with capture (equivalent to `--from-clars`)
|
|
231
|
+
- If no: Skip capture, create entity without Key Design Decisions section
|
|
232
|
+
|
|
233
|
+
This warning is **mandatory** when uncaptured clarifications exist. It ensures the user is aware that decisions may be lost.
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Verification
|
|
238
|
+
|
|
239
|
+
- [ ] Context sources correctly detected (flags or auto-detect)
|
|
240
|
+
- [ ] Clarification files read and parsed
|
|
241
|
+
- [ ] Partial clarifications warned about
|
|
242
|
+
- [ ] Conflicts flagged and resolved (never silently merged)
|
|
243
|
+
- [ ] Chat context synthesized (if applicable)
|
|
244
|
+
- [ ] Key Design Decisions section generated with category-grouped tables
|
|
245
|
+
- [ ] No clarification file references in output
|
|
246
|
+
- [ ] Clarification statuses updated to "Captured"
|
|
247
|
+
- [ ] Section returned to calling create command
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Expected Output
|
|
252
|
+
|
|
253
|
+
### Generated Section (inserted into entity document)
|
|
254
|
+
```markdown
|
|
255
|
+
## Key Design Decisions (Optional)
|
|
256
|
+
|
|
257
|
+
### Architecture
|
|
258
|
+
|
|
259
|
+
| Decision | Choice | Rationale |
|
|
260
|
+
|---|---|---|
|
|
261
|
+
| Implementation approach | Shared directive | Avoids duplicating capture logic across create commands |
|
|
262
|
+
|
|
263
|
+
### Scope
|
|
264
|
+
|
|
265
|
+
| Decision | Choice | Rationale |
|
|
266
|
+
|---|---|---|
|
|
267
|
+
| Affected commands | design, task, pattern, command create | Core entity creation commands only |
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### Console Output (during capture)
|
|
271
|
+
```
|
|
272
|
+
📋 Capturing Clarification Context...
|
|
273
|
+
✓ Read clarification-6-create-command-context-capture.md (20 questions, 20 answered)
|
|
274
|
+
✓ Synthesized chat context (3 additional decisions)
|
|
275
|
+
✓ No conflicts detected
|
|
276
|
+
✓ Generated Key Design Decisions (4 categories, 13 decisions)
|
|
277
|
+
✓ Updated clarification-6 status → Captured
|
|
278
|
+
|
|
279
|
+
Key Design Decisions section ready for embedding.
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Examples
|
|
285
|
+
|
|
286
|
+
### Example 1: Auto-detect with clarifications in session
|
|
287
|
+
|
|
288
|
+
**Context**: User created and answered a clarification, then invokes `@acp.design-create`
|
|
289
|
+
|
|
290
|
+
**Flow**: Directive auto-detects the clarification, warns user, user confirms, decisions captured into design document
|
|
291
|
+
|
|
292
|
+
### Example 2: Explicit capture from specific file
|
|
293
|
+
|
|
294
|
+
**Context**: User invokes `@acp.task-create --from-clar clarification-6-create-command-context-capture.md`
|
|
295
|
+
|
|
296
|
+
**Flow**: Directive reads only that clarification, synthesizes decisions, generates section
|
|
297
|
+
|
|
298
|
+
### Example 3: Chat-only capture
|
|
299
|
+
|
|
300
|
+
**Context**: User had extensive discussion about design choices, invokes `@acp.pattern-create --from-chat`
|
|
301
|
+
|
|
302
|
+
**Flow**: Directive synthesizes decisions from chat history, generates section (no clarification files involved)
|
|
303
|
+
|
|
304
|
+
### Example 4: No context available
|
|
305
|
+
|
|
306
|
+
**Context**: User invokes `@acp.design-create` with no prior clarifications or design discussion
|
|
307
|
+
|
|
308
|
+
**Flow**: Directive finds no context sources, skips capture silently, entity created without Key Design Decisions section
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Related Commands
|
|
313
|
+
|
|
314
|
+
- [`@acp.clarification-create`](acp.clarification-create.md) - Creates clarification files that this directive captures from
|
|
315
|
+
- [`@acp.design-create`](acp.design-create.md) - Calls this directive during design creation
|
|
316
|
+
- [`@acp.task-create`](acp.task-create.md) - Calls this directive during task creation
|
|
317
|
+
- [`@acp.pattern-create`](acp.pattern-create.md) - Calls this directive during pattern creation
|
|
318
|
+
- [`@acp.command-create`](acp.command-create.md) - Calls this directive during command creation
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## Troubleshooting
|
|
323
|
+
|
|
324
|
+
### Issue 1: No clarifications found
|
|
325
|
+
|
|
326
|
+
**Symptom**: Directive reports no context sources
|
|
327
|
+
|
|
328
|
+
**Cause**: No clarification files exist or all have status "Captured"
|
|
329
|
+
|
|
330
|
+
**Solution**: This is normal. Entity will be created without Key Design Decisions section. If you expected clarifications, check `agent/clarifications/` directory.
|
|
331
|
+
|
|
332
|
+
### Issue 2: Clarification has no answered questions
|
|
333
|
+
|
|
334
|
+
**Symptom**: Warning about fully unanswered clarification
|
|
335
|
+
|
|
336
|
+
**Cause**: Clarification was created but not yet answered
|
|
337
|
+
|
|
338
|
+
**Solution**: Answer the clarification first, then re-run the create command.
|
|
339
|
+
|
|
340
|
+
### Issue 3: Too many conflicts
|
|
341
|
+
|
|
342
|
+
**Symptom**: Multiple conflict resolution prompts
|
|
343
|
+
|
|
344
|
+
**Cause**: Multiple clarifications with overlapping but contradictory answers
|
|
345
|
+
|
|
346
|
+
**Solution**: Consider consolidating clarifications before capture, or resolve each conflict as prompted.
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## Security Considerations
|
|
351
|
+
|
|
352
|
+
### File Access
|
|
353
|
+
- **Reads**: `agent/clarifications/*.md` (non-template), chat conversation context
|
|
354
|
+
- **Writes**: `agent/clarifications/*.md` (status update to "Captured" only)
|
|
355
|
+
- **Executes**: None
|
|
356
|
+
|
|
357
|
+
### Network Access
|
|
358
|
+
- **APIs**: None
|
|
359
|
+
- **Repositories**: None
|
|
360
|
+
|
|
361
|
+
### Sensitive Data
|
|
362
|
+
- **Secrets**: Never include secrets in Key Design Decisions
|
|
363
|
+
- **Credentials**: Never include credentials in captured output
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
## Notes
|
|
368
|
+
|
|
369
|
+
- This is a shared directive, not a user-invocable command
|
|
370
|
+
- Default behavior is auto-detect (no flags needed for common case)
|
|
371
|
+
- Clarifications are ephemeral — never reference their file numbers in output
|
|
372
|
+
- Categories in the output tables are agent-inferred, not predefined
|
|
373
|
+
- The directive never deletes clarification files and never prompts to delete them
|
|
374
|
+
- Conflict resolution always involves the user — never silently merge
|
|
375
|
+
- The Key Design Decisions section is optional — omit if no decisions to capture
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
**Namespace**: acp
|
|
380
|
+
**Command**: clarification-capture
|
|
381
|
+
**Version**: 1.0.0
|
|
382
|
+
**Created**: 2026-03-04
|
|
383
|
+
**Last Updated**: 2026-03-04
|
|
384
|
+
**Status**: Active
|
|
385
|
+
**Compatibility**: ACP 5.12.0+
|
|
386
|
+
**Author**: ACP Project
|