@prmichaelsen/acp-visualizer 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/README.md +68 -0
- package/agent/commands/acp.clarification-address.md +417 -0
- package/agent/commands/acp.clarification-capture.md +386 -0
- package/agent/commands/acp.clarification-create.md +437 -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.handoff.md +270 -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 +587 -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/commands/tanstack-cloudflare.deploy.md +272 -0
- package/agent/commands/tanstack-cloudflare.tail.md +275 -0
- package/agent/design/.gitkeep +0 -0
- package/agent/design/design.template.md +154 -0
- package/agent/design/local.dashboard-layout-routing.md +288 -0
- package/agent/design/local.data-model-yaml-parsing.md +310 -0
- package/agent/design/local.search-filtering.md +331 -0
- package/agent/design/local.server-api-auto-refresh.md +235 -0
- package/agent/design/local.table-tree-views.md +299 -0
- package/agent/design/local.visualizer-requirements.md +349 -0
- package/agent/design/requirements.template.md +387 -0
- package/agent/index/.gitkeep +0 -0
- package/agent/index/acp.core.yaml +137 -0
- package/agent/index/local.main.template.yaml +37 -0
- package/agent/manifest.template.yaml +13 -0
- package/agent/manifest.yaml +302 -0
- package/agent/milestones/.gitkeep +0 -0
- package/agent/milestones/milestone-1-project-scaffold-data-pipeline.md +67 -0
- package/agent/milestones/milestone-1-{title}.template.md +206 -0
- package/agent/milestones/milestone-2-dashboard-views-interaction.md +79 -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/patterns/tanstack-cloudflare.acl-permissions.md +332 -0
- package/agent/patterns/tanstack-cloudflare.action-bar-item.md +416 -0
- package/agent/patterns/tanstack-cloudflare.api-route-handlers.md +401 -0
- package/agent/patterns/tanstack-cloudflare.auth-session-management.md +387 -0
- package/agent/patterns/tanstack-cloudflare.card-and-list.md +271 -0
- package/agent/patterns/tanstack-cloudflare.chat-engine.md +353 -0
- package/agent/patterns/tanstack-cloudflare.confirmation-tokens.md +346 -0
- package/agent/patterns/tanstack-cloudflare.durable-objects-websocket.md +516 -0
- package/agent/patterns/tanstack-cloudflare.email-service.md +431 -0
- package/agent/patterns/tanstack-cloudflare.expander.md +98 -0
- package/agent/patterns/tanstack-cloudflare.fcm-push.md +115 -0
- package/agent/patterns/tanstack-cloudflare.firebase-anonymous-sessions.md +441 -0
- package/agent/patterns/tanstack-cloudflare.firebase-auth.md +348 -0
- package/agent/patterns/tanstack-cloudflare.firebase-firestore.md +550 -0
- package/agent/patterns/tanstack-cloudflare.firebase-storage.md +369 -0
- package/agent/patterns/tanstack-cloudflare.form-controls.md +145 -0
- package/agent/patterns/tanstack-cloudflare.global-search-context.md +93 -0
- package/agent/patterns/tanstack-cloudflare.image-carousel.md +126 -0
- package/agent/patterns/tanstack-cloudflare.library-services.md +553 -0
- package/agent/patterns/tanstack-cloudflare.lightbox.md +169 -0
- package/agent/patterns/tanstack-cloudflare.markdown-content.md +115 -0
- package/agent/patterns/tanstack-cloudflare.mention-suggestions.md +98 -0
- package/agent/patterns/tanstack-cloudflare.modal.md +156 -0
- package/agent/patterns/tanstack-cloudflare.nextjs-to-tanstack-routing.md +461 -0
- package/agent/patterns/tanstack-cloudflare.notifications-engine.md +151 -0
- package/agent/patterns/tanstack-cloudflare.oauth-token-refresh.md +90 -0
- package/agent/patterns/tanstack-cloudflare.og-metadata.md +296 -0
- package/agent/patterns/tanstack-cloudflare.pagination.md +442 -0
- package/agent/patterns/tanstack-cloudflare.pill-input.md +220 -0
- package/agent/patterns/tanstack-cloudflare.provider-adapter.md +401 -0
- package/agent/patterns/tanstack-cloudflare.rate-limiting.md +323 -0
- package/agent/patterns/tanstack-cloudflare.scheduled-tasks.md +338 -0
- package/agent/patterns/tanstack-cloudflare.searchable-settings.md +375 -0
- package/agent/patterns/tanstack-cloudflare.slide-over.md +129 -0
- package/agent/patterns/tanstack-cloudflare.ssr-preload.md +571 -0
- package/agent/patterns/tanstack-cloudflare.third-party-api-integration.md +508 -0
- package/agent/patterns/tanstack-cloudflare.toast-system.md +142 -0
- package/agent/patterns/tanstack-cloudflare.unified-header.md +280 -0
- package/agent/patterns/tanstack-cloudflare.user-scoped-collections.md +628 -0
- package/agent/patterns/tanstack-cloudflare.websocket-manager.md +237 -0
- package/agent/patterns/tanstack-cloudflare.wrangler-configuration.md +358 -0
- package/agent/patterns/tanstack-cloudflare.zod-schema-validation.md +336 -0
- package/agent/progress.template.yaml +161 -0
- package/agent/progress.yaml +145 -0
- package/agent/schemas/package.schema.yaml +276 -0
- package/agent/scripts/acp.common.sh +1781 -0
- package/agent/scripts/acp.install.sh +333 -0
- package/agent/scripts/acp.package-create.sh +924 -0
- package/agent/scripts/acp.package-info.sh +288 -0
- package/agent/scripts/acp.package-install.sh +893 -0
- package/agent/scripts/acp.package-list.sh +311 -0
- package/agent/scripts/acp.package-publish.sh +420 -0
- package/agent/scripts/acp.package-remove.sh +348 -0
- package/agent/scripts/acp.package-search.sh +156 -0
- package/agent/scripts/acp.package-update.sh +517 -0
- package/agent/scripts/acp.package-validate.sh +1018 -0
- package/agent/scripts/acp.uninstall.sh +85 -0
- package/agent/scripts/acp.version-check-for-updates.sh +98 -0
- package/agent/scripts/acp.version-check.sh +47 -0
- package/agent/scripts/acp.version-update.sh +176 -0
- package/agent/scripts/acp.yaml-parser.sh +985 -0
- package/agent/scripts/acp.yaml-validate.sh +205 -0
- package/agent/tasks/.gitkeep +0 -0
- package/agent/tasks/milestone-1-project-scaffold-data-pipeline/task-1-initialize-tanstack-start-project.md +210 -0
- package/agent/tasks/milestone-1-project-scaffold-data-pipeline/task-2-implement-data-model-yaml-parser.md +294 -0
- package/agent/tasks/milestone-1-project-scaffold-data-pipeline/task-3-build-server-api-data-loading.md +193 -0
- package/agent/tasks/milestone-1-project-scaffold-data-pipeline/task-4-add-auto-refresh-sse.md +262 -0
- package/agent/tasks/milestone-2-dashboard-views-interaction/task-10-polish-integration-testing.md +156 -0
- package/agent/tasks/milestone-2-dashboard-views-interaction/task-5-build-dashboard-layout-routing.md +178 -0
- package/agent/tasks/milestone-2-dashboard-views-interaction/task-6-build-overview-page.md +141 -0
- package/agent/tasks/milestone-2-dashboard-views-interaction/task-7-implement-milestone-table-view.md +153 -0
- package/agent/tasks/milestone-2-dashboard-views-interaction/task-8-implement-milestone-tree-view.md +174 -0
- package/agent/tasks/milestone-2-dashboard-views-interaction/task-9-implement-search-filtering.md +233 -0
- package/agent/tasks/task-1-{title}.template.md +244 -0
- package/bin/visualize.mjs +84 -0
- package/package.json +48 -0
- package/src/components/ExtraFieldsBadge.tsx +15 -0
- package/src/components/FilterBar.tsx +33 -0
- package/src/components/Header.tsx +23 -0
- package/src/components/MilestoneTable.tsx +167 -0
- package/src/components/MilestoneTree.tsx +84 -0
- package/src/components/ProgressBar.tsx +20 -0
- package/src/components/SearchInput.tsx +22 -0
- package/src/components/Sidebar.tsx +54 -0
- package/src/components/StatusBadge.tsx +23 -0
- package/src/components/StatusDot.tsx +12 -0
- package/src/components/TaskList.tsx +36 -0
- package/src/components/ViewToggle.tsx +31 -0
- package/src/lib/config.ts +8 -0
- package/src/lib/file-watcher.ts +43 -0
- package/src/lib/search.ts +48 -0
- package/src/lib/types.ts +73 -0
- package/src/lib/useAutoRefresh.ts +31 -0
- package/src/lib/useCollapse.ts +31 -0
- package/src/lib/useFilteredData.ts +55 -0
- package/src/lib/yaml-loader-real.spec.ts +47 -0
- package/src/lib/yaml-loader.spec.ts +201 -0
- package/src/lib/yaml-loader.ts +265 -0
- package/src/routeTree.gen.ts +140 -0
- package/src/router.tsx +10 -0
- package/src/routes/__root.tsx +75 -0
- package/src/routes/api/watch.ts +29 -0
- package/src/routes/index.tsx +115 -0
- package/src/routes/milestones.tsx +50 -0
- package/src/routes/search.tsx +84 -0
- package/src/routes/tasks.tsx +63 -0
- package/src/services/progress-database.service.ts +46 -0
- package/src/styles.css +25 -0
- package/tsconfig.json +24 -0
- package/vite.config.ts +16 -0
- package/vitest.config.ts +27 -0
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
# Command: pattern-create
|
|
2
|
+
|
|
3
|
+
> **🤖 Agent Directive**: If you are reading this file, the command `@acp.pattern-create` has been invoked.
|
|
4
|
+
>
|
|
5
|
+
> **This is a CREATION command - you will create files directly, no shell scripts needed.**
|
|
6
|
+
>
|
|
7
|
+
> Follow the steps below to create a pattern file with proper namespace and automatic package updates.
|
|
8
|
+
|
|
9
|
+
**Namespace**: acp
|
|
10
|
+
**Version**: 1.0.0
|
|
11
|
+
**Created**: 2026-02-20
|
|
12
|
+
**Last Updated**: 2026-02-20
|
|
13
|
+
**Status**: Active
|
|
14
|
+
**Scripts**: None
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
**Purpose**: Create pattern files with namespace enforcement, draft support, and automatic package updates
|
|
19
|
+
**Category**: Creation
|
|
20
|
+
**Frequency**: As Needed
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## What This Command Does
|
|
25
|
+
|
|
26
|
+
This command creates a new pattern file with intelligent namespace handling, optional draft file support, and automatic updates to package.yaml and README.md. It provides a guided workflow for creating well-structured patterns that follow ACP conventions.
|
|
27
|
+
|
|
28
|
+
**Key Features**:
|
|
29
|
+
- Context-aware (detects if in package vs project)
|
|
30
|
+
- Automatic namespace enforcement
|
|
31
|
+
- Draft file support with clarification workflow
|
|
32
|
+
- Auto-updates package.yaml and README.md
|
|
33
|
+
- Uses pattern.template.md as base
|
|
34
|
+
|
|
35
|
+
**Use this when**: Creating a new pattern in an ACP project or package.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Prerequisites
|
|
40
|
+
|
|
41
|
+
- [ ] ACP installed in current directory
|
|
42
|
+
- [ ] Pattern template exists (agent/patterns/pattern.template.md or similar)
|
|
43
|
+
- [ ] (Optional) Draft file prepared if using draft workflow
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Arguments
|
|
48
|
+
|
|
49
|
+
**Context Capture Arguments** (optional — passed to `@acp.clarification-capture` directive):
|
|
50
|
+
|
|
51
|
+
| Argument | Alias | Behavior |
|
|
52
|
+
|---|---|---|
|
|
53
|
+
| `--from-clarification <file>` | `--from-clar` | Capture decisions from a specific clarification file |
|
|
54
|
+
| `--from-clarifications` | `--from-clars` | Capture from all recent clarifications |
|
|
55
|
+
| `--from-chat-context` | `--from-chat` | Capture decisions from chat conversation |
|
|
56
|
+
| `--from-context` | (none) | Shorthand for all sources (clarifications + chat) |
|
|
57
|
+
| `--include-clarifications` | (none) | Alias for `--from-clars` |
|
|
58
|
+
|
|
59
|
+
**Default behavior** (no flags): Auto-detect clarifications and context in session.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Steps
|
|
64
|
+
|
|
65
|
+
### 1. Detect Context
|
|
66
|
+
|
|
67
|
+
Determine if in package or project directory:
|
|
68
|
+
|
|
69
|
+
**Actions**:
|
|
70
|
+
- Check if package.yaml exists (use `is_acp_package()`)
|
|
71
|
+
- If package: Infer namespace from package.yaml, directory, or git remote
|
|
72
|
+
- If project: Use "local" namespace
|
|
73
|
+
|
|
74
|
+
**Expected Outcome**: Context detected, namespace determined
|
|
75
|
+
|
|
76
|
+
### 2. Check for Draft File
|
|
77
|
+
|
|
78
|
+
Check if draft file was provided as argument:
|
|
79
|
+
|
|
80
|
+
**Syntax**:
|
|
81
|
+
- `@acp.pattern-create @my-draft.md` (@ reference)
|
|
82
|
+
- `@acp.pattern-create agent/drafts/my-draft.md` (path)
|
|
83
|
+
- `@acp.pattern-create` (no draft)
|
|
84
|
+
|
|
85
|
+
**Actions**:
|
|
86
|
+
- If draft provided: Read draft file
|
|
87
|
+
- If no draft: Proceed to Step 3
|
|
88
|
+
|
|
89
|
+
**Expected Outcome**: Draft file read (if provided)
|
|
90
|
+
|
|
91
|
+
### 2.5. Read Contextual Key Files
|
|
92
|
+
|
|
93
|
+
Before creating content, load relevant key files from the index.
|
|
94
|
+
|
|
95
|
+
**Actions**:
|
|
96
|
+
- Check if `agent/index/` directory exists
|
|
97
|
+
- If exists, scan for all `*.yaml` files (excluding `*.template.yaml`)
|
|
98
|
+
- Filter entries where `applies` includes `acp.pattern-create`
|
|
99
|
+
- Sort by weight descending, read matching files
|
|
100
|
+
- Produce visible output
|
|
101
|
+
|
|
102
|
+
**Note**: If `agent/index/` does not exist, skip silently.
|
|
103
|
+
|
|
104
|
+
### 2.7. Capture Clarification Context
|
|
105
|
+
|
|
106
|
+
Invoke the `@acp.clarification-capture` shared directive to capture decisions from clarifications and/or chat context.
|
|
107
|
+
|
|
108
|
+
**Actions**:
|
|
109
|
+
- Read and follow the directive in [`agent/commands/acp.clarification-capture.md`](acp.clarification-capture.md)
|
|
110
|
+
- Pass through any `--from-*` arguments from this command's invocation
|
|
111
|
+
- If no `--from-*` flags specified: auto-detect clarifications in session (default behavior)
|
|
112
|
+
- If uncaptured clarifications detected, show warning and ask user whether to include
|
|
113
|
+
- Directive returns a "Key Design Decisions" markdown section (or nothing if no context)
|
|
114
|
+
- Hold the generated section for insertion during Step 5 (Generate Pattern File)
|
|
115
|
+
|
|
116
|
+
**Expected Outcome**: Key Design Decisions section generated (if context available), or skipped cleanly
|
|
117
|
+
|
|
118
|
+
### 3. Collect Pattern Information
|
|
119
|
+
|
|
120
|
+
Gather information from user via chat:
|
|
121
|
+
|
|
122
|
+
**Information to Collect**:
|
|
123
|
+
- **Pattern name** (without namespace prefix)
|
|
124
|
+
- Example: "user-scoped-collections" (not "firebase.user-scoped-collections")
|
|
125
|
+
- Validation: lowercase, alphanumeric, hyphens
|
|
126
|
+
- **Pattern description** (one-line summary)
|
|
127
|
+
- Example: "User-scoped Firestore data organization"
|
|
128
|
+
- **Pattern version** (default: 1.0.0)
|
|
129
|
+
|
|
130
|
+
**If no draft provided**:
|
|
131
|
+
- Ask: "Describe what you want this pattern to accomplish" OR
|
|
132
|
+
- Offer: "Would you like to create an empty draft file first?"
|
|
133
|
+
|
|
134
|
+
**Expected Outcome**: All pattern metadata collected
|
|
135
|
+
|
|
136
|
+
### 4. Process Draft (If Provided)
|
|
137
|
+
|
|
138
|
+
If draft file was provided, create clarification:
|
|
139
|
+
|
|
140
|
+
**Actions**:
|
|
141
|
+
- Analyze draft for clarity and completeness
|
|
142
|
+
- If draft is clear and complete: Skip clarification, use draft content
|
|
143
|
+
- If draft is ambiguous: Create clarification document
|
|
144
|
+
- Find next clarification number
|
|
145
|
+
- Create `agent/clarifications/clarification-{N}-pattern-{name}.md`
|
|
146
|
+
- Generate questions about unclear aspects
|
|
147
|
+
- Wait for user to answer clarification
|
|
148
|
+
- Read answered clarification
|
|
149
|
+
|
|
150
|
+
**Expected Outcome**: Clarification created and answered (if needed)
|
|
151
|
+
|
|
152
|
+
### 5. Generate Pattern File
|
|
153
|
+
|
|
154
|
+
Create pattern file from template:
|
|
155
|
+
|
|
156
|
+
**Actions**:
|
|
157
|
+
- Determine full filename: `{namespace}.{pattern-name}.md`
|
|
158
|
+
- Copy from pattern template
|
|
159
|
+
- Fill in metadata (name, version, date, description)
|
|
160
|
+
- If draft/clarification provided: Incorporate content
|
|
161
|
+
- If no draft: Create from template with user-provided description
|
|
162
|
+
- If Key Design Decisions section was generated in Step 2.7: Insert it into the pattern document
|
|
163
|
+
- Save to `agent/patterns/{namespace}.{pattern-name}.md`
|
|
164
|
+
|
|
165
|
+
**Expected Outcome**: Pattern file created
|
|
166
|
+
|
|
167
|
+
### 6. Update package.yaml (If in Package)
|
|
168
|
+
|
|
169
|
+
Add pattern to package.yaml contents:
|
|
170
|
+
|
|
171
|
+
**Actions**:
|
|
172
|
+
- Read package.yaml
|
|
173
|
+
- Add entry to contents.patterns array:
|
|
174
|
+
```yaml
|
|
175
|
+
- name: {namespace}.{pattern-name}.md
|
|
176
|
+
version: 1.0.0
|
|
177
|
+
description: {description}
|
|
178
|
+
```
|
|
179
|
+
- Save package.yaml
|
|
180
|
+
|
|
181
|
+
**Expected Outcome**: package.yaml updated
|
|
182
|
+
|
|
183
|
+
### 7. Update README.md (If in Package)
|
|
184
|
+
|
|
185
|
+
Update README contents section:
|
|
186
|
+
|
|
187
|
+
**Actions**:
|
|
188
|
+
- Call `update_readme_contents()` from common.sh
|
|
189
|
+
- Regenerates "What's Included" section from package.yaml
|
|
190
|
+
|
|
191
|
+
**Expected Outcome**: README.md updated with new pattern
|
|
192
|
+
|
|
193
|
+
### 8. Prompt to Delete Draft (If Used)
|
|
194
|
+
|
|
195
|
+
If draft file was used, ask to delete it:
|
|
196
|
+
|
|
197
|
+
**Actions**:
|
|
198
|
+
- Ask: "Would you like to delete the draft file? (yes/no)"
|
|
199
|
+
- If yes: Delete draft file
|
|
200
|
+
- If no: Keep draft file
|
|
201
|
+
|
|
202
|
+
**Expected Outcome**: User chooses whether to keep draft
|
|
203
|
+
|
|
204
|
+
### 9. Report Success
|
|
205
|
+
|
|
206
|
+
Display what was created:
|
|
207
|
+
|
|
208
|
+
**Output**:
|
|
209
|
+
```
|
|
210
|
+
✅ Pattern Created Successfully!
|
|
211
|
+
|
|
212
|
+
File: agent/patterns/{namespace}.{pattern-name}.md
|
|
213
|
+
Namespace: {namespace}
|
|
214
|
+
Version: 1.0.0
|
|
215
|
+
|
|
216
|
+
✓ Pattern file created
|
|
217
|
+
✓ package.yaml updated (if package)
|
|
218
|
+
✓ README.md updated (if package)
|
|
219
|
+
✓ Draft file deleted (if requested)
|
|
220
|
+
|
|
221
|
+
Next steps:
|
|
222
|
+
- Edit the pattern file to add implementation details
|
|
223
|
+
- Run @acp.package-validate to verify (if package)
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**Expected Outcome**: User knows pattern was created successfully
|
|
227
|
+
|
|
228
|
+
### 10. Prompt to Add to Key File Index
|
|
229
|
+
|
|
230
|
+
After successful creation, offer to add the new file to the index (if `agent/index/` exists).
|
|
231
|
+
|
|
232
|
+
**Display**:
|
|
233
|
+
```
|
|
234
|
+
Would you like to add this to the key file index?
|
|
235
|
+
- Yes, add to agent/index/local.main.yaml
|
|
236
|
+
- No, skip
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
If yes, prompt for weight (suggest 0.8 for patterns), description, rationale, and applies values. Add entry to `agent/index/local.main.yaml`.
|
|
240
|
+
|
|
241
|
+
**Note**: Skip silently if `agent/index/` does not exist.
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Verification
|
|
246
|
+
|
|
247
|
+
- [ ] Context detected correctly (package vs project)
|
|
248
|
+
- [ ] Namespace inferred or determined
|
|
249
|
+
- [ ] Pattern information collected
|
|
250
|
+
- [ ] Draft processed (if provided)
|
|
251
|
+
- [ ] Pattern file created with correct namespace
|
|
252
|
+
- [ ] package.yaml updated (if package)
|
|
253
|
+
- [ ] README.md updated (if package)
|
|
254
|
+
- [ ] Pattern follows template structure
|
|
255
|
+
- [ ] All metadata filled in correctly
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Expected Output
|
|
260
|
+
|
|
261
|
+
### Files Created
|
|
262
|
+
- `agent/patterns/{namespace}.{pattern-name}.md` - Pattern file
|
|
263
|
+
- `agent/clarifications/clarification-{N}-pattern-{name}.md` - Clarification (if draft was ambiguous)
|
|
264
|
+
|
|
265
|
+
### Files Modified
|
|
266
|
+
- `package.yaml` - Pattern added to contents (if package)
|
|
267
|
+
- `README.md` - Contents section updated (if package)
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## Examples
|
|
272
|
+
|
|
273
|
+
### Example 1: Creating Pattern in Package
|
|
274
|
+
|
|
275
|
+
**Context**: In acp-firebase package directory
|
|
276
|
+
|
|
277
|
+
**Invocation**: `@acp.pattern-create`
|
|
278
|
+
|
|
279
|
+
**Interaction**:
|
|
280
|
+
```
|
|
281
|
+
Agent: Detected package context. Namespace: firebase
|
|
282
|
+
|
|
283
|
+
Agent: What would you like to name your pattern? (without namespace prefix)
|
|
284
|
+
User: user-scoped-collections
|
|
285
|
+
|
|
286
|
+
Agent: Provide a one-line description:
|
|
287
|
+
User: User-scoped Firestore data organization
|
|
288
|
+
|
|
289
|
+
Agent: Pattern version? (default: 1.0.0)
|
|
290
|
+
User: [Enter]
|
|
291
|
+
|
|
292
|
+
✅ Pattern Created Successfully!
|
|
293
|
+
|
|
294
|
+
File: agent/patterns/firebase.user-scoped-collections.md
|
|
295
|
+
Namespace: firebase
|
|
296
|
+
Version: 1.0.0
|
|
297
|
+
|
|
298
|
+
✓ Pattern file created
|
|
299
|
+
✓ package.yaml updated
|
|
300
|
+
✓ README.md updated
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Example 2: Creating Pattern with Draft
|
|
304
|
+
|
|
305
|
+
**Context**: Have draft file describing pattern
|
|
306
|
+
|
|
307
|
+
**Invocation**: `@acp.pattern-create @my-pattern-draft.md`
|
|
308
|
+
|
|
309
|
+
**Result**: Reads draft, creates clarification if needed, generates pattern, updates package files
|
|
310
|
+
|
|
311
|
+
### Example 3: Creating Pattern in Project
|
|
312
|
+
|
|
313
|
+
**Context**: In regular project (no package.yaml)
|
|
314
|
+
|
|
315
|
+
**Invocation**: `@acp.pattern-create`
|
|
316
|
+
|
|
317
|
+
**Result**: Uses "local" namespace, creates `agent/patterns/local.my-pattern.md`, no package updates
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Related Commands
|
|
322
|
+
|
|
323
|
+
- [`@acp.command-create`](acp.command-create.md) - Create commands
|
|
324
|
+
- [`@acp.design-create`](acp.design-create.md) - Create designs
|
|
325
|
+
- [`@acp.package-validate`](acp.package-validate.md) - Validate package after creation
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## Troubleshooting
|
|
330
|
+
|
|
331
|
+
### Issue 1: Namespace inference failed
|
|
332
|
+
|
|
333
|
+
**Symptom**: Cannot determine namespace
|
|
334
|
+
|
|
335
|
+
**Solution**: Provide namespace manually when prompted, or check package.yaml exists and has name field
|
|
336
|
+
|
|
337
|
+
### Issue 2: Invalid pattern name
|
|
338
|
+
|
|
339
|
+
**Symptom**: Pattern name rejected
|
|
340
|
+
|
|
341
|
+
**Solution**: Use lowercase, alphanumeric, and hyphens only. No spaces or special characters.
|
|
342
|
+
|
|
343
|
+
### Issue 3: package.yaml update failed
|
|
344
|
+
|
|
345
|
+
**Symptom**: Error updating package.yaml
|
|
346
|
+
|
|
347
|
+
**Solution**: Verify package.yaml exists and is valid YAML. Run @acp.package-validate to check.
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
## Security Considerations
|
|
352
|
+
|
|
353
|
+
### File Access
|
|
354
|
+
- **Reads**: package.yaml, draft files, pattern templates
|
|
355
|
+
- **Writes**: agent/patterns/{namespace}.{name}.md, package.yaml, README.md
|
|
356
|
+
- **Executes**: None
|
|
357
|
+
|
|
358
|
+
### Network Access
|
|
359
|
+
- **APIs**: None
|
|
360
|
+
- **Repositories**: None
|
|
361
|
+
|
|
362
|
+
### Sensitive Data
|
|
363
|
+
- **Secrets**: Never include secrets in patterns
|
|
364
|
+
- **Credentials**: Never include credentials
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## Notes
|
|
369
|
+
|
|
370
|
+
- Pattern name should be descriptive and specific
|
|
371
|
+
- Namespace is automatically added to filename
|
|
372
|
+
- Draft files can be any format (free-form markdown)
|
|
373
|
+
- Clarifications are created only if draft is ambiguous
|
|
374
|
+
- package.yaml and README.md updates are automatic in packages
|
|
375
|
+
- In non-package projects, uses "local" namespace
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
**Namespace**: acp
|
|
380
|
+
**Command**: pattern-create
|
|
381
|
+
**Version**: 1.0.0
|
|
382
|
+
**Created**: 2026-02-20
|
|
383
|
+
**Last Updated**: 2026-02-20
|
|
384
|
+
**Status**: Active
|
|
385
|
+
**Compatibility**: ACP 2.2.0+
|
|
386
|
+
**Author**: ACP Project
|