synarcx 0.2.1 → 0.3.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 +23 -23
- package/dist/core/shared/skill-generation.js +3 -3
- package/dist/core/shared/workflow-registry.d.ts +3 -3
- package/dist/core/shared/workflow-registry.js +1 -1
- package/dist/core/templates/skill-templates.d.ts +1 -0
- package/dist/core/templates/skill-templates.js +1 -0
- package/dist/core/templates/workflows/apply-change.js +6 -6
- package/dist/core/templates/workflows/clarify.js +28 -6
- package/dist/core/templates/workflows/review.d.ts +4 -0
- package/dist/core/templates/workflows/review.js +293 -0
- package/dist/core/templates/workflows/sync.js +79 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ SynArcX makes your engineering decisions durable. The `constitution.md` is alway
|
|
|
28
28
|
|
|
29
29
|
## Why Not Just Use Another Spec Format?
|
|
30
30
|
|
|
31
|
-
Spec formats describe *what* to build.
|
|
31
|
+
Spec formats describe *what* to build.
|
|
32
32
|
|
|
33
33
|
SynArcX structures *how you get there* from exploration to proposal to implementation, and helps keep AI-generated changes aligned with the evolving codebase at every stage, not just at planning time.
|
|
34
34
|
|
|
@@ -90,10 +90,9 @@ Then in your AI coding tool:
|
|
|
90
90
|
1. `/syn:sync` — scan the project and generate the `constitution.md` (persistent project memory)
|
|
91
91
|
2. `/syn:explore "your idea"` — think through the problem with your AI
|
|
92
92
|
3. `/syn:propose "my-feature"` — create proposal, specs, design, and tasks in one step
|
|
93
|
-
4. `/syn:clarify` — sharpen artifacts with targeted questions
|
|
94
|
-
5. `/syn:
|
|
95
|
-
6. `/syn:
|
|
96
|
-
7. `/syn:archive` — archive when done
|
|
93
|
+
4. `/syn:clarify` — sharpen artifacts with targeted questions + auto consistency check
|
|
94
|
+
5. `/syn:apply` — implement the tasks
|
|
95
|
+
6. `/syn:review` — verify implementation, run sanity checks, and archive when clean
|
|
97
96
|
|
|
98
97
|
For specific cases, use these instead of `/syn:explore`:
|
|
99
98
|
|
|
@@ -118,7 +117,7 @@ Session 1 ──► Session 2 ──► Session 3 ──► Session N
|
|
|
118
117
|
```
|
|
119
118
|
Session 1 ──► constitution.md ──► Session 2 ──► constitution.md ──► Session N
|
|
120
119
|
✓ correct (updated) ✓ correct (updated) ✓ correct
|
|
121
|
-
|
|
120
|
+
|
|
122
121
|
specs · architecture · intent preserved across every reset
|
|
123
122
|
```
|
|
124
123
|
|
|
@@ -127,14 +126,15 @@ Session 1 ──► constitution.md ──► Session 2 ──► constitu
|
|
|
127
126
|
**The workflow:**
|
|
128
127
|
|
|
129
128
|
```
|
|
130
|
-
sync
|
|
129
|
+
sync ─────────────────────────────────────► constitution
|
|
131
130
|
|
|
132
131
|
explore ──┐
|
|
133
132
|
debug ──┤
|
|
134
|
-
├──► propose ──► clarify ──►
|
|
133
|
+
├──► propose ──► clarify ──► apply ──► review
|
|
134
|
+
│ └── (auto-analyze) ──┘
|
|
135
135
|
refactor ──┘
|
|
136
136
|
|
|
137
|
-
quick
|
|
137
|
+
quick ───────────────────────────────────────────► apply
|
|
138
138
|
```
|
|
139
139
|
|
|
140
140
|
Each step suggests the next — you decide when to advance. Works in Claude Code, Cursor, Cline, and any AI coding tool that supports slash commands.
|
|
@@ -191,25 +191,25 @@ Used inside your AI coding tool (Claude Code, Cursor, Cline, etc.):
|
|
|
191
191
|
| `/syn:refactor` | Map current vs target structure, then prompts `/syn:propose` |
|
|
192
192
|
| `/syn:quick` | Fast-path for small low-risk changes — inline preview, confirm, apply |
|
|
193
193
|
| `/syn:propose` | Create a new change with proposal, specs, design, and tasks |
|
|
194
|
-
| `/syn:clarify` |
|
|
195
|
-
| `/syn:analyze` |
|
|
194
|
+
| `/syn:clarify` | Targeted Q&A (adaptive limit) + auto consistency checks in one command |
|
|
195
|
+
| `/syn:analyze` | Standalone cross-artifact consistency check (auto-run by clarify) |
|
|
196
196
|
| `/syn:apply` | Implement tasks from a change's task list |
|
|
197
|
-
| `/syn:
|
|
197
|
+
| `/syn:review` | Verify implementation, run sanity checks, and archive when clean |
|
|
198
198
|
|
|
199
199
|
### CLI Commands
|
|
200
200
|
|
|
201
201
|
Used in your terminal:
|
|
202
202
|
|
|
203
|
-
| Command | Description
|
|
204
|
-
| ------------------- |
|
|
205
|
-
| `synarcx init` | Set up SynArcX workflow structure in your repository
|
|
206
|
-
| `synarcx sync` | Regenerate `constitution.md`
|
|
207
|
-
| `synarcx explore` | Open explore session
|
|
208
|
-
| `synarcx propose` | Create a structured change proposal
|
|
209
|
-
| `synarcx clarify` |
|
|
210
|
-
| `synarcx analyze` |
|
|
211
|
-
| `synarcx apply` | Execute implementation tasks
|
|
212
|
-
| `synarcx quick` | Fast-path execution for small changes
|
|
203
|
+
| Command | Description |
|
|
204
|
+
| ------------------- | ------------------------------------------------------- |
|
|
205
|
+
| `synarcx init` | Set up SynArcX workflow structure in your repository |
|
|
206
|
+
| `synarcx sync` | Regenerate `constitution.md` |
|
|
207
|
+
| `synarcx explore` | Open explore session |
|
|
208
|
+
| `synarcx propose` | Create a structured change proposal |
|
|
209
|
+
| `synarcx clarify` | Targeted Q&A (adaptive limit) + auto consistency checks |
|
|
210
|
+
| `synarcx analyze` | Cross-artifact consistency check (standalone) |
|
|
211
|
+
| `synarcx apply` | Execute implementation tasks |
|
|
212
|
+
| `synarcx quick` | Fast-path execution for small changes |
|
|
213
213
|
|
|
214
214
|
---
|
|
215
215
|
|
|
@@ -264,7 +264,7 @@ SynArcX is evolving toward an architecture-aware workflow system for long-runnin
|
|
|
264
264
|
|
|
265
265
|
## Status
|
|
266
266
|
|
|
267
|
-
**v0.
|
|
267
|
+
**v0.3.x** — clarify+analyze merged, adaptive Q&A limit, quick command added
|
|
268
268
|
|
|
269
269
|
Active development roadmap:
|
|
270
270
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Shared utilities for generating skill and command files.
|
|
5
5
|
*/
|
|
6
|
-
import { getSynExploreSkillTemplate, getSynApplySkillTemplate,
|
|
6
|
+
import { getSynExploreSkillTemplate, getSynApplySkillTemplate, getSynProposeSkillTemplate, getSynSyncSkillTemplate, getSynClarifySkillTemplate, getSynAnalyzeSkillTemplate, getSynDebugSkillTemplate, getSynRefactorSkillTemplate, getSynQuickSkillTemplate, getSynReviewSkillTemplate, getSynExploreCommandTemplate, getSynApplyCommandTemplate, getSynProposeCommandTemplate, getSynSyncCommandTemplate, getSynClarifyCommandTemplate, getSynAnalyzeCommandTemplate, getSynDebugCommandTemplate, getSynRefactorCommandTemplate, getSynQuickCommandTemplate, getSynReviewCommandTemplate, } from '../templates/skill-templates.js';
|
|
7
7
|
/**
|
|
8
8
|
* Gets skill templates with their directory names, optionally filtered by workflow IDs.
|
|
9
9
|
*
|
|
@@ -13,7 +13,6 @@ export function getSkillTemplates(workflowFilter) {
|
|
|
13
13
|
const all = [
|
|
14
14
|
{ template: getSynExploreSkillTemplate(), dirName: 'syn-explore', workflowId: 'explore' },
|
|
15
15
|
{ template: getSynApplySkillTemplate(), dirName: 'syn-apply', workflowId: 'apply' },
|
|
16
|
-
{ template: getSynArchiveSkillTemplate(), dirName: 'syn-archive', workflowId: 'archive' },
|
|
17
16
|
{ template: getSynProposeSkillTemplate(), dirName: 'syn-propose', workflowId: 'propose' },
|
|
18
17
|
{ template: getSynSyncSkillTemplate(), dirName: 'syn-sync', workflowId: 'sync' },
|
|
19
18
|
{ template: getSynClarifySkillTemplate(), dirName: 'syn-clarify', workflowId: 'clarify' },
|
|
@@ -21,6 +20,7 @@ export function getSkillTemplates(workflowFilter) {
|
|
|
21
20
|
{ template: getSynDebugSkillTemplate(), dirName: 'syn-debug', workflowId: 'debug' },
|
|
22
21
|
{ template: getSynRefactorSkillTemplate(), dirName: 'syn-refactor', workflowId: 'refactor' },
|
|
23
22
|
{ template: getSynQuickSkillTemplate(), dirName: 'syn-quick', workflowId: 'quick' },
|
|
23
|
+
{ template: getSynReviewSkillTemplate(), dirName: 'syn-review', workflowId: 'review' },
|
|
24
24
|
];
|
|
25
25
|
if (!workflowFilter)
|
|
26
26
|
return all;
|
|
@@ -36,7 +36,6 @@ export function getCommandTemplates(workflowFilter) {
|
|
|
36
36
|
const all = [
|
|
37
37
|
{ template: getSynExploreCommandTemplate(), id: 'explore' },
|
|
38
38
|
{ template: getSynApplyCommandTemplate(), id: 'apply' },
|
|
39
|
-
{ template: getSynArchiveCommandTemplate(), id: 'archive' },
|
|
40
39
|
{ template: getSynProposeCommandTemplate(), id: 'propose' },
|
|
41
40
|
{ template: getSynSyncCommandTemplate(), id: 'sync' },
|
|
42
41
|
{ template: getSynClarifyCommandTemplate(), id: 'clarify' },
|
|
@@ -44,6 +43,7 @@ export function getCommandTemplates(workflowFilter) {
|
|
|
44
43
|
{ template: getSynDebugCommandTemplate(), id: 'debug' },
|
|
45
44
|
{ template: getSynRefactorCommandTemplate(), id: 'refactor' },
|
|
46
45
|
{ template: getSynQuickCommandTemplate(), id: 'quick' },
|
|
46
|
+
{ template: getSynReviewCommandTemplate(), id: 'review' },
|
|
47
47
|
];
|
|
48
48
|
if (!workflowFilter)
|
|
49
49
|
return all;
|
|
@@ -5,9 +5,6 @@ export declare const WORKFLOWS: readonly [{
|
|
|
5
5
|
}, {
|
|
6
6
|
readonly id: "apply";
|
|
7
7
|
readonly skillDir: "syn-apply";
|
|
8
|
-
}, {
|
|
9
|
-
readonly id: "archive";
|
|
10
|
-
readonly skillDir: "syn-archive";
|
|
11
8
|
}, {
|
|
12
9
|
readonly id: "propose";
|
|
13
10
|
readonly skillDir: "syn-propose";
|
|
@@ -29,6 +26,9 @@ export declare const WORKFLOWS: readonly [{
|
|
|
29
26
|
}, {
|
|
30
27
|
readonly id: "quick";
|
|
31
28
|
readonly skillDir: "syn-quick";
|
|
29
|
+
}, {
|
|
30
|
+
readonly id: "review";
|
|
31
|
+
readonly skillDir: "syn-review";
|
|
32
32
|
}];
|
|
33
33
|
export declare const ALL_WORKFLOWS: readonly string[];
|
|
34
34
|
export declare const CORE_WORKFLOWS: readonly string[];
|
|
@@ -2,7 +2,6 @@ export const DEFAULT_SCHEMA = 'synarcx';
|
|
|
2
2
|
export const WORKFLOWS = [
|
|
3
3
|
{ id: 'explore', skillDir: 'syn-explore' },
|
|
4
4
|
{ id: 'apply', skillDir: 'syn-apply' },
|
|
5
|
-
{ id: 'archive', skillDir: 'syn-archive' },
|
|
6
5
|
{ id: 'propose', skillDir: 'syn-propose' },
|
|
7
6
|
{ id: 'sync', skillDir: 'syn-sync' },
|
|
8
7
|
{ id: 'clarify', skillDir: 'syn-clarify' },
|
|
@@ -10,6 +9,7 @@ export const WORKFLOWS = [
|
|
|
10
9
|
{ id: 'debug', skillDir: 'syn-debug' },
|
|
11
10
|
{ id: 'refactor', skillDir: 'syn-refactor' },
|
|
12
11
|
{ id: 'quick', skillDir: 'syn-quick' },
|
|
12
|
+
{ id: 'review', skillDir: 'syn-review' },
|
|
13
13
|
];
|
|
14
14
|
export const ALL_WORKFLOWS = WORKFLOWS.map(w => w.id);
|
|
15
15
|
export const CORE_WORKFLOWS = [...ALL_WORKFLOWS];
|
|
@@ -14,4 +14,5 @@ export { getSynAnalyzeSkillTemplate, getSynAnalyzeCommandTemplate } from './work
|
|
|
14
14
|
export { getSynDebugSkillTemplate, getSynDebugCommandTemplate } from './workflows/debug.js';
|
|
15
15
|
export { getSynRefactorSkillTemplate, getSynRefactorCommandTemplate } from './workflows/refactor.js';
|
|
16
16
|
export { getSynQuickSkillTemplate, getSynQuickCommandTemplate } from './workflows/quick.js';
|
|
17
|
+
export { getSynReviewSkillTemplate, getSynReviewCommandTemplate } from './workflows/review.js';
|
|
17
18
|
//# sourceMappingURL=skill-templates.d.ts.map
|
|
@@ -13,4 +13,5 @@ export { getSynAnalyzeSkillTemplate, getSynAnalyzeCommandTemplate } from './work
|
|
|
13
13
|
export { getSynDebugSkillTemplate, getSynDebugCommandTemplate } from './workflows/debug.js';
|
|
14
14
|
export { getSynRefactorSkillTemplate, getSynRefactorCommandTemplate } from './workflows/refactor.js';
|
|
15
15
|
export { getSynQuickSkillTemplate, getSynQuickCommandTemplate } from './workflows/quick.js';
|
|
16
|
+
export { getSynReviewSkillTemplate, getSynReviewCommandTemplate } from './workflows/review.js';
|
|
16
17
|
//# sourceMappingURL=skill-templates.js.map
|
|
@@ -40,7 +40,7 @@ export function getSynApplySkillTemplate() {
|
|
|
40
40
|
|
|
41
41
|
**Handle states:**
|
|
42
42
|
- If \`state: "blocked"\` (missing artifacts): show message, suggest using syn:apply
|
|
43
|
-
- If \`state: "all_done"\`: congratulate, suggest
|
|
43
|
+
- If \`state: "all_done"\`: congratulate, suggest \`/syn:review\`
|
|
44
44
|
- Otherwise: proceed to implementation
|
|
45
45
|
|
|
46
46
|
4. **Read context files**
|
|
@@ -78,7 +78,7 @@ export function getSynApplySkillTemplate() {
|
|
|
78
78
|
Display:
|
|
79
79
|
- Tasks completed this session
|
|
80
80
|
- Overall progress: "N/M tasks complete"
|
|
81
|
-
- If all done: suggest
|
|
81
|
+
- If all done: suggest \`/syn:review\`
|
|
82
82
|
- If paused: explain why and wait for guidance
|
|
83
83
|
|
|
84
84
|
**Output During Implementation**
|
|
@@ -109,7 +109,7 @@ Working on task 4/7: <task description>
|
|
|
109
109
|
- [x] Task 2
|
|
110
110
|
...
|
|
111
111
|
|
|
112
|
-
All tasks complete!
|
|
112
|
+
All tasks complete! Run \`/syn:review\` to verify the implementation.
|
|
113
113
|
\`\`\`
|
|
114
114
|
|
|
115
115
|
**Output On Pause (Issue Encountered)**
|
|
@@ -195,7 +195,7 @@ export function getSynApplyCommandTemplate() {
|
|
|
195
195
|
|
|
196
196
|
**Handle states:**
|
|
197
197
|
- If \`state: "blocked"\` (missing artifacts): show message, suggest using \`/syn:apply\`
|
|
198
|
-
- If \`state: "all_done"\`: congratulate, suggest
|
|
198
|
+
- If \`state: "all_done"\`: congratulate, suggest \`/syn:review\`
|
|
199
199
|
- Otherwise: proceed to implementation
|
|
200
200
|
|
|
201
201
|
4. **Read context files**
|
|
@@ -233,7 +233,7 @@ export function getSynApplyCommandTemplate() {
|
|
|
233
233
|
Display:
|
|
234
234
|
- Tasks completed this session
|
|
235
235
|
- Overall progress: "N/M tasks complete"
|
|
236
|
-
- If all done: suggest
|
|
236
|
+
- If all done: suggest \`/syn:review\`
|
|
237
237
|
- If paused: explain why and wait for guidance
|
|
238
238
|
|
|
239
239
|
**Output During Implementation**
|
|
@@ -264,7 +264,7 @@ Working on task 4/7: <task description>
|
|
|
264
264
|
- [x] Task 2
|
|
265
265
|
...
|
|
266
266
|
|
|
267
|
-
All tasks complete!
|
|
267
|
+
All tasks complete! Run \`/syn:review\` to verify the implementation.
|
|
268
268
|
\`\`\`
|
|
269
269
|
|
|
270
270
|
**Output On Pause (Issue Encountered)**
|
|
@@ -19,7 +19,7 @@ export function getSynClarifySkillTemplate() {
|
|
|
19
19
|
- \`synspec/changes/<name>/specs/**/*.md\` (if exist)
|
|
20
20
|
- \`synspec/changes/<name>/design.md\`
|
|
21
21
|
|
|
22
|
-
3. **Generate
|
|
22
|
+
3. **Generate targeted questions (5 default, extendable for critical unknowns)**
|
|
23
23
|
Focus on areas that are:
|
|
24
24
|
- Ambiguous or underspecified
|
|
25
25
|
- Missing edge cases
|
|
@@ -34,15 +34,25 @@ export function getSynClarifySkillTemplate() {
|
|
|
34
34
|
- **Implementation**: Dependencies? Migration path?
|
|
35
35
|
- **Testing**: How to verify?
|
|
36
36
|
|
|
37
|
+
"Critical" = a hole or contradiction that would produce broken or incorrect code if left unaddressed. Not "nice to know" or stylistic preferences.
|
|
38
|
+
|
|
37
39
|
4. **Ask questions interactively**
|
|
38
40
|
Use the **AskUserQuestion tool** (open-ended) to present each question.
|
|
39
41
|
Present questions one at a time. Wait for each answer before moving to the next.
|
|
40
|
-
|
|
42
|
+
Default maximum: 5 questions. If one or more critical unknowns remain after 5, present each remaining critical question with context and ask the user to confirm before continuing.
|
|
41
43
|
|
|
42
44
|
5. **Encode answers back into artifacts**
|
|
43
45
|
- Edit the relevant artifact in place (proposal.md, design.md, or specs)
|
|
44
46
|
- Do NOT create new files
|
|
45
47
|
- Show what was changed and why
|
|
48
|
+
- Note: tasks.md will be read during the auto-analyze step that follows
|
|
49
|
+
|
|
50
|
+
6. **Auto-analyze: cross-artifact consistency checks**
|
|
51
|
+
- Read all artifacts including tasks.md
|
|
52
|
+
- Run 5 checks: terminology, scope, completeness, conflicts, traceability
|
|
53
|
+
- Fix up to 5 inconsistencies in place
|
|
54
|
+
- If a fix would contradict a Q&A answer, skip it (user answer wins)
|
|
55
|
+
- If zero issues found, report each check as "OK"
|
|
46
56
|
|
|
47
57
|
---
|
|
48
58
|
|
|
@@ -51,7 +61,8 @@ export function getSynClarifySkillTemplate() {
|
|
|
51
61
|
After completing, summarize:
|
|
52
62
|
- What was clarified
|
|
53
63
|
- Which artifacts were updated
|
|
54
|
-
-
|
|
64
|
+
- Consistency check results (each of 5 checks: OK or fix applied)
|
|
65
|
+
- Next step: Run \`/syn:apply\` to start implementation`,
|
|
55
66
|
license: 'MIT',
|
|
56
67
|
compatibility: 'Requires synarcx CLI.',
|
|
57
68
|
metadata: { author: 'synarcx', version: '0.1' },
|
|
@@ -78,7 +89,7 @@ export function getSynClarifyCommandTemplate() {
|
|
|
78
89
|
- \`synspec/changes/<name>/specs/**/*.md\` (if exist)
|
|
79
90
|
- \`synspec/changes/<name>/design.md\`
|
|
80
91
|
|
|
81
|
-
3. **Generate
|
|
92
|
+
3. **Generate targeted questions (5 default, extendable for critical unknowns)**
|
|
82
93
|
Focus on areas that are:
|
|
83
94
|
- Ambiguous or underspecified
|
|
84
95
|
- Missing edge cases
|
|
@@ -86,14 +97,24 @@ export function getSynClarifyCommandTemplate() {
|
|
|
86
97
|
- Unstated assumptions
|
|
87
98
|
- Missing acceptance criteria
|
|
88
99
|
|
|
100
|
+
"Critical" = a hole or contradiction that would produce broken or incorrect code if left unaddressed. Not "nice to know" or stylistic preferences.
|
|
101
|
+
|
|
89
102
|
4. **Ask questions interactively**
|
|
90
103
|
Present questions one at a time. Wait for each answer before moving to the next.
|
|
91
|
-
|
|
104
|
+
Default maximum: 5 questions. If one or more critical unknowns remain after 5, present each remaining critical question with context and ask the user to confirm before continuing.
|
|
92
105
|
|
|
93
106
|
5. **Encode answers back into artifacts**
|
|
94
107
|
- Edit the relevant artifact in place (proposal.md, design.md, or specs)
|
|
95
108
|
- Do NOT create new files
|
|
96
109
|
- Show what was changed and why
|
|
110
|
+
- Note: tasks.md will be read during the auto-analyze step that follows
|
|
111
|
+
|
|
112
|
+
6. **Auto-analyze: cross-artifact consistency checks**
|
|
113
|
+
- Read all artifacts including tasks.md
|
|
114
|
+
- Run 5 checks: terminology, scope, completeness, conflicts, traceability
|
|
115
|
+
- Fix up to 5 inconsistencies in place
|
|
116
|
+
- If a fix would contradict a Q&A answer, skip it (user answer wins)
|
|
117
|
+
- If zero issues found, report each check as "OK"
|
|
97
118
|
|
|
98
119
|
---
|
|
99
120
|
|
|
@@ -102,7 +123,8 @@ export function getSynClarifyCommandTemplate() {
|
|
|
102
123
|
After completing, summarize:
|
|
103
124
|
- What was clarified
|
|
104
125
|
- Which artifacts were updated
|
|
105
|
-
-
|
|
126
|
+
- Consistency check results (each of 5 checks: OK or fix applied)
|
|
127
|
+
- Next step: Run \`/syn:apply\` to start implementation`
|
|
106
128
|
});
|
|
107
129
|
}
|
|
108
130
|
//# sourceMappingURL=clarify.js.map
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { commandFromSkill } from '../types.js';
|
|
2
|
+
export function getSynReviewSkillTemplate() {
|
|
3
|
+
return {
|
|
4
|
+
name: 'syn-review',
|
|
5
|
+
description: 'Quality gate that verifies implementation, runs sanity checks (test/lint/typecheck), and presents a three-way decision: archive, add more work, or start a new change.',
|
|
6
|
+
instructions: `Review a completed change — verify implementation, run sanity checks, and decide next steps.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
1. **Select the change**
|
|
13
|
+
|
|
14
|
+
If a name is provided, use it. Otherwise:
|
|
15
|
+
- Infer from conversation context if the user mentioned a change
|
|
16
|
+
- Auto-select if only one active change exists
|
|
17
|
+
- If ambiguous, run \`synarcx list --json\` to get available changes and use the **AskUserQuestion tool** to let the user select
|
|
18
|
+
|
|
19
|
+
Always announce: "Reviewing change: <name>" and how to override (e.g., \`/syn:review <other>\`).
|
|
20
|
+
|
|
21
|
+
2. **Check status**
|
|
22
|
+
|
|
23
|
+
\`\`\`bash
|
|
24
|
+
synarcx status --change "<name>" --json
|
|
25
|
+
\`\`\`
|
|
26
|
+
|
|
27
|
+
Parse the JSON to get \`schemaName\` and \`artifacts\` status.
|
|
28
|
+
|
|
29
|
+
**Verify artifact completion**: If all apply-required artifacts are not done, stop and tell the user to use \`/syn:propose\` or \`/syn:apply\` first.
|
|
30
|
+
|
|
31
|
+
3. **Gate on task completion**
|
|
32
|
+
|
|
33
|
+
Read \`tasks.md\` and count checkboxes. If any tasks remain unchecked:
|
|
34
|
+
- Show progress: "N/M tasks complete"
|
|
35
|
+
- Do NOT run any checks
|
|
36
|
+
- Suggest: "/syn:apply to finish the remaining tasks, then run /syn:review again"
|
|
37
|
+
- Stop here
|
|
38
|
+
|
|
39
|
+
4. **Collect change state**
|
|
40
|
+
|
|
41
|
+
- \`git diff --stat\` to get files changed, additions, deletions
|
|
42
|
+
- Read \`tasks.md\` for complete/incomplete counts
|
|
43
|
+
|
|
44
|
+
5. **Discover and run sanity checks**
|
|
45
|
+
|
|
46
|
+
Probe the project for check commands. Discovery order:
|
|
47
|
+
1. Check \`package.json\` scripts for \`test\`, \`lint\`, \`typecheck\`
|
|
48
|
+
2. If \`Cargo.toml\` exists, check for \`cargo test\`
|
|
49
|
+
3. If no check commands found, skip with a note
|
|
50
|
+
|
|
51
|
+
For each discovered command, run it and capture:
|
|
52
|
+
- **Pass**: note the pass count
|
|
53
|
+
- **Fail**: capture error details, route to \`/syn:apply\`
|
|
54
|
+
- **Crash/error**: note "command crashed" with error message, do NOT block the fork
|
|
55
|
+
|
|
56
|
+
**Important**: For any failed check, capture only summary counts (pass/fail), not full logs — unless user asks for details.
|
|
57
|
+
|
|
58
|
+
6. **Build the output**
|
|
59
|
+
|
|
60
|
+
**Structured summary first** (scanable at a glance):
|
|
61
|
+
|
|
62
|
+
\`\`\`
|
|
63
|
+
Tasks: N/M ✓
|
|
64
|
+
Files: N changed (+A -D)
|
|
65
|
+
Tests: N/N passed ✓ (or "N failed" or "ERR — command crashed" or "skipped")
|
|
66
|
+
Lint: 0 errors ✓ (or "N errors" or "ERR — command crashed" or "skipped")
|
|
67
|
+
Typecheck: clean ✓ (or "N errors" or "ERR — command crashed" or "skipped")
|
|
68
|
+
\`\`\`
|
|
69
|
+
|
|
70
|
+
**Then a narrative paragraph** (context):
|
|
71
|
+
|
|
72
|
+
"Change <name> completed N of N tasks across N files (+A -D). All N tests pass, lint is clean, type checking passes. No issues detected."
|
|
73
|
+
|
|
74
|
+
Or for failures: "Change <name> completed N of N tasks. N tests failed, lint found N errors. Review the findings below."
|
|
75
|
+
|
|
76
|
+
7. **Present the fork**
|
|
77
|
+
|
|
78
|
+
**If ALL checks pass** (clean):
|
|
79
|
+
|
|
80
|
+
Present three options:
|
|
81
|
+
|
|
82
|
+
| Option | Label | What happens | Next |
|
|
83
|
+
|---|---|---|---|
|
|
84
|
+
| A | Archive now | AI moves change to archive/ | Done |
|
|
85
|
+
| B | Add more work | AI appends new tasks, suggests refinement loop | /syn:clarify → /syn:analyze → /syn:apply |
|
|
86
|
+
| C | Start a new change | AI suggests creating a fresh change | /syn:propose |
|
|
87
|
+
|
|
88
|
+
**For option B (add more work)**: Ask the user what else is needed. If the new work fits within the existing change's scope (same capabilities, same specs, related code), append unchecked tasks to \`tasks.md\` and say: "Run /syn:clarify to refine the new requirements, then /syn:analyze, then /syn:apply." If the new work involves different capabilities, different specs, or unrelated code, tell the user: "This is outside this change's scope. Start a new change with /syn:propose instead."
|
|
89
|
+
|
|
90
|
+
**If any checks failed** (dirty):
|
|
91
|
+
|
|
92
|
+
Show each finding with context and route to the correct command:
|
|
93
|
+
|
|
94
|
+
| Finding | Route |
|
|
95
|
+
|---|---|
|
|
96
|
+
| Test failures | /syn:apply — fix implementation |
|
|
97
|
+
| Lint errors | /syn:apply — fix implementation |
|
|
98
|
+
| Artifact inconsistency | /syn:analyze — reconcile |
|
|
99
|
+
| Unclear requirement | /syn:clarify — refine |
|
|
100
|
+
| Incomplete artifacts | /syn:analyze — complete artifacts |
|
|
101
|
+
|
|
102
|
+
List ALL findings in a single output. Let the user decide which to address first.
|
|
103
|
+
|
|
104
|
+
**Note**: /syn:quick bypasses review entirely. Quick is the low-risk fast path.
|
|
105
|
+
|
|
106
|
+
8. **Archive inline** (when user picks option A)
|
|
107
|
+
|
|
108
|
+
- Create \`synspec/changes/archive/\` if it doesn't exist
|
|
109
|
+
- Target name: \`YYYY-MM-DD-<change-name>\`
|
|
110
|
+
- If target already exists: fail with error, suggest renaming existing archive or using a different approach
|
|
111
|
+
- Move: \`mv synspec/changes/<name> synspec/changes/archive/YYYY-MM-DD-<name>\`
|
|
112
|
+
- Confirm: "Archived <change-name> to synspec/changes/archive/YYYY-MM-DD-<name>/"
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Output (Clean)
|
|
117
|
+
|
|
118
|
+
\`\`\`
|
|
119
|
+
Tasks: 7/7 ✓
|
|
120
|
+
Files: 5 changed (+124 -12)
|
|
121
|
+
Tests: 42/42 passed ✓
|
|
122
|
+
Lint: 0 errors ✓
|
|
123
|
+
Typecheck: clean ✓
|
|
124
|
+
|
|
125
|
+
Change add-user-auth completed 7 of 7 tasks across 5 files (+124 -12). All 42 tests pass, lint is clean, type checking passes. No issues detected.
|
|
126
|
+
|
|
127
|
+
This change is clean. What would you like to do?
|
|
128
|
+
[A] Archive now [B] Add more work [C] Start a new change
|
|
129
|
+
\`\`\`
|
|
130
|
+
|
|
131
|
+
## Output (Dirty)
|
|
132
|
+
|
|
133
|
+
\`\`\`
|
|
134
|
+
Tasks: 7/7 ✓
|
|
135
|
+
Files: 5 changed (+124 -12)
|
|
136
|
+
Tests: 38/42 passed ⚠ 4 failing
|
|
137
|
+
Lint: 3 errors ⚠
|
|
138
|
+
Typecheck: clean ✓
|
|
139
|
+
|
|
140
|
+
Change add-user-auth completed 7 of 7 tasks. 4 tests failing in auth.test.ts, lint found 3 style issues. Type checking passes.
|
|
141
|
+
|
|
142
|
+
Findings:
|
|
143
|
+
╳ 4 tests failing in auth.test.ts
|
|
144
|
+
→ Try /syn:apply to fix the implementation
|
|
145
|
+
|
|
146
|
+
╳ 3 lint errors in src/auth.ts
|
|
147
|
+
→ Try /syn:apply to fix the implementation
|
|
148
|
+
\`\`\`
|
|
149
|
+
|
|
150
|
+
## Output (Tasks Incomplete — Gate)
|
|
151
|
+
|
|
152
|
+
\`\`\`
|
|
153
|
+
Tasks: 4/7 tasks complete
|
|
154
|
+
|
|
155
|
+
This change still has 3 tasks remaining.
|
|
156
|
+
→ Use /syn:apply to finish the remaining tasks, then run /syn:review again.
|
|
157
|
+
\`\`\`
|
|
158
|
+
|
|
159
|
+
## Output (Archived)
|
|
160
|
+
|
|
161
|
+
\`\`\`
|
|
162
|
+
## Archive Complete
|
|
163
|
+
|
|
164
|
+
**Change:** <change-name>
|
|
165
|
+
**Archived to:** synspec/changes/archive/YYYY-MM-DD-<name>/
|
|
166
|
+
|
|
167
|
+
All tasks complete. All checks passed. Change archived.
|
|
168
|
+
\`\`\`
|
|
169
|
+
|
|
170
|
+
## Guardrails
|
|
171
|
+
- Do NOT run checks if tasks are incomplete — gate at step 3
|
|
172
|
+
- Checks are read-only — do not modify project files during checks
|
|
173
|
+
- Archive move is the only write operation (step 8)
|
|
174
|
+
- Always list ALL findings at once, don't ask "fix one at a time"
|
|
175
|
+
- For failed checks, show only summary counts unless user asks for details
|
|
176
|
+
- If user picks "add more work," evaluate scope before appending tasks
|
|
177
|
+
- Quick bypasses review — do not suggest review to users who used /syn:quick`,
|
|
178
|
+
license: 'MIT',
|
|
179
|
+
compatibility: 'Requires synarcx CLI.',
|
|
180
|
+
metadata: { author: 'synarcx', version: '1.0' },
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
export function getSynReviewCommandTemplate() {
|
|
184
|
+
return commandFromSkill(getSynReviewSkillTemplate(), {
|
|
185
|
+
name: 'syn:review',
|
|
186
|
+
description: 'Review a completed change — verify implementation, run sanity checks, and decide next steps',
|
|
187
|
+
tags: ['workflow', 'review'],
|
|
188
|
+
content: `Review a completed change — verify implementation, run sanity checks, and decide next steps.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Steps
|
|
193
|
+
|
|
194
|
+
1. **Select the change**
|
|
195
|
+
|
|
196
|
+
If a name is provided (e.g., \`/syn:review add-auth\`), use it. Otherwise:
|
|
197
|
+
- Infer from conversation context
|
|
198
|
+
- Auto-select if only one active change exists
|
|
199
|
+
- If ambiguous, run \`synarcx list --json\` and prompt
|
|
200
|
+
|
|
201
|
+
2. **Check status**
|
|
202
|
+
|
|
203
|
+
\`\`\`bash
|
|
204
|
+
synarcx status --change "<name>" --json
|
|
205
|
+
\`\`\`
|
|
206
|
+
|
|
207
|
+
Verify all apply-required artifacts are done. If not, stop.
|
|
208
|
+
|
|
209
|
+
3. **Gate on task completion**
|
|
210
|
+
|
|
211
|
+
Read \`tasks.md\`. If any tasks remain unchecked:
|
|
212
|
+
- Show "N/M tasks complete"
|
|
213
|
+
- Suggest \`/syn:apply\` to finish
|
|
214
|
+
- Stop
|
|
215
|
+
|
|
216
|
+
4. **Collect change state**
|
|
217
|
+
- \`git diff --stat\` for file summary
|
|
218
|
+
- Read tasks.md for progress
|
|
219
|
+
|
|
220
|
+
5. **Discover and run sanity checks**
|
|
221
|
+
|
|
222
|
+
Probe \`package.json\` scripts for \`test\`, \`lint\`, \`typecheck\`. Fall back to known tools (cargo test, ruff, etc.). Omit if none found.
|
|
223
|
+
|
|
224
|
+
For each command: capture pass/fail/crash. Summary only, not full logs.
|
|
225
|
+
|
|
226
|
+
6. **Build output**
|
|
227
|
+
|
|
228
|
+
Structured summary first:
|
|
229
|
+
\`\`\`
|
|
230
|
+
Tasks: N/M ✓
|
|
231
|
+
Files: N changed (+A -D)
|
|
232
|
+
Tests: N/N passed ✓
|
|
233
|
+
Lint: 0 errors ✓
|
|
234
|
+
Typecheck: clean ✓
|
|
235
|
+
\`\`\`
|
|
236
|
+
|
|
237
|
+
Then narrative paragraph.
|
|
238
|
+
|
|
239
|
+
7. **Present the fork**
|
|
240
|
+
|
|
241
|
+
**If all checks pass:**
|
|
242
|
+
- Archive now → AI moves to archive/
|
|
243
|
+
- Add more work → AI appends tasks (scope-checked), suggests \`/syn:clarify\` → \`/syn:analyze\` → \`/syn:apply\`
|
|
244
|
+
- Start a new change → \`/syn:propose\`
|
|
245
|
+
|
|
246
|
+
**If issues found:**
|
|
247
|
+
- Show each finding with route: \`/syn:apply\`, \`/syn:clarify\`, \`/syn:analyze\`
|
|
248
|
+
- List all findings at once
|
|
249
|
+
|
|
250
|
+
8. **Archive inline** (when user picks archive)
|
|
251
|
+
|
|
252
|
+
- Create \`synspec/changes/archive/\` if missing
|
|
253
|
+
- Target: \`YYYY-MM-DD-<change-name>\`
|
|
254
|
+
- Fail if target exists
|
|
255
|
+
- Move: \`mv synspec/changes/<name> synspec/changes/archive/YYYY-MM-DD-<name>\`
|
|
256
|
+
- Confirm
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Output (Clean)
|
|
261
|
+
|
|
262
|
+
\`\`\`
|
|
263
|
+
Tasks: 7/7 ✓
|
|
264
|
+
Files: 5 changed (+124 -12)
|
|
265
|
+
Tests: 42/42 passed ✓
|
|
266
|
+
Lint: 0 errors ✓
|
|
267
|
+
Typecheck: clean ✓
|
|
268
|
+
|
|
269
|
+
All checks pass. What would you like to do?
|
|
270
|
+
[A] Archive now [B] Add more work [C] Start a new change
|
|
271
|
+
\`\`\`
|
|
272
|
+
|
|
273
|
+
## Output (Dirty)
|
|
274
|
+
|
|
275
|
+
\`\`\`
|
|
276
|
+
Tasks: 7/7 ✓
|
|
277
|
+
Files: 5 changed (+124 -12)
|
|
278
|
+
Tests: 38/42 passed ⚠
|
|
279
|
+
Lint: 3 errors ⚠
|
|
280
|
+
|
|
281
|
+
Findings:
|
|
282
|
+
╳ 4 tests failing → /syn:apply to fix
|
|
283
|
+
╳ 3 lint errors → /syn:apply to fix
|
|
284
|
+
\`\`\`
|
|
285
|
+
|
|
286
|
+
## Guardrails
|
|
287
|
+
- Gate on task completion — no checks until all tasks are done
|
|
288
|
+
- Summary only for failed checks (not full logs)
|
|
289
|
+
- Scope-check before appending tasks
|
|
290
|
+
- Quick bypasses review — do not suggest review after /syn:quick`
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
//# sourceMappingURL=review.js.map
|
|
@@ -3,7 +3,49 @@ export function getSynSyncSkillTemplate() {
|
|
|
3
3
|
return {
|
|
4
4
|
name: 'syn-sync',
|
|
5
5
|
description: 'Generate or update synspec/constitution.md with README validation, supporting file scan, guardrail Q&A, and structured constitution generation.',
|
|
6
|
-
instructions:
|
|
6
|
+
instructions: `## Step 0: SynArcX Version Check (MUST run first)
|
|
7
|
+
|
|
8
|
+
Do NOT read any project files yet. Run this version check first.
|
|
9
|
+
|
|
10
|
+
### 0.1 Read the daily cache
|
|
11
|
+
|
|
12
|
+
Read \`synspec/.version-cache.json\`. If \`lastCheck\` matches today's UTC date (YYYY-MM-DD), skip the version check entirely — proceed to "Main Sync Flow" below.
|
|
13
|
+
|
|
14
|
+
Expected cache format:
|
|
15
|
+
\`\`\`json
|
|
16
|
+
{ "lastCheck": "2026-05-13", "latestVersion": "0.4.0" }
|
|
17
|
+
\`\`\`
|
|
18
|
+
|
|
19
|
+
If missing or malformed, treat as cache miss and continue.
|
|
20
|
+
|
|
21
|
+
### 0.2 Fetch latest from npm
|
|
22
|
+
|
|
23
|
+
Run \`npm view synarcx version\`. On failure (no npm, no network, non-zero exit): silently skip to 0.5, write cache with \`latestVersion: null\`.
|
|
24
|
+
|
|
25
|
+
### 0.3 Get installed version
|
|
26
|
+
|
|
27
|
+
Run \`synarcx --version\`. On failure: silently skip to 0.5.
|
|
28
|
+
|
|
29
|
+
### 0.4 Compare and prompt
|
|
30
|
+
|
|
31
|
+
Parse both as semver: split on \`.\`, parse each as integer, compare major→minor→patch. If npm version > installed:
|
|
32
|
+
|
|
33
|
+
1. Print update banner.
|
|
34
|
+
2. Use AskUserQuestion tool: "Update now?" with \`["Yes", "No"]\`.
|
|
35
|
+
3. **Yes**: Run \`npm install -g synarcx@latest\`. On success: print "✓ SynArcX updated" + "Run \`synarcx update\` to refresh skill files." On failure: print error + manual command.
|
|
36
|
+
4. **No**: Print manual command.
|
|
37
|
+
|
|
38
|
+
If versions match, proceed silently.
|
|
39
|
+
|
|
40
|
+
### 0.5 Write cache
|
|
41
|
+
|
|
42
|
+
Write \`synspec/.version-cache.json\` with today's UTC date and latest version (or \`null\` on failure). Use \`new Date().toISOString().split('T')[0]\`.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Main Sync Flow
|
|
47
|
+
|
|
48
|
+
Generate or update the project constitution — a living document in \`synspec/constitution.md\` that captures validated project context.
|
|
7
49
|
|
|
8
50
|
**Input**: The user can specify a focus area, or just run the command to proceed through the validation flow.
|
|
9
51
|
|
|
@@ -108,7 +150,42 @@ export function getSynSyncCommandTemplate() {
|
|
|
108
150
|
name: 'syn:sync',
|
|
109
151
|
description: 'Generate/update project constitution with README validation, guardrail Q&A, and constraint capture',
|
|
110
152
|
tags: ['workflow', 'sync', 'project'],
|
|
111
|
-
content:
|
|
153
|
+
content: `## Step 0: SynArcX Version Check (MUST run first)
|
|
154
|
+
|
|
155
|
+
Do NOT read any project files yet. Run this version check first.
|
|
156
|
+
|
|
157
|
+
### 0.1 Read the daily cache
|
|
158
|
+
|
|
159
|
+
Read \`synspec/.version-cache.json\`. If \`lastCheck\` matches today's UTC date (YYYY-MM-DD), skip to "Main Sync Flow" below. Expected format: \`{ "lastCheck": "2026-05-13", "latestVersion": "0.4.0" }\`.
|
|
160
|
+
|
|
161
|
+
### 0.2 Fetch latest from npm
|
|
162
|
+
|
|
163
|
+
Run \`npm view synarcx version\`. On failure, silently skip to 0.5, write cache with \`latestVersion: null\`.
|
|
164
|
+
|
|
165
|
+
### 0.3 Get installed version
|
|
166
|
+
|
|
167
|
+
Run \`synarcx --version\`. On failure, silently skip to 0.5.
|
|
168
|
+
|
|
169
|
+
### 0.4 Compare and prompt
|
|
170
|
+
|
|
171
|
+
Parse both as semver: split on \`.\`, parse each as integer, compare major→minor→patch. If npm version > installed:
|
|
172
|
+
|
|
173
|
+
1. Print update banner.
|
|
174
|
+
2. Use AskUserQuestion tool: "Update now?" with \`["Yes", "No"]\`.
|
|
175
|
+
3. **Yes**: Run \`npm install -g synarcx@latest\`. On success: print success + "Run \`synarcx update\` to refresh skill files." On failure: print error + manual command.
|
|
176
|
+
4. **No**: Print manual command.
|
|
177
|
+
|
|
178
|
+
If versions match, proceed silently.
|
|
179
|
+
|
|
180
|
+
### 0.5 Write cache
|
|
181
|
+
|
|
182
|
+
Write \`synspec/.version-cache.json\` with today's UTC date and latest version (or \`null\` on failure). Use \`new Date().toISOString().split('T')[0]\`.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Main Sync Flow
|
|
187
|
+
|
|
188
|
+
Generate or update the project constitution — a living document in \`synspec/constitution.md\` that captures validated project context.
|
|
112
189
|
|
|
113
190
|
**Input**: The user can specify a focus area, or just run the command to proceed through the validation flow.
|
|
114
191
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "synarcx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Structured engineering workflows for AI coding assistants — persistent project memory, spec-driven development, and architecture drift prevention across every session.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-workflow",
|