Synchronize trace/enhancement results to arch document. Filters design-impacting changes and updates arch.md. Triggers: sync, synchronize
Synchronizes design-impacting changes from trace logs or enhancement results into architectural documentation.
/plugin marketplace add samdae/archflow/plugin install archflow@archflow-marketplaceThis skill is limited to using the following tools:
Global Rules: Adheres to
rules/archflow-rules.md. Code Mapping#Rule: Always usemax(existing #) + 1for new rows. NEVER reuse deleted numbers. Document Version Control: After changes, commit recommended. Message:docs({serviceName}): sync - {summary}. If git unavailable, skip.
Model: Sonnet (document merging). Opus for complex conflicts.
Synchronize design-impacting items from trace.md or enhancement results to arch.md.
| Tool | Alternative |
|---|---|
| Read | Request file path from user -> ask for copy-paste |
| AskQuestion | "Please select: 1) OptionA 2) OptionB" format |
docs/{serviceName}/
├── spec.md # Reference (Requirement Drift Check) & Optional Target
├── arch.md # Sync target
└── trace.md # Input (design-impacting items)
{"title":"Architect Synchronization","questions":[{"id":"sync_type","prompt":"What content will you synchronize?","options":[{"id":"debug","label":"Bug fix - Design-impacting items from changelog"},{"id":"enhance","label":"Feature enhancement - enhance results"}]}]}
When debug selected:
{"title":"File Input","questions":[{"id":"has_changelog","prompt":"Please provide changelog file path (docs/{serviceName}/trace.md)","options":[{"id":"yes","label":"Yes - I will provide via @filepath"}]},{"id":"has_arch","prompt":"Please provide arch file path (docs/{serviceName}/arch.md)","options":[{"id":"yes","label":"Yes - I will provide via @filepath"}]}]}
When enhance selected:
"Please provide enhancement design result and existing arch.md path."
From file path: docs/alert/trace.md -> serviceName = "alert"
Filter Synced = [ ] rows from trace's Code Mapping Changes grid.
Smart Sync Logic (3-way):
for each changelog entry:
for each row in "Code Mapping Changes" where Synced == "[ ]":
1. Identify arch row using `#`
2. Extract `Spec Ref` (FR-xxx) from arch row
3. If Spec Ref exists: read requirement from spec.md, compare vs change, flag if "Requirement Drift"
4. Add to sync targets
Sync target example:
| # | Feature | File | Class | Method | Action | Change | Synced |
|---|---------|------|-------|--------|--------|--------|--------|
| 3 | Auth | auth/svc.py | AuthSvc | validate() | Add null check | MODIFY | [ ] |
| 6 | Auth | auth/svc.py | AuthSvc | refresh() | Token refresh | ADD | [ ] |
Identify from enhancement results: new APIs, modified APIs, new components, DB schema changes.
## Sync Target Analysis
### Code Mapping Changes to Apply
| # | Spec Ref | Change | Current in arch | New Value | Drift Risk |
|---|---|---|---|---|---|
| 3 | FR-001 | MODIFY | validate() - Check user | validate() - Add null check | Low |
| 6 | FR-002 | MODIFY | limit=10 | limit=100 | **HIGH (Req says 10)** |
### Summary
- Total rows to sync: {count}
- ADD: {count}, MODIFY: {count}, DELETE: {count}
Drift Risk: High = contradicts spec, Medium = changes spec values, Low = implementation detail only
{"title":"Git Commit Before Modification","questions":[{"id":"git_strategy","prompt":"Do you want to Git commit the current state before modifying arch.md?","options":[{"id":"commit","label":"Yes - Commit then proceed (recommended)"},{"id":"skip","label":"No - Proceed immediately"}]}]}
If commit: git add docs/{serviceName}/arch.md && git commit -m "backup: arch.md before sync"
| Conflict Type | Example | Resolution |
|---|---|---|
| Duplicate modification | Same endpoint in API Spec | Request user selection |
| Logical inconsistency | References deleted API | Warn and confirm with user |
| None | Adding new item | Auto-proceed |
{"title":"Sync Conflict Detected","questions":[{"id":"conflict_resolution","prompt":"Existing content conflicts with new changes.\n\nExisting: {existing}\nNew: {new}\n\nHow to proceed?","options":[{"id":"keep_old","label":"Keep existing - Ignore new changes"},{"id":"use_new","label":"Replace with new content"},{"id":"merge","label":"Merge - Reflect both"},{"id":"manual","label":"Manual handling - I will modify directly"}]}]}
If Requirement Drift detected:
{"title":"Requirement Drift Detected","questions":[{"id":"spec_update","prompt":"Some changes affect Requirements (FR-xxx).\n\nExample: {Drift Item}\n\nUpdate spec.md as well?","options":[{"id":"yes","label":"Yes - Update spec.md to match reality"},{"id":"no","label":"No - Keep spec.md as is (Implementation divergence)"}]}]}
If Yes: find FR-xxx in spec.md, update description, add note (Updated via sync on {date}).
| Change | Action in arch.md |
|---|---|
| ADD | Insert new row with same #, set Impl = [x] |
| MODIFY | Find row by #, update content, keep Impl |
| DELETE | Find row by #, remove row (gaps in # OK, no renumber needed) |
Example:
trace.md: | 3 | MODIFY | [ ] | | 6 | ADD | [ ] |
arch.md (before): rows 1-5
arch.md (after): row 3 modified, row 6 added with [x]
API Spec, DB Schema, Sequence Diagram, Risks & Tradeoffs as applicable.
## Sync History
| Date | Type | Source | Changes |
|------|------|--------|---------|
| {date} | debug | trace {date} | {summary} |
| {date} | enhance | requirements v2 | {summary} |
After arch.md update, change Synced from [ ] to [x] for all synced rows in trace.md.
# Before: | 3 | Auth | ... | MODIFY | [ ] |
# After: | 3 | Auth | ... | MODIFY | [x] |
## Architect Synchronization Complete
### Sync Summary
| Item | Content |
|------|---------|
| Type | debug / enhance |
| Source | {changelog date or requirements} |
| Code Mapping Changes | ADD: {n}, MODIFY: {n}, DELETE: {n} |
### Change History
| # | Change Type | Before | After |
|---|------------|--------|-------|
| {#} | ADD/MODIFY/DELETE | {before} | {after} |
### Files
- Updated: `docs/{serviceName}/arch-be.md` or `arch-fe.md`
- Updated: `docs/{serviceName}/trace.md` (Synced status)
### Next Steps
- If implementation needed: Run `/build`
- If spec updated: Review `docs/{serviceName}/spec.md`
[debug] -> trace.md (Code Mapping Changes, Synced=[ ])
-> [sync] -> Filter Synced=[ ] rows
-> Update arch.md (ADD/MODIFY/DELETE)
-> Update trace.md (Synced [ ] -> [x])
-> [build] (if needed)
[enhance] -> enhancement design -> [sync] -> Update arch -> [build]
(Smart Sync) -> spec.md (update if drift)
Synced = [ ] rows - [x] are skipped; empty grid = nothing to sync# column is the key - MODIFY/DELETE use # to find target row; ADD inserts with # from trace; keep consistent between trace and arch[x] to prevent duplicate syncingActivates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.