Skip to content

Commit ef01985

Browse files
committed
fix: improve experience document types and templates
1 parent fe9b534 commit ef01985

8 files changed

Lines changed: 128 additions & 211 deletions

File tree

.archcore/.sync-state.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,21 @@
159159
"source": "telemetry/telemetry-provider-selection.rfc.md",
160160
"target": "telemetry/posthog-telemetry-implementation.plan.md",
161161
"type": "related"
162+
},
163+
{
164+
"source": "dir/categories-and-document-types.doc.md",
165+
"target": "dir/archcore-directory-structure.guide.md",
166+
"type": "related"
167+
},
168+
{
169+
"source": "dir/categories-and-document-types.doc.md",
170+
"target": "dir/free-form-directory-rules.rule.md",
171+
"type": "related"
172+
},
173+
{
174+
"source": "dir/categories-and-document-types.doc.md",
175+
"target": "dir/free-form-directory-structure.adr.md",
176+
"type": "related"
162177
}
163178
]
164179
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: "Categories and Document Types"
3+
status: accepted
4+
---
5+
6+
## Overview
7+
8+
Archcore organizes documents into three virtual categories — **vision**, **knowledge**, and **experience**. The category is derived from the document type in the filename (`slug.type.md`), not from the directory path.
9+
10+
## Vision
11+
12+
Documents that describe the future: what we want to build and why.
13+
14+
| Type | Purpose |
15+
| ------ | ---------------------------------------------------------- |
16+
| `prd` | Product requirements — goals, scope, acceptance criteria |
17+
| `idea` | A concept worth exploring — problem, value, rough approach |
18+
| `plan` | A concrete implementation plan with phased tasks |
19+
20+
## Knowledge
21+
22+
Documents that capture what we know: decisions, standards, and reference material.
23+
24+
| Type | Purpose |
25+
| --------- | ------------------------------------------------------------------------ |
26+
| `adr` | A technical decision that has been made, with context and alternatives |
27+
| `rfc` | A proposal open for review before a decision is made |
28+
| `rule` | A mandatory standard — imperative statements with good/bad examples |
29+
| `guide` | Step-by-step instructions for completing a task |
30+
| `doc` | General reference — tables, registries, explanations |
31+
| `project` | Project overview with architecture, components, and getting-started info |
32+
33+
## Experience
34+
35+
Documents that encode proven patterns and lessons from practice.
36+
37+
| Type | Purpose |
38+
| ----------- | ----------------------------------------------------------------------------------- |
39+
| `task-type` | A proven workflow for a recurring implementation task — steps, examples, pitfalls |
40+
| `cpat` | A code pattern change — how and why a convention or approach changed (was → became) |
41+
42+
## Choosing the Right Type
43+
44+
- **rule vs doc** — rule prescribes behavior ("Always do X") with enforcement. doc describes what exists. Descriptive content → doc.
45+
- **adr vs rfc** — adr = decision already final. rfc = proposal open for feedback.
46+
- **guide vs doc** — guide has sequential steps to follow. doc is non-sequential reference to look up.
47+
- **task-type vs guide** — task-type is a reusable pattern for a class of tasks (e.g., "how to create a UI-kit component"). guide is instructions for a specific one-time procedure.
48+
- **cpat vs adr** — cpat focuses on a code pattern change with before/after examples. adr records a broader architectural decision with alternatives and consequences.

internal/mcp/server.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Example structures:
2222
Document types and their virtual categories:
2323
knowledge: adr (decisions), rfc (proposals), rule (standards), guide (how-tos), doc (reference), project (project overview)
2424
vision: prd (requirements), idea (concepts), plan (action plans)
25-
experience: task-type (recurring workflows), cpat (corrective/preventive actions)
25+
experience: task-type (typical task patterns), cpat (code pattern changes)
2626
2727
DOCUMENT RELATIONS:
2828
Documents can be linked with directed relations stored in the sync manifest.
@@ -53,8 +53,8 @@ WHEN TO CREATE:
5353
- Step-by-step instructions for completing a task → guide
5454
- Reference information, registries, lookup tables, or general documentation → doc
5555
- A project overview with architecture, components, and getting-started info → project
56-
- A recurring task pattern or checklist is identified → task-type
57-
- A bug or incident is root-caused and needs prevention tracking → cpat
56+
- A proven workflow for a recurring implementation task is documented → task-type
57+
- A coding pattern, convention, or approach has deliberately changed → cpat
5858
- A product concept or technical idea needs capturing → idea
5959
- An implementation plan with tasks is formed → plan
6060
- Product requirements with goals, scope, and acceptance criteria → prd

internal/mcp/tools/create_document.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ Document types and when to use each:
4343
§ required sections: Idea, Value, Possible Implementation, Risks and Constraints
4444
plan — A concrete implementation plan with defined tasks
4545
§ required sections: Goal, Tasks (phased), Acceptance Criteria, Dependencies
46-
task-type — A recurring workflow pattern or task checklist
47-
§ required sections: When to Use, Fields, Workflow, Examples
48-
cpat — A corrective/preventive action record tied to a bug or incident
49-
§ required sections: Classification, Problem, Root Cause, Action (Corrective/Preventive)
46+
task-type — A proven pattern for a typical recurring implementation task
47+
§ required sections: What, When to Use, Steps, Example, Things to Watch Out For
48+
cpat — A code pattern change: documents how and why a convention or approach changed
49+
§ required sections: What Changed, Why, Before, After, Scope
5050
5151
TYPE DISAMBIGUATION:
5252
- rule vs doc: rule prescribes behavior ("Always do X") with good/bad examples and enforcement. doc describes what exists (tables, registries, explanations). Descriptive content → doc.

internal/mcp/tools/create_document_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func TestHandleCreateDocument_AllTypes(t *testing.T) {
262262
{"guide", "knowledge", "## Steps"},
263263
{"doc", "knowledge", "## Content"},
264264
{"task-type", "experience", "## When to Use"},
265-
{"cpat", "experience", "### Classification"},
265+
{"cpat", "experience", "## What Changed"},
266266
{"prd", "vision", "### Product Vision Statement"},
267267
{"idea", "vision", "### Problem / Opportunity"},
268268
{"plan", "vision", "## Tasks"},

internal/mcp/tools/list_documents.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Use the returned paths directly as input to get_document. Do not construct paths
2626
mcp.WithStringItems(),
2727
),
2828
mcp.WithString("category",
29-
mcp.Description(`Filter by virtual category (derived from document type, not directory). Use "knowledge" for decisions/standards/guides/docs/proposals, "vision" for requirements/ideas/plans, "experience" for workflows and corrective actions.`),
29+
mcp.Description(`Filter by virtual category (derived from document type, not directory). Use "knowledge" for decisions/standards/guides/docs/proposals, "vision" for requirements/ideas/plans, "experience" for task patterns and code pattern changes.`),
3030
mcp.Enum("vision", "knowledge", "experience"),
3131
),
3232
mcp.WithString("status",

templates/templates.go

Lines changed: 38 additions & 176 deletions
Original file line numberDiff line numberDiff line change
@@ -692,211 +692,73 @@ Answer to the question.
692692
}
693693

694694
func generateTaskTypeTemplate() string {
695-
return `## Description
696-
697-
Brief description of this task type and when it should be used.
698-
699-
### Purpose
695+
return `## What
700696
701-
Why this task type exists and what problems it solves.
697+
What this typical task covers and what the end result looks like.
702698
703699
## When to Use
704700
705-
Use this task type when:
706-
707-
- Condition 1: Description
708-
- Condition 2: Description
709-
- Condition 3: Description
710-
711-
Do NOT use this task type when:
712-
713-
- Condition 1: Use [alternative] instead
714-
- Condition 2: Use [alternative] instead
715-
716-
## Fields
717-
718-
### Required Fields
719-
720-
| Field | Type | Description | Validation |
721-
|-------|------|-------------|------------|
722-
| Field 1 | Type | Description | Rules |
723-
| Field 2 | Type | Description | Rules |
724-
| Field 3 | Type | Description | Rules |
701+
Use when:
725702
726-
### Optional Fields
703+
- Condition 1
704+
- Condition 2
727705
728-
| Field | Type | Description | Default |
729-
|-------|------|-------------|---------|
730-
| Field 1 | Type | Description | Value |
731-
| Field 2 | Type | Description | Value |
706+
Do NOT use when:
732707
733-
## Workflow
734-
735-
### States
736-
737-
| State | Description | Transitions |
738-
|-------|-------------|-------------|
739-
| Open | Initial state | In Progress |
740-
| In Progress | Being worked on | Review, Blocked |
741-
| Review | Awaiting review | Done, In Progress |
742-
| Blocked | Cannot proceed | In Progress |
743-
| Done | Completed | - |
744-
745-
### State Diagram
746-
747-
1. Open → In Progress
748-
2. In Progress → Review
749-
3. Review → Done (or back to In Progress)
750-
751-
### Automation
752-
753-
- Trigger 1: Action
754-
- Trigger 2: Action
755-
756-
## Examples
708+
- Condition: use [alternative] instead
757709
758-
### Example 1: [Scenario]
759-
760-
**Title:** Example task title
761-
762-
**Description:** Example description
763-
764-
**Fields:**
765-
- Field 1: Value
766-
- Field 2: Value
767-
768-
### Example 2: [Scenario]
769-
770-
**Title:** Example task title
771-
772-
**Description:** Example description
710+
## Steps
773711
774-
## Acceptance Criteria Template
712+
1. Step one — what to do and where (@path/to/file)
713+
2. Step two — what to do next
714+
3. Step three — final checks
775715
776-
For tasks of this type, acceptance criteria should include:
716+
## Example
777717
778-
- [ ] Criterion 1
779-
- [ ] Criterion 2
780-
- [ ] Criterion 3
718+
` + "```" + `
719+
// Small code snippet or @-reference to a real implementation
720+
` + "```" + `
781721
782-
## Related Task Types
722+
## Things to Watch Out For
783723
784-
- Task Type 1: When to use instead
785-
- Task Type 2: When to use in combination
724+
- Pitfall or gotcha 1
725+
- Edge case to keep in mind
726+
- Common mistake to avoid
786727
`
787728
}
788729

789730
func generateCPATTemplate() string {
790-
return `## Overview
791-
792-
Brief description of this corrective/preventive action.
793-
794-
### Classification
795-
796-
- Type: [Corrective/Preventive/Both]
797-
- Severity: [Critical/High/Medium/Low]
798-
- Status: [Open/In Progress/Resolved/Verified]
799-
800-
## Context
731+
return `## What Changed
801732
802-
### Background
733+
The pattern, convention, or approach that changed.
803734
804-
Describe the background and context that led to this CPAT.
735+
## Why
805736
806-
### Discovery
737+
What problem the old way caused and why the change was needed.
807738
808-
How was this issue discovered?
739+
## Before
809740
810-
- Discovery method: [Audit/Incident/Review/Other]
811-
- Discovery date: YYYY-MM-DD
812-
- Discovered by: [Team/Role]
813-
814-
## Problem
815-
816-
### Problem Statement
817-
818-
Clear description of the problem or potential problem.
819-
820-
### Impact
821-
822-
What is the impact if not addressed?
823-
824-
- Impact area 1: Description
825-
- Impact area 2: Description
826-
827-
### Root Cause
828-
829-
Root cause analysis:
830-
831-
1. Primary cause: Description
832-
2. Contributing factor 1: Description
833-
3. Contributing factor 2: Description
834-
835-
### Evidence
836-
837-
Supporting evidence:
838-
839-
- Evidence 1: Description or link
840-
- Evidence 2: Description or link
841-
842-
## Action
843-
844-
### Corrective Actions
845-
846-
Immediate actions to address the problem:
847-
848-
| Action | Owner | Due Date | Status |
849-
|--------|-------|----------|--------|
850-
| Action 1 | Name | Date | Status |
851-
| Action 2 | Name | Date | Status |
852-
| Action 3 | Name | Date | Status |
853-
854-
### Preventive Actions
855-
856-
Actions to prevent recurrence:
857-
858-
| Action | Owner | Due Date | Status |
859-
|--------|-------|----------|--------|
860-
| Action 1 | Name | Date | Status |
861-
| Action 2 | Name | Date | Status |
862-
863-
### Verification
864-
865-
How will we verify the actions were effective?
866-
867-
- Verification method 1: Description
868-
- Verification method 2: Description
869-
870-
## Timeline
871-
872-
| Milestone | Target Date | Actual Date | Notes |
873-
|-----------|-------------|-------------|-------|
874-
| Identified | Date | Date | |
875-
| Analysis Complete | Date | Date | |
876-
| Actions Started | Date | Date | |
877-
| Actions Complete | Date | Date | |
878-
| Verified | Date | Date | |
741+
` + "```" + `
742+
// Old pattern
743+
` + "```" + `
879744
880-
## Stakeholders
745+
## After
881746
882-
| Role | Name | Responsibility |
883-
|------|------|----------------|
884-
| Owner | Name | Overall accountability |
885-
| Assignee | Name | Implementation |
886-
| Reviewer | Name | Verification |
747+
` + "```" + `
748+
// New pattern
749+
` + "```" + `
887750
888-
## Lessons Learned
751+
## Scope
889752
890-
Key takeaways:
753+
Affected files and modules:
891754
892-
- Lesson 1: Description
893-
- Lesson 2: Description
755+
- @path/to/affected/module
756+
- @path/to/another/file
894757
895-
## References
758+
## Notes
896759
897-
- Related incident: Link
898-
- Related documentation: Link
899-
- Similar CPATs: Link
760+
- Exceptions where the old pattern is still acceptable
761+
- Migration notes or timeline
900762
`
901763
}
902764

0 commit comments

Comments
 (0)