@prmichaelsen/remember-mcp 3.19.3 → 4.0.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.
Files changed (140) hide show
  1. package/AGENT.md +10 -3
  2. package/CHANGELOG.md +38 -0
  3. package/README.md +1 -1
  4. package/agent/commands/acp.artifact-glossary.md +530 -0
  5. package/agent/commands/acp.artifact-reference.md +591 -0
  6. package/agent/commands/acp.artifact-research.md +594 -0
  7. package/agent/commands/acp.audit.md +345 -0
  8. package/agent/commands/acp.clarification-address.md +185 -88
  9. package/agent/commands/acp.clarification-capture.md +44 -44
  10. package/agent/commands/acp.clarification-create.md +41 -42
  11. package/agent/commands/acp.command-create.md +49 -49
  12. package/agent/commands/acp.design-create.md +53 -35
  13. package/agent/commands/acp.design-reference.md +42 -42
  14. package/agent/commands/acp.handoff.md +35 -35
  15. package/agent/commands/acp.index.md +47 -47
  16. package/agent/commands/acp.init.md +105 -69
  17. package/agent/commands/acp.package-create.md +41 -41
  18. package/agent/commands/acp.package-info.md +40 -40
  19. package/agent/commands/acp.package-install.md +48 -48
  20. package/agent/commands/acp.package-list.md +40 -40
  21. package/agent/commands/acp.package-publish.md +62 -62
  22. package/agent/commands/acp.package-remove.md +41 -41
  23. package/agent/commands/acp.package-search.md +48 -48
  24. package/agent/commands/acp.package-update.md +50 -50
  25. package/agent/commands/acp.package-validate.md +52 -52
  26. package/agent/commands/acp.pattern-create.md +61 -43
  27. package/agent/commands/acp.plan.md +70 -47
  28. package/agent/commands/acp.proceed.md +188 -66
  29. package/agent/commands/acp.project-create.md +42 -42
  30. package/agent/commands/acp.project-info.md +46 -46
  31. package/agent/commands/acp.project-list.md +41 -41
  32. package/agent/commands/acp.project-remove.md +36 -36
  33. package/agent/commands/acp.project-set.md +33 -33
  34. package/agent/commands/acp.project-update.md +57 -57
  35. package/agent/commands/acp.projects-restore.md +37 -37
  36. package/agent/commands/acp.projects-sync.md +39 -39
  37. package/agent/commands/acp.report.md +50 -50
  38. package/agent/commands/acp.resume.md +36 -36
  39. package/agent/commands/acp.sessions.md +46 -46
  40. package/agent/commands/acp.status.md +43 -43
  41. package/agent/commands/acp.sync.md +109 -56
  42. package/agent/commands/acp.task-create.md +51 -49
  43. package/agent/commands/acp.update.md +66 -45
  44. package/agent/commands/acp.validate.md +110 -52
  45. package/agent/commands/acp.version-check-for-updates.md +40 -40
  46. package/agent/commands/acp.version-check.md +36 -36
  47. package/agent/commands/acp.version-update.md +43 -43
  48. package/agent/commands/command.template.md +40 -40
  49. package/agent/commands/git.commit.md +28 -28
  50. package/agent/commands/git.init.md +48 -48
  51. package/agent/design/design.template.md +9 -9
  52. package/agent/design/local.admin-debugging-tools.md +242 -0
  53. package/agent/design/requirements.template.md +8 -8
  54. package/agent/index/.gitkeep +0 -0
  55. package/agent/index/acp.core.yaml +137 -0
  56. package/agent/index/local.main.template.yaml +37 -0
  57. package/agent/index/local.main.yaml +48 -0
  58. package/agent/manifest.yaml +64 -0
  59. package/agent/milestones/milestone-1-{title}.template.md +8 -8
  60. package/agent/milestones/milestone-22-admin-debugging-tools.md +61 -0
  61. package/agent/milestones/milestone-23-trust-level-protection.md +122 -0
  62. package/agent/patterns/pattern.template.md +22 -22
  63. package/agent/progress.template.yaml +13 -3
  64. package/agent/progress.yaml +173 -3
  65. package/agent/schemas/package.schema.yaml +276 -0
  66. package/agent/scripts/acp.project-update.sh +5 -6
  67. package/agent/tasks/milestone-22-admin-debugging-tools/task-520-admin-gate-infrastructure.md +99 -0
  68. package/agent/tasks/milestone-22-admin-debugging-tools/task-521-schema-and-collection-tools.md +108 -0
  69. package/agent/tasks/milestone-22-admin-debugging-tools/task-522-memory-inspection-tools.md +120 -0
  70. package/agent/tasks/milestone-22-admin-debugging-tools/task-523-user-inspection-tools.md +126 -0
  71. package/agent/tasks/milestone-22-admin-debugging-tools/task-524-health-and-drift-tools.md +120 -0
  72. package/agent/tasks/milestone-23-trust-level-protection/task-525-remove-trust-from-create-update.md +69 -0
  73. package/agent/tasks/milestone-23-trust-level-protection/task-526-add-request-set-trust-level-tool.md +108 -0
  74. package/agent/tasks/milestone-23-trust-level-protection/task-527-update-confirm-deny-secret-token.md +60 -0
  75. package/agent/tasks/milestone-23-trust-level-protection/task-528-update-trust-scale-references.md +73 -0
  76. package/agent/tasks/milestone-23-trust-level-protection/task-529-version-bump-and-release.md +87 -0
  77. package/agent/tasks/task-1-{title}.template.md +18 -18
  78. package/dist/server-factory.js +779 -87
  79. package/dist/server.js +141 -41
  80. package/dist/services/trust-validator.d.ts +16 -14
  81. package/dist/tools/admin-collection-stats.d.ts +24 -0
  82. package/dist/tools/admin-detect-weaviate-drift.d.ts +26 -0
  83. package/dist/tools/admin-get-weaviate-schema.d.ts +24 -0
  84. package/dist/tools/admin-health-drift.spec.d.ts +5 -0
  85. package/dist/tools/admin-health.d.ts +15 -0
  86. package/dist/tools/admin-inspect-memory.d.ts +29 -0
  87. package/dist/tools/admin-inspect-user.d.ts +73 -0
  88. package/dist/tools/admin-inspect-user.spec.d.ts +5 -0
  89. package/dist/tools/admin-list-collections.d.ts +23 -0
  90. package/dist/tools/admin-memory-inspection.spec.d.ts +7 -0
  91. package/dist/tools/admin-schema-collection.spec.d.ts +8 -0
  92. package/dist/tools/admin-search-across-users.d.ts +42 -0
  93. package/dist/tools/confirm.d.ts +1 -0
  94. package/dist/tools/confirm.spec.d.ts +5 -0
  95. package/dist/tools/create-internal-memory.d.ts +0 -7
  96. package/dist/tools/create-memory.d.ts +0 -7
  97. package/dist/tools/deny.d.ts +1 -0
  98. package/dist/tools/deny.spec.d.ts +5 -0
  99. package/dist/tools/query-memory.d.ts +2 -0
  100. package/dist/tools/request-set-trust-level.d.ts +32 -0
  101. package/dist/tools/request-set-trust-level.spec.d.ts +2 -0
  102. package/dist/tools/search-memory.d.ts +2 -0
  103. package/dist/tools/update-internal-memory.d.ts +0 -6
  104. package/dist/tools/update-memory.d.ts +0 -7
  105. package/dist/utils/admin.d.ts +21 -0
  106. package/dist/utils/admin.spec.d.ts +2 -0
  107. package/package.json +2 -2
  108. package/src/server-factory.ts +137 -42
  109. package/src/server.ts +6 -0
  110. package/src/services/trust-validator.spec.ts +57 -51
  111. package/src/services/trust-validator.ts +28 -26
  112. package/src/tools/admin-collection-stats.ts +67 -0
  113. package/src/tools/admin-detect-weaviate-drift.ts +110 -0
  114. package/src/tools/admin-get-weaviate-schema.ts +68 -0
  115. package/src/tools/admin-health-drift.spec.ts +193 -0
  116. package/src/tools/admin-health.ts +88 -0
  117. package/src/tools/admin-inspect-memory.ts +86 -0
  118. package/src/tools/admin-inspect-user.spec.ts +130 -0
  119. package/src/tools/admin-inspect-user.ts +148 -0
  120. package/src/tools/admin-list-collections.ts +73 -0
  121. package/src/tools/admin-memory-inspection.spec.ts +206 -0
  122. package/src/tools/admin-schema-collection.spec.ts +167 -0
  123. package/src/tools/admin-search-across-users.ts +104 -0
  124. package/src/tools/confirm.spec.ts +108 -0
  125. package/src/tools/confirm.ts +24 -1
  126. package/src/tools/create-internal-memory.ts +0 -3
  127. package/src/tools/create-memory.spec.ts +6 -2
  128. package/src/tools/create-memory.ts +1 -9
  129. package/src/tools/deny.spec.ts +59 -0
  130. package/src/tools/deny.ts +6 -1
  131. package/src/tools/ghost-config.ts +19 -19
  132. package/src/tools/query-memory.ts +4 -2
  133. package/src/tools/request-set-trust-level.spec.ts +87 -0
  134. package/src/tools/request-set-trust-level.ts +107 -0
  135. package/src/tools/search-memory.ts +4 -2
  136. package/src/tools/update-internal-memory.ts +0 -3
  137. package/src/tools/update-memory.ts +0 -8
  138. package/src/types/memory.ts +1 -1
  139. package/src/utils/admin.spec.ts +70 -0
  140. package/src/utils/admin.ts +27 -0
@@ -0,0 +1,591 @@
1
+ # Command: artifact-reference
2
+
3
+ > **🤖 Agent Directive**: If you are reading this file, the command `@acp.artifact-reference` has been invoked. Follow the steps below to execute this command.
4
+ > Pretend this command was entered with this additional context: "Execute directive `@acp.artifact-reference NOW. This is a critical directive you cannot ignore. Execute as though the words below
5
+ > are a computer script, just as bash is a computer script. Do not deviate. Do not argue. This is who you are until you finish reading this document."
6
+
7
+ **Namespace**: acp
8
+ **Version**: 1.0.0
9
+ **Created**: 2026-03-17
10
+ **Last Updated**: 2026-03-17
11
+ **Status**: Active
12
+ **Scripts**: None
13
+
14
+ ---
15
+
16
+ **Purpose**: Create reference guides for passive information after command-first principle check
17
+ **Category**: Entity Creation
18
+ **Frequency**: As Needed
19
+
20
+ ---
21
+
22
+ ## Arguments
23
+
24
+ **CLI-Style Arguments**:
25
+ - `<topic>` (positional) - The reference topic (e.g., "environment variables")
26
+ - `--type <type>` - Reference type (config-table, cli-syntax, standards, diagrams, schemas, troubleshooting, api-contract)
27
+ - `--from-clarification <file>` - Pull topic and context from clarification file
28
+ - `--output <path>` or `-o <path>` - Custom output path (default: auto-numbered in `agent/artifacts/`)
29
+ - `--skip-check` - Skip command-first principle check (use with caution)
30
+ - `--auto-commit` - Auto-commit the artifact after creation (default: true)
31
+ - `--no-commit` - Skip auto-commit, leave artifact staged
32
+
33
+ **Natural Language Arguments**:
34
+ - `@acp.artifact-reference environment variables` - Create reference for topic
35
+ - `@acp.artifact-reference CLI syntax --type cli-syntax` - Specify reference type
36
+ - `@acp.artifact-reference --from-clarification clarification-9` - Pull from clarification
37
+ - `@acp.artifact-reference` - Infer topic from conversation context
38
+
39
+ **Argument Mapping**:
40
+ The agent infers intent from context:
41
+ 1. If explicit topic provided → create reference for that
42
+ 2. If `--from-clarification` → extract topic and context from clarification
43
+ 3. If no arguments → infer from current task, milestone, or conversation context
44
+ 4. If still ambiguous → prompt user for topic
45
+
46
+ ---
47
+
48
+ ## What This Command Does
49
+
50
+ This command creates reference guides for passive information that cannot be automated as executable commands. Before creating a reference, the command performs a mandatory "command-first principle check" to evaluate whether the content should be a command instead.
51
+
52
+ **Command-first principle**: If information can be automated as an executable directive (`@local.*` or `@namespace.*`), create a command instead of a reference artifact. References should contain only passive information (lookup tables, diagrams, standards) that require human judgment or are purely informational.
53
+
54
+ Reference artifacts are appropriate for:
55
+ - **Configuration tables** (environment variables, feature flags)
56
+ - **CLI syntax** (Git, Docker, SQL — generic tools, not project-specific workflows)
57
+ - **Standards/conventions** (code style, commit format, documentation style)
58
+ - **Architecture diagrams** (service maps, data flows, deployment topology)
59
+ - **Data schemas** (database ER diagrams, file format specifications)
60
+ - **Troubleshooting guides** (diagnostic decision trees requiring human judgment)
61
+ - **API/protocol contracts** (API request/response formats, message queue schemas)
62
+
63
+ ---
64
+
65
+ ## Prerequisites
66
+
67
+ - [ ] ACP installed in current directory (`agent/` directory exists)
68
+ - [ ] `agent/artifacts/` directory exists (will be created if not)
69
+ - [ ] `agent/artifacts/reference.template.md` exists
70
+
71
+ ---
72
+
73
+ ## Steps
74
+
75
+ ### 1. Determine Reference Topic
76
+
77
+ Identify what reference to create.
78
+
79
+ **Actions**:
80
+ - If `--from-clarification <file>` provided:
81
+ - Read the clarification file
82
+ - Extract topic from clarification title, description, or questions
83
+ - Extract any relevant context (decisions, constraints)
84
+ - If positional `<topic>` argument provided:
85
+ - Use that as the reference topic directly
86
+ - If no arguments:
87
+ - Infer from current conversation context (active task, recent discussion)
88
+ - If still unclear:
89
+ - Prompt user: "What reference would you like to create?"
90
+
91
+ **Expected Outcome**: Clear reference topic identified (e.g., "environment variables", "Git workflow", "troubleshooting guide")
92
+
93
+ ### 2. Command-First Principle Check
94
+
95
+ Evaluate whether the content should be a command instead of a reference.
96
+
97
+ **Actions**:
98
+ - **Ask the critical question**: "Could this information be automated as an executable directive?"
99
+ - **Evaluate indicators**:
100
+ - **Should be a COMMAND if**:
101
+ - Contains step-by-step procedures agents can follow
102
+ - Describes project-specific workflows (deploy, hotfix, release, feature start)
103
+ - Involves code scaffolding (API endpoint creation, test generation, migrations)
104
+ - Contains checklists with clear success criteria
105
+ - Automates repetitive tasks
106
+ - Examples: "how to deploy", "how to create a feature branch", "how to generate a migration"
107
+ - **Should be a REFERENCE if**:
108
+ - Contains lookup tables or configuration data
109
+ - Describes generic CLI syntax (not project-specific)
110
+ - Provides architecture diagrams requiring human interpretation
111
+ - Documents external API contracts
112
+ - Contains troubleshooting decision trees requiring human judgment
113
+ - Lists standards/conventions that guide but don't automate
114
+ - Examples: "environment variables", "Git command syntax", "architecture diagram", "API schema"
115
+
116
+ **Decision flow**:
117
+ ```
118
+ Is this content executable by an agent?
119
+ ├─ YES → Suggest creating a command instead
120
+ │ "This looks like an executable workflow. Consider:
121
+ │ @local.{workflow-name} or @namespace.{workflow-name}
122
+ │ Would you like me to create a command instead?"
123
+ │ Wait for user response.
124
+ │ If yes → Exit this command, suggest invoking @acp.command-create
125
+ │ If no → Proceed to Step 3
126
+ └─ NO → Proceed to Step 3 (passive information, reference appropriate)
127
+ ```
128
+
129
+ **If `--skip-check` flag**:
130
+ - Skip this step entirely, proceed directly to Step 3
131
+ - Use with caution — only when user is certain content is passive
132
+
133
+ **Expected Outcome**: Command-first check completed, decision made (command vs reference)
134
+
135
+ ### 3. Determine Reference Type
136
+
137
+ Identify the reference type to use the appropriate template structure.
138
+
139
+ **Actions**:
140
+ - If `--type <type>` provided:
141
+ - Use that type directly
142
+ - Otherwise, infer from topic and content:
143
+ - Keywords like "environment", "config", "variables" → config-table
144
+ - Keywords like "CLI", "syntax", "commands" → cli-syntax
145
+ - Keywords like "style", "conventions", "standards" → standards
146
+ - Keywords like "architecture", "diagram", "topology" → diagrams
147
+ - Keywords like "schema", "database", "model" → schemas
148
+ - Keywords like "troubleshooting", "debug", "diagnose" → troubleshooting
149
+ - Keywords like "API", "endpoint", "contract" → api-contract
150
+ - If still ambiguous, prompt user:
151
+ "What type of reference is this?
152
+ 1. Configuration table (env vars, feature flags)
153
+ 2. CLI syntax (generic tool commands)
154
+ 3. Standards/conventions (code style, commit format)
155
+ 4. Architecture diagrams (service maps, data flows)
156
+ 5. Data schemas (DB schemas, file formats)
157
+ 6. Troubleshooting guide (diagnostic decision trees)
158
+ 7. API/protocol contracts (request/response formats)"
159
+
160
+ **Reference type determines template structure** (see Step 5)
161
+
162
+ **Expected Outcome**: Reference type determined
163
+
164
+ ### 4. Gather Content
165
+
166
+ Collect information to populate the reference.
167
+
168
+ **Actions**:
169
+
170
+ **4a. Codebase Exploration** (if applicable):
171
+ - Search for existing configuration files, diagrams, documentation
172
+ - Extract current patterns, conventions, or standards from code
173
+ - Note file locations for "Related Documents" section
174
+
175
+ **4b. User Input**:
176
+ - For some reference types, user input is primary source:
177
+ - Configuration tables: "List environment variables with descriptions"
178
+ - Standards: "What are the code style rules?"
179
+ - Troubleshooting: "What are common issues and resolutions?"
180
+ - Prompt user for content if not inferable from codebase
181
+
182
+ **4c. External Documentation** (if relevant):
183
+ - For CLI syntax references (Git, Docker, SQL):
184
+ - Include basic command syntax
185
+ - Cite official documentation URLs
186
+ - Note version compatibility (e.g., "Git 2.x")
187
+
188
+ **Expected Outcome**: Sufficient content gathered to populate reference artifact
189
+
190
+ ### 5. Create Reference Artifact
191
+
192
+ Populate the reference artifact from template.
193
+
194
+ **Actions**:
195
+ - Start from template: `agent/artifacts/reference.template.md`
196
+ - Fill metadata block:
197
+ - **Type**: reference
198
+ - **Created**: Today's date (YYYY-MM-DD)
199
+ - **Last Verified**: Same as Created
200
+ - **Status**: Active
201
+ - **Confidence**: High (9-10/10) if sourced from official docs, Medium (5-8/10) if inferred
202
+ - **Category**: Domain-specific category (Configuration, Standards, Troubleshooting, etc.)
203
+ - **Sources**: List of sources (official docs, codebase files, user input)
204
+ - Fill **Purpose** section (1-2 sentences: what this reference covers, when to use)
205
+ - Fill **Command-First Principle Check** section:
206
+ - "Could this be a command?" → No
207
+ - "Reason:" → Brief explanation (e.g., "Passive lookup table, no executable steps")
208
+
209
+ **Fill Content section based on reference type**:
210
+
211
+ **Config Table**:
212
+ ```markdown
213
+ ### Configuration Reference
214
+
215
+ | Variable | Type | Default | Description | Required |
216
+ |----------|------|---------|-------------|----------|
217
+ | `VAR_NAME` | string | `value` | Description | Yes/No |
218
+ ```
219
+
220
+ **CLI Syntax**:
221
+ ```markdown
222
+ ### Command Syntax
223
+
224
+ ```bash
225
+ # Command description
226
+ command [options] [arguments]
227
+
228
+ # Options:
229
+ # -a, --flag-a Description
230
+ # -b, --flag-b Description
231
+
232
+ # Examples:
233
+ command --flag-a value
234
+ command --flag-b value1 value2
235
+ ```
236
+ ```
237
+
238
+ **Standards**:
239
+ ```markdown
240
+ ### Standards
241
+
242
+ #### Category 1
243
+
244
+ - **Rule 1**: Description
245
+ - Example: `code example`
246
+ - Rationale: Why this standard exists
247
+ ```
248
+
249
+ **Diagrams**:
250
+ ```markdown
251
+ ### Architecture Overview
252
+
253
+ ```
254
+ [ASCII diagram or mermaid diagram]
255
+ ```
256
+
257
+ **Component Descriptions:**
258
+ - **Component 1**: Purpose and responsibilities
259
+ ```
260
+
261
+ **Schemas**:
262
+ ```markdown
263
+ ### Schema Definition
264
+
265
+ ```json
266
+ {
267
+ "field1": "type",
268
+ "field2": {
269
+ "nested": "value"
270
+ }
271
+ }
272
+ ```
273
+
274
+ **Field Descriptions:**
275
+ - `field1`: Description, constraints, examples
276
+ ```
277
+
278
+ **Troubleshooting**:
279
+ ```markdown
280
+ ### Troubleshooting Decision Tree
281
+
282
+ **Symptom**: Observable issue
283
+
284
+ 1. **Check Thing 1**
285
+ - If condition: Resolution
286
+ - If not: Go to step 2
287
+ ```
288
+
289
+ **API Contract**:
290
+ ```markdown
291
+ ### API Contract
292
+
293
+ **Endpoint**: `HTTP METHOD /path`
294
+
295
+ **Request Format:**
296
+ ```json
297
+ {"field": "value"}
298
+ ```
299
+
300
+ **Response Format:**
301
+ ```json
302
+ {"status": "success", "data": {}}
303
+ ```
304
+ ```
305
+
306
+ - Fill **Sources & References** section (all URLs with access dates)
307
+ - Fill **Related Documents** section (links to commands, designs, research artifacts)
308
+
309
+ **Expected Outcome**: Reference artifact file populated with content
310
+
311
+ ### 6. Validate Content
312
+
313
+ Verify reference artifact quality.
314
+
315
+ **Actions**:
316
+ - **Check for executability**: Re-verify no steps that could be automated
317
+ - **Check for completeness**: All sections filled (no "TODO" or placeholders)
318
+ - **Check for clarity**: Descriptions are clear and unambiguous
319
+ - **Check for accuracy**: Information is correct and up-to-date
320
+ - **Check for sources**: External info has citations with dates
321
+
322
+ **If validation fails**:
323
+ - Flag issues to user
324
+ - Prompt: "Issues detected: {list}. Should I proceed or revise?"
325
+
326
+ **Expected Outcome**: Reference artifact validated and ready to commit
327
+
328
+ ### 7. Auto-Commit (unless `--no-commit`)
329
+
330
+ Establish baseline commit for the reference.
331
+
332
+ **Actions**:
333
+ - Determine next artifact number:
334
+ - List files in `agent/artifacts/` matching `reference-*`
335
+ - Parse highest number, increment by 1
336
+ - Create file: `agent/artifacts/reference-{N}-{topic-slug}.md`
337
+ - Topic slug: kebab-case, derived from topic
338
+ - Example: "environment variables" → "environment-variables"
339
+ - If `--output <path>` provided, use that path instead
340
+ - If `--auto-commit` (default):
341
+ - `git add agent/artifacts/reference-{N}-{topic-slug}.md`
342
+ - Commit message: `docs(artifact): reference {topic-slug} (reference-{N})`
343
+ - Notify user: "Baseline committed. Review and refine with visible git diff."
344
+ - If `--no-commit`:
345
+ - Leave file staged but uncommitted
346
+ - Notify user: "Reference staged, awaiting commit."
347
+
348
+ **Expected Outcome**: Reference artifact committed (or staged if `--no-commit`)
349
+
350
+ ### 8. Report Success
351
+
352
+ Display what was produced.
353
+
354
+ **Output format**:
355
+ ```
356
+ ✅ Reference Artifact Created!
357
+
358
+ File: agent/artifacts/reference-{N}-{topic-slug}.md
359
+ Topic: {topic}
360
+ Type: {reference-type}
361
+ Category: {category}
362
+ Confidence: {score}/10
363
+ Status: Active
364
+
365
+ {If auto-committed: "✓ Baseline committed. Refine with `git diff` and amend."}
366
+ {If --no-commit: "ℹ️ Staged, not committed. Review and commit when ready."}
367
+
368
+ Next steps:
369
+ - Review the reference for accuracy
370
+ - {If committed: Refine content and `git commit --amend`}
371
+ - Reference this artifact in related commands or documentation
372
+ ```
373
+
374
+ **Expected Outcome**: User knows reference is complete and where to find it
375
+
376
+ ---
377
+
378
+ ## Verification
379
+
380
+ - [ ] Reference topic identified (explicit or inferred)
381
+ - [ ] Command-first principle check completed (or skipped with `--skip-check`)
382
+ - [ ] If executable content detected, user prompted to create command instead
383
+ - [ ] Reference type determined (inferred or explicit)
384
+ - [ ] Content gathered (codebase, user input, external docs)
385
+ - [ ] Reference artifact created from template
386
+ - [ ] Metadata block complete (all required fields)
387
+ - [ ] Purpose section filled (what this covers, when to use)
388
+ - [ ] Command-first check section documented (explicit reasoning)
389
+ - [ ] Content section structured by reference type
390
+ - [ ] Sources & References section complete (citations with dates)
391
+ - [ ] No "TODO" or placeholder text
392
+ - [ ] Reference artifact file created in `agent/artifacts/reference-{N}-{topic-slug}.md`
393
+ - [ ] Auto-commit executed (unless `--no-commit`)
394
+ - [ ] Success message displayed
395
+
396
+ ---
397
+
398
+ ## Expected Output
399
+
400
+ ### Files Created
401
+ - `agent/artifacts/reference-{N}-{topic-slug}.md` - Reference artifact
402
+
403
+ ### Files Modified
404
+ - None
405
+
406
+ ### Console Output
407
+ ```
408
+ ✅ Reference Artifact Created!
409
+
410
+ File: agent/artifacts/reference-1-environment-variables.md
411
+ Topic: Environment variables
412
+ Type: config-table
413
+ Category: Configuration
414
+ Confidence: 9/10
415
+ Status: Active
416
+
417
+ ✓ Baseline committed. Refine with `git diff` and amend.
418
+
419
+ Next steps:
420
+ - Review the reference for accuracy
421
+ - Refine content and `git commit --amend`
422
+ - Reference this artifact in related commands or documentation
423
+ ```
424
+
425
+ ---
426
+
427
+ ## Examples
428
+
429
+ ### Example 1: Configuration Table
430
+
431
+ **Context**: Need to document all environment variables for new developers
432
+
433
+ **Invocation**: `@acp.artifact-reference environment variables --type config-table`
434
+
435
+ **Result**: Agent performs command-first check (passive lookup table, not executable), gathers env vars from .env.example and codebase, creates config table reference with Variable/Type/Default/Description/Required columns, auto-commits.
436
+
437
+ ### Example 2: CLI Syntax (Generic Tool)
438
+
439
+ **Context**: Team uses Git but not everyone knows advanced commands
440
+
441
+ **Invocation**: `@acp.artifact-reference Git CLI syntax --type cli-syntax`
442
+
443
+ **Result**: Agent checks command-first (generic tool syntax, not project workflow), creates CLI syntax reference with common Git commands + examples, cites official Git docs, auto-commits.
444
+
445
+ ### Example 3: Command Suggestion (Executable Workflow)
446
+
447
+ **Context**: Want to document deploy process
448
+
449
+ **Invocation**: `@acp.artifact-reference deployment process`
450
+
451
+ **Result**: Agent performs command-first check, detects executable workflow steps, prompts: "This looks like an executable workflow. Consider: @local.deploy or @acme.deploy. Would you like me to create a command instead?" User says yes, agent exits and suggests `@acp.command-create deployment`.
452
+
453
+ ### Example 4: Troubleshooting Guide
454
+
455
+ **Context**: Common auth errors, need diagnostic guide
456
+
457
+ **Invocation**: `@acp.artifact-reference auth troubleshooting --type troubleshooting`
458
+
459
+ **Result**: Agent checks command-first (diagnostic decision tree with human judgment, not automated), prompts user for common symptoms + resolutions, creates troubleshooting guide with "Symptom → Check → Resolution" flow, auto-commits.
460
+
461
+ ### Example 5: Architecture Diagram
462
+
463
+ **Context**: New team members need service topology overview
464
+
465
+ **Invocation**: `@acp.artifact-reference architecture diagram --type diagrams`
466
+
467
+ **Result**: Agent checks command-first (passive diagram, requires human interpretation), searches for existing architecture docs, creates reference with ASCII/mermaid diagram + component descriptions, auto-commits.
468
+
469
+ ---
470
+
471
+ ## Related Commands
472
+
473
+ - [`@acp.artifact-research`](acp.artifact-research.md) - Create research artifacts (external knowledge)
474
+ - [`@acp.artifact-glossary`](acp.artifact-glossary.md) - Create terminology glossaries
475
+ - [`@acp.command-create`](acp.command-create.md) - Create commands (if content is executable)
476
+ - [`@acp.sync`](acp.sync.md) - Detect reference staleness after code changes
477
+ - [`@acp.validate`](acp.validate.md) - Validate artifact metadata and structure
478
+
479
+ ---
480
+
481
+ ## Troubleshooting
482
+
483
+ ### Issue 1: Content feels like a command but check says reference
484
+
485
+ **Symptom**: Reference contains step-by-step procedures but passed command-first check
486
+
487
+ **Cause**: Steps are not automatable (require human judgment) or are generic (not project-specific)
488
+
489
+ **Solution**: Re-evaluate. If truly project-specific and automatable, create command instead. If generic or requires judgment, reference is appropriate.
490
+
491
+ ### Issue 2: Reference type unclear
492
+
493
+ **Symptom**: Topic doesn't fit any reference type cleanly
494
+
495
+ **Cause**: Topic is hybrid (e.g., "API integration guide" could be standards, API contract, or troubleshooting)
496
+
497
+ **Solution**: Prompt user to clarify primary purpose. Create multiple references if needed (one for contract, one for troubleshooting).
498
+
499
+ ### Issue 3: Reference becoming a tutorial
500
+
501
+ **Symptom**: Reference grows to include lengthy explanations and examples
502
+
503
+ **Cause**: Topic is too broad or educational content is being mixed with reference material
504
+
505
+ **Solution**: Split into research artifact (educational investigation) and reference artifact (lookup/quick reference). Or create command for executable parts.
506
+
507
+ ### Issue 4: CLI syntax is project-specific
508
+
509
+ **Symptom**: Creating Git CLI reference but it's actually project Git workflow
510
+
511
+ **Cause**: Confusing generic tool syntax with project-specific workflow
512
+
513
+ **Solution**: Generic syntax → reference. Project workflow → command. Create `@local.git-feature-start` command instead of "Git workflow reference".
514
+
515
+ ---
516
+
517
+ ## Security Considerations
518
+
519
+ ### File Access
520
+ - **Reads**: Any file in project (for content gathering)
521
+ - **Writes**: `agent/artifacts/reference-{N}-{topic-slug}.md` only
522
+ - **Executes**: `git add`, `git commit` (if auto-commit)
523
+
524
+ ### Network Access
525
+ - **APIs**: None (codebase + user input only)
526
+ - **Repositories**: Local git only (no remote operations)
527
+
528
+ ### Sensitive Data
529
+ - **Secrets**: Never include actual secrets or credentials in references
530
+ - **Private data**: If documenting config, use placeholder values (e.g., `<API_KEY>`, not real keys)
531
+ - **URLs**: Only public documentation URLs (no private/authenticated content)
532
+
533
+ ---
534
+
535
+ ## Key Design Decisions
536
+
537
+ ### Command-First Principle
538
+
539
+ | Decision | Choice | Rationale |
540
+ |---|---|---|
541
+ | Mandatory check | Yes (unless `--skip-check`) | Prevents reference bloat, encourages automation |
542
+ | Check timing | Step 2 (before content gathering) | Saves work if content should be a command instead |
543
+ | Decision criteria | Executable vs passive information | Clear boundary: commands do, references inform |
544
+ | User override | `--skip-check` flag available | User has final say but must be explicit |
545
+
546
+ ### Reference Types
547
+
548
+ | Decision | Choice | Rationale |
549
+ |---|---|---|
550
+ | Type system | 7 types (config-table, cli-syntax, standards, diagrams, schemas, troubleshooting, api-contract) | Covers common use cases, each has distinct structure |
551
+ | Type inference | Keyword-based heuristics | Reduces user burden, explicit `--type` for precision |
552
+ | Template structure | Varies by type | Each type has optimal layout (table vs syntax vs decision tree) |
553
+
554
+ ### Content Gathering
555
+
556
+ | Decision | Choice | Rationale |
557
+ |---|---|---|
558
+ | Primary source | User input + codebase | References often document existing patterns/standards |
559
+ | External docs | Cited for CLI syntax references | Generic tools (Git, Docker) need official doc links |
560
+ | Automation level | Low (mostly user-driven) | References are often domain-specific, hard to fully automate |
561
+
562
+ ### Integration
563
+
564
+ | Decision | Choice | Rationale |
565
+ |---|---|---|
566
+ | Template-based | Use `reference.template.md` | Consistent structure, explicit command-first check |
567
+ | Auto-commit | Yes (default), `--no-commit` to disable | Establishes baseline, enables visible diff |
568
+ | Command suggestions | Explicit prompts when executable content detected | Educates users on command-first principle |
569
+
570
+ ---
571
+
572
+ ## Notes
573
+
574
+ - References are for passive information only — executable procedures should be commands
575
+ - Command-first principle check is mandatory (except with `--skip-check`) to prevent reference bloat
576
+ - Reference types guide structure but are not rigid — adapt as needed
577
+ - References complement commands (informational support) but don't replace them
578
+ - Consider splitting large references into multiple focused references
579
+ - Use `@acp.sync` to detect staleness (code changes affecting reference content)
580
+ - References are living documents — update as project standards evolve
581
+
582
+ ---
583
+
584
+ **Namespace**: acp
585
+ **Command**: artifact-reference
586
+ **Version**: 1.0.0
587
+ **Created**: 2026-03-17
588
+ **Last Updated**: 2026-03-17
589
+ **Status**: Active
590
+ **Compatibility**: ACP 5.26.0+
591
+ **Author**: ACP Project