@lvlup-sw/exarchos 2.0.1
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/.claude-plugin/marketplace.json +22 -0
- package/.claude-plugin/plugin.json +17 -0
- package/.mcp.json +17 -0
- package/AGENTS.md +59 -0
- package/CLAUDE.md.template +62 -0
- package/LICENSE +202 -0
- package/README.md +258 -0
- package/commands/autocompact.md +37 -0
- package/commands/checkpoint.md +85 -0
- package/commands/cleanup.md +99 -0
- package/commands/debug.md +145 -0
- package/commands/delegate.md +56 -0
- package/commands/ideate.md +82 -0
- package/commands/plan.md +150 -0
- package/commands/refactor.md +139 -0
- package/commands/reload.md +37 -0
- package/commands/resume.md +130 -0
- package/commands/review.md +51 -0
- package/commands/sync-schemas.md +74 -0
- package/commands/synthesize.md +122 -0
- package/commands/tdd.md +58 -0
- package/dist/exarchos-cli.js +8828 -0
- package/dist/exarchos-mcp.js +50 -0
- package/hooks/hooks.json +53 -0
- package/package.json +59 -0
- package/rules/coding-standards.md +46 -0
- package/rules/mcp-tool-guidance.md +26 -0
- package/rules/pr-descriptions.md +12 -0
- package/rules/rm-safety.md +9 -0
- package/rules/skill-path-resolution.md +10 -0
- package/rules/tdd.md +41 -0
- package/rules/telemetry-awareness.md +9 -0
- package/scripts/assess-refactor-scope.sh +239 -0
- package/scripts/check-benchmark-regression.sh +229 -0
- package/scripts/check-coderabbit.sh +288 -0
- package/scripts/check-coverage-thresholds.sh +194 -0
- package/scripts/check-polish-scope.sh +245 -0
- package/scripts/check-property-tests.sh +167 -0
- package/scripts/check-tdd-compliance.sh +265 -0
- package/scripts/coderabbit-review-gate.sh +518 -0
- package/scripts/debug-review-gate.sh +201 -0
- package/scripts/extract-fix-tasks.sh +179 -0
- package/scripts/extract-task.sh +67 -0
- package/scripts/generate-traceability.sh +209 -0
- package/scripts/investigation-timer.sh +171 -0
- package/scripts/needs-schema-sync.sh +174 -0
- package/scripts/new-project.sh +103 -0
- package/scripts/post-delegation-check.sh +317 -0
- package/scripts/pre-synthesis-check.sh +440 -0
- package/scripts/reconcile-state.sh +346 -0
- package/scripts/reconstruct-stack.sh +432 -0
- package/scripts/review-diff.sh +63 -0
- package/scripts/review-verdict.sh +169 -0
- package/scripts/security-scan.sh +248 -0
- package/scripts/select-debug-track.sh +186 -0
- package/scripts/setup-worktree.sh +323 -0
- package/scripts/spec-coverage-check.sh +230 -0
- package/scripts/static-analysis-gate.sh +236 -0
- package/scripts/sync-labels.sh +122 -0
- package/scripts/validate-companion.sh +161 -0
- package/scripts/validate-dotnet-standards.sh +267 -0
- package/scripts/validate-installation.sh +101 -0
- package/scripts/validate-plugin.sh +223 -0
- package/scripts/validate-refactor.sh +234 -0
- package/scripts/validate-rm.sh +93 -0
- package/scripts/verify-delegation-saga.sh +240 -0
- package/scripts/verify-doc-links.sh +211 -0
- package/scripts/verify-ideate-artifacts.sh +296 -0
- package/scripts/verify-plan-coverage.sh +228 -0
- package/scripts/verify-review-triage.sh +219 -0
- package/scripts/verify-worktree-baseline.sh +159 -0
- package/scripts/verify-worktree.sh +84 -0
- package/settings.json +47 -0
- package/skills/brainstorming/SKILL.md +127 -0
- package/skills/brainstorming/references/design-template.md +65 -0
- package/skills/cleanup/SKILL.md +147 -0
- package/skills/cleanup/references/merge-verification.md +40 -0
- package/skills/debug/SKILL.md +204 -0
- package/skills/debug/references/hotfix-track.md +134 -0
- package/skills/debug/references/investigation-checklist.md +217 -0
- package/skills/debug/references/rca-template.md +150 -0
- package/skills/debug/references/state-schema.md +294 -0
- package/skills/debug/references/thorough-track.md +194 -0
- package/skills/debug/references/triage-questions.md +155 -0
- package/skills/debug/references/troubleshooting.md +47 -0
- package/skills/delegation/SKILL.md +150 -0
- package/skills/delegation/references/adaptive-orchestration.md +31 -0
- package/skills/delegation/references/agent-teams-saga.md +248 -0
- package/skills/delegation/references/fix-mode.md +74 -0
- package/skills/delegation/references/fixer-prompt.md +162 -0
- package/skills/delegation/references/implementer-prompt.md +322 -0
- package/skills/delegation/references/parallel-strategy.md +124 -0
- package/skills/delegation/references/pbt-patterns.md +172 -0
- package/skills/delegation/references/pr-fixes-mode.md +154 -0
- package/skills/delegation/references/state-management.md +51 -0
- package/skills/delegation/references/testing-patterns.md +129 -0
- package/skills/delegation/references/troubleshooting.md +33 -0
- package/skills/delegation/references/workflow-steps.md +127 -0
- package/skills/delegation/references/worktree-enforcement.md +64 -0
- package/skills/dotnet-standards/SKILL.md +269 -0
- package/skills/dotnet-standards/references/csharp-standards.md +120 -0
- package/skills/dotnet-standards/templates/.editorconfig +366 -0
- package/skills/dotnet-standards/templates/Directory.Build.props +56 -0
- package/skills/dotnet-standards/templates/Directory.Packages.props +69 -0
- package/skills/dotnet-standards/templates/global.json +6 -0
- package/skills/dotnet-standards/templates/nuget.config +9 -0
- package/skills/dotnet-standards/templates/stylecop.json +37 -0
- package/skills/git-worktrees/SKILL.md +255 -0
- package/skills/implementation-planning/SKILL.md +233 -0
- package/skills/implementation-planning/references/plan-document-template.md +42 -0
- package/skills/implementation-planning/references/spec-tracing-guide.md +51 -0
- package/skills/implementation-planning/references/task-template.md +43 -0
- package/skills/implementation-planning/references/testing-strategy-guide.md +88 -0
- package/skills/quality-review/SKILL.md +278 -0
- package/skills/quality-review/references/code-quality-checklist.md +159 -0
- package/skills/quality-review/references/review-report-template.md +65 -0
- package/skills/quality-review/references/security-checklist.md +79 -0
- package/skills/quality-review/references/typescript-standards.md +24 -0
- package/skills/refactor/COMMAND.md +67 -0
- package/skills/refactor/SKILL.md +198 -0
- package/skills/refactor/phases/auto-chain.md +262 -0
- package/skills/refactor/phases/brief.md +176 -0
- package/skills/refactor/phases/explore.md +132 -0
- package/skills/refactor/phases/overhaul-delegate.md +136 -0
- package/skills/refactor/phases/overhaul-plan.md +312 -0
- package/skills/refactor/phases/overhaul-review.md +304 -0
- package/skills/refactor/phases/polish-implement.md +349 -0
- package/skills/refactor/phases/polish-validate.md +218 -0
- package/skills/refactor/phases/update-docs.md +234 -0
- package/skills/refactor/references/brief-template.md +81 -0
- package/skills/refactor/references/doc-update-checklist.md +110 -0
- package/skills/refactor/references/explore-checklist.md +73 -0
- package/skills/refactor/references/overhaul-track.md +215 -0
- package/skills/refactor/references/polish-track.md +170 -0
- package/skills/shared/prompts/context-reading.md +58 -0
- package/skills/shared/prompts/report-format.md +54 -0
- package/skills/shared/prompts/tdd-requirements.md +39 -0
- package/skills/shepherd/SKILL.md +264 -0
- package/skills/shepherd/references/assess-checklist.md +124 -0
- package/skills/shepherd/references/fix-strategies.md +191 -0
- package/skills/spec-review/SKILL.md +229 -0
- package/skills/spec-review/references/review-checklist.md +60 -0
- package/skills/sync-schemas/SKILL.md +114 -0
- package/skills/sync-schemas/references/configuration.md +73 -0
- package/skills/synthesis/SKILL.md +129 -0
- package/skills/synthesis/references/pr-descriptions.md +87 -0
- package/skills/synthesis/references/synthesis-steps.md +109 -0
- package/skills/synthesis/references/troubleshooting.md +115 -0
- package/skills/validate-all-skills.sh +57 -0
- package/skills/validate-frontmatter.sh +237 -0
- package/skills/workflow-state/SKILL.md +210 -0
- package/skills/workflow-state/references/mcp-tool-reference.md +111 -0
- package/skills/workflow-state/references/phase-transitions.md +141 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Start refactor workflow for code improvement
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Refactor
|
|
6
|
+
|
|
7
|
+
Start refactor workflow for: "$ARGUMENTS"
|
|
8
|
+
|
|
9
|
+
## Workflow Overview
|
|
10
|
+
|
|
11
|
+
Refactor workflows are **exploration-first**: understand scope before committing to a track.
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
/exarchos:refactor → Explore → Brief → [Implement|Plan] → Validate → Update Docs → [CONFIRM]
|
|
15
|
+
│
|
|
16
|
+
┌────────────────┼────────────────┐
|
|
17
|
+
│ │
|
|
18
|
+
--polish (default)
|
|
19
|
+
(direct, ≤5 files) (full delegation)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Single human checkpoint:** Completion confirmation (polish) or merge confirmation (overhaul).
|
|
23
|
+
|
|
24
|
+
## Skill Reference
|
|
25
|
+
|
|
26
|
+
Follow the refactor skill: `@skills/refactor/SKILL.md`
|
|
27
|
+
|
|
28
|
+
## Command Variants
|
|
29
|
+
|
|
30
|
+
### Default: Overhaul Track
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
/refactor "Restructure the authentication module into separate concerns"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Full delegation workflow with worktree isolation.
|
|
37
|
+
|
|
38
|
+
### Fast Path: Polish Track
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
/refactor --polish "Extract validation logic into utility functions"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Direct implementation, <=5 files, single concern.
|
|
45
|
+
|
|
46
|
+
### Explore First
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
/refactor --explore "Not sure of scope, assess first"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Explore to assess scope, then decide track.
|
|
53
|
+
|
|
54
|
+
### Mid-Workflow: Switch to Overhaul
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
/refactor --switch-overhaul
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Switch from polish to overhaul if scope expands.
|
|
61
|
+
|
|
62
|
+
## Process
|
|
63
|
+
|
|
64
|
+
### Step 1: Initialize State
|
|
65
|
+
|
|
66
|
+
Initialize workflow state using `mcp__exarchos__exarchos_workflow` with `action: "init"`, featureId `refactor-<slug>`, and workflowType `refactor`.
|
|
67
|
+
|
|
68
|
+
### Step 2: Explore
|
|
69
|
+
|
|
70
|
+
Assess scope using `@skills/refactor/references/explore-checklist.md`:
|
|
71
|
+
|
|
72
|
+
1. **What code is affected?**
|
|
73
|
+
2. **How many files/modules?**
|
|
74
|
+
3. **What is the test coverage?**
|
|
75
|
+
4. **What documentation needs updating?**
|
|
76
|
+
|
|
77
|
+
Select track based on scope assessment.
|
|
78
|
+
|
|
79
|
+
### Step 3: Execute Track
|
|
80
|
+
|
|
81
|
+
**Polish Track:**
|
|
82
|
+
- Brief (capture goals in state)
|
|
83
|
+
- Implement directly (orchestrator may write code)
|
|
84
|
+
- Validate (tests pass, goals met)
|
|
85
|
+
- Update docs
|
|
86
|
+
- Completion checkpoint
|
|
87
|
+
|
|
88
|
+
**Overhaul Track:**
|
|
89
|
+
- Brief (detailed goals and approach)
|
|
90
|
+
- Plan (extract tasks via `/exarchos:plan`)
|
|
91
|
+
- Delegate (TDD in worktrees via `/exarchos:delegate`)
|
|
92
|
+
- Review (quality review via `/exarchos:review`)
|
|
93
|
+
- Update docs
|
|
94
|
+
- Synthesize (PR via `/exarchos:synthesize`)
|
|
95
|
+
- Merge checkpoint
|
|
96
|
+
|
|
97
|
+
## Arguments
|
|
98
|
+
|
|
99
|
+
| Argument | Effect |
|
|
100
|
+
|----------|--------|
|
|
101
|
+
| `<description>` | Refactor description for scope context |
|
|
102
|
+
| `--polish` | Select polish track (<=5 files, single concern) |
|
|
103
|
+
| `--explore` | Explore scope before selecting track |
|
|
104
|
+
| `--switch-overhaul` | Switch from polish to overhaul mid-workflow |
|
|
105
|
+
|
|
106
|
+
## State Management
|
|
107
|
+
|
|
108
|
+
Refactor workflows use extended state schema. See `@skills/refactor/SKILL.md` for full schema.
|
|
109
|
+
|
|
110
|
+
Key fields:
|
|
111
|
+
- `workflowType: "refactor"`
|
|
112
|
+
- `track: "polish" | "overhaul"`
|
|
113
|
+
- `explore: { scopeAssessment }`
|
|
114
|
+
- `brief: { problem, goals, approach, successCriteria }`
|
|
115
|
+
- `validation: { testsPass, goalsVerified, docsUpdated }`
|
|
116
|
+
|
|
117
|
+
## Auto-Chain Behavior
|
|
118
|
+
|
|
119
|
+
Both tracks auto-chain through phases with ONE human checkpoint.
|
|
120
|
+
|
|
121
|
+
**Polish:**
|
|
122
|
+
```
|
|
123
|
+
explore → brief → implement → validate → update-docs → [HUMAN: complete]
|
|
124
|
+
(auto) (auto) (auto) (auto)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Overhaul:**
|
|
128
|
+
```
|
|
129
|
+
explore → brief → plan → delegate → review → update-docs → synthesize → [HUMAN: merge]
|
|
130
|
+
(auto) (auto) (auto) (auto) (auto) (auto)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Resume Support
|
|
134
|
+
|
|
135
|
+
Refactor workflows resume like other workflows:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
/exarchos:resume ~/.claude/workflow-state/refactor-<slug>.state.json
|
|
139
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reload
|
|
3
|
+
description: "Manually trigger context reload to recover from context degradation."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Reload Context
|
|
7
|
+
|
|
8
|
+
Manually trigger a context reload to recover from context degradation.
|
|
9
|
+
|
|
10
|
+
## Process
|
|
11
|
+
|
|
12
|
+
1. **Checkpoint current state** — Save workflow context to disk
|
|
13
|
+
2. **Clear session** — Type `/clear` to start fresh with pre-computed context
|
|
14
|
+
|
|
15
|
+
## Steps
|
|
16
|
+
|
|
17
|
+
### Step 1: Save Context Checkpoint
|
|
18
|
+
|
|
19
|
+
The PreCompact hook will fire, saving:
|
|
20
|
+
- Workflow checkpoint (phase, tasks, artifacts)
|
|
21
|
+
- Pre-assembled context document (structured Markdown summary)
|
|
22
|
+
|
|
23
|
+
This happens automatically when you type `/clear`.
|
|
24
|
+
|
|
25
|
+
### Step 2: Clear and Reload
|
|
26
|
+
|
|
27
|
+
Type `/clear` in the chat. The SessionStart hook will:
|
|
28
|
+
1. Detect the saved checkpoint
|
|
29
|
+
2. Inject the pre-computed context document
|
|
30
|
+
3. Resume with full workflow awareness
|
|
31
|
+
|
|
32
|
+
## When to Use
|
|
33
|
+
|
|
34
|
+
- Context feels degraded (agent forgets workflow state, repeats questions)
|
|
35
|
+
- After long sessions with many tool calls
|
|
36
|
+
- Before complex operations that need full context
|
|
37
|
+
- The auto-compact threshold (95%) will trigger this automatically, but you can manually trigger it anytime
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Resume workflow from saved state file
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Resume
|
|
6
|
+
|
|
7
|
+
Resume workflow from state file: "$ARGUMENTS"
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
Restore workflow context after:
|
|
12
|
+
- Starting a new Claude Code session
|
|
13
|
+
- Context auto-summarization
|
|
14
|
+
- Explicit checkpoint
|
|
15
|
+
|
|
16
|
+
## Skill Reference
|
|
17
|
+
|
|
18
|
+
- Workflow state: `@skills/workflow-state/SKILL.md`
|
|
19
|
+
|
|
20
|
+
## Process
|
|
21
|
+
|
|
22
|
+
### Step 1: Locate State File
|
|
23
|
+
|
|
24
|
+
If no argument provided, the SessionStart hook automatically discovers active workflows on session start. To manually locate state files, check the state directory:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
ls ~/.claude/workflow-state/*.state.json
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Step 2: Reconcile State
|
|
31
|
+
|
|
32
|
+
The SessionStart hook automatically verifies state matches git reality on resume. Review reported discrepancies (missing worktrees, branches).
|
|
33
|
+
|
|
34
|
+
### Step 3: Load Context Summary
|
|
35
|
+
|
|
36
|
+
The SessionStart hook provides workflow context automatically. Read the state file using `mcp__exarchos__exarchos_workflow` with `action: "get"` and the featureId for detailed state.
|
|
37
|
+
|
|
38
|
+
### Step 4: Display Context
|
|
39
|
+
|
|
40
|
+
Output the summary to restore orchestrator context:
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
## Workflow Context Restored
|
|
44
|
+
|
|
45
|
+
**Feature:** <feature-id>
|
|
46
|
+
**Phase:** <phase>
|
|
47
|
+
**Last Updated:** <timestamp>
|
|
48
|
+
|
|
49
|
+
### Artifacts
|
|
50
|
+
- Design: `<path or "not created">`
|
|
51
|
+
- Plan: `<path or "not created">`
|
|
52
|
+
- PR: <url or "not created">
|
|
53
|
+
|
|
54
|
+
### Task Progress
|
|
55
|
+
- Completed: X / Y
|
|
56
|
+
|
|
57
|
+
### Pending Tasks
|
|
58
|
+
- [status] ID: Title
|
|
59
|
+
- ...
|
|
60
|
+
|
|
61
|
+
### Active Worktrees
|
|
62
|
+
- .worktrees/xxx (branch-name)
|
|
63
|
+
- ...
|
|
64
|
+
|
|
65
|
+
### Next Action
|
|
66
|
+
<suggested command based on phase>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Step 5: Prompt for Action
|
|
70
|
+
|
|
71
|
+
After displaying context, ask:
|
|
72
|
+
|
|
73
|
+
> Ready to continue. Run the suggested next action, or specify what you'd like to do.
|
|
74
|
+
|
|
75
|
+
## Usage Examples
|
|
76
|
+
|
|
77
|
+
### Resume Specific Workflow
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
/exarchos:resume ~/.claude/workflow-state/user-authentication.state.json
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### List and Choose
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
/exarchos:resume
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Lists available workflows, then:
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
/exarchos:resume ~/.claude/workflow-state/<chosen-feature>.state.json
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Context Efficiency
|
|
96
|
+
|
|
97
|
+
The resume process is designed to be context-efficient:
|
|
98
|
+
|
|
99
|
+
1. **Minimal output** - Only essential state displayed
|
|
100
|
+
2. **File references** - Full details remain in files, not conversation
|
|
101
|
+
3. **Action-oriented** - Immediately suggests next step
|
|
102
|
+
4. **No history replay** - Fresh start with current state
|
|
103
|
+
|
|
104
|
+
## Error Handling
|
|
105
|
+
|
|
106
|
+
### State File Not Found
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
ERROR: State file not found: <path>
|
|
110
|
+
|
|
111
|
+
Available workflows:
|
|
112
|
+
<list from workflow state directory>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Reconciliation Issues
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
WARNING: State discrepancies found
|
|
119
|
+
|
|
120
|
+
Missing worktrees:
|
|
121
|
+
- .worktrees/001-types
|
|
122
|
+
|
|
123
|
+
Missing branches:
|
|
124
|
+
- feature/001-types
|
|
125
|
+
|
|
126
|
+
Options:
|
|
127
|
+
1. Fix discrepancies manually
|
|
128
|
+
2. Update state to match reality
|
|
129
|
+
3. Continue anyway (may cause issues)
|
|
130
|
+
```
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Run two-stage review (spec compliance + code quality)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Review
|
|
6
|
+
|
|
7
|
+
Review implementation for: "$ARGUMENTS"
|
|
8
|
+
|
|
9
|
+
## Workflow Position
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
/exarchos:ideate → [CONFIRM] → /exarchos:plan → /exarchos:delegate → /exarchos:review → /exarchos:synthesize → [CONFIRM] → merge
|
|
13
|
+
▲▲▲▲▲▲▲▲▲▲▲▲▲▲
|
|
14
|
+
ON BLOCKED ──────────────────────────────────────┘
|
|
15
|
+
ON FAIL → /exarchos:delegate --fixes (auto)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Review runs AFTER delegation completes -- reviews the Graphite stack diff.
|
|
19
|
+
|
|
20
|
+
## Skill References
|
|
21
|
+
|
|
22
|
+
- **Stage 1 (spec compliance):** `@skills/spec-review/SKILL.md`
|
|
23
|
+
- **Stage 2 (code quality):** `@skills/quality-review/SKILL.md`
|
|
24
|
+
|
|
25
|
+
Reviews MUST be dispatched to subagents (not run inline). Use the Graphite stack diff to reduce context by 80-90%:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
TARGET_BRANCH=$(gt parent 2>/dev/null || echo "main")
|
|
29
|
+
gt diff $TARGET_BRANCH > /tmp/stack-diff.patch
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Idempotency
|
|
33
|
+
|
|
34
|
+
Before reviewing, check review status in state:
|
|
35
|
+
1. Skip tasks where both reviews already passed
|
|
36
|
+
2. Only review pending tasks
|
|
37
|
+
3. If all reviews passed, skip to auto-chain
|
|
38
|
+
|
|
39
|
+
## Output
|
|
40
|
+
|
|
41
|
+
Track the feature name and plan path as `$FEATURE_NAME` and `$PLAN_PATH`.
|
|
42
|
+
|
|
43
|
+
## Auto-Chain
|
|
44
|
+
|
|
45
|
+
All transitions happen **immediately** without user confirmation:
|
|
46
|
+
|
|
47
|
+
- **ON PASS:** Update state `.phase = "synthesize"`, invoke `Skill({ skill: "exarchos:synthesize", args: "$FEATURE_NAME" })`
|
|
48
|
+
- **ON FAIL:** Update state with failed review details, invoke `Skill({ skill: "exarchos:delegate", args: "--fixes $PLAN_PATH" })`
|
|
49
|
+
- **ON BLOCKED:** Update state `.phase = "blocked"`, invoke `Skill({ skill: "exarchos:ideate", args: "--redesign $FEATURE_NAME" })`
|
|
50
|
+
|
|
51
|
+
**No pause for user input** -- this is not a human checkpoint.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Synchronize TypeScript types from backend OpenAPI specs
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Sync Schemas
|
|
6
|
+
|
|
7
|
+
Regenerate TypeScript types and Zod schemas from backend OpenAPI specifications.
|
|
8
|
+
|
|
9
|
+
## Skill Reference
|
|
10
|
+
|
|
11
|
+
Follow the schema sync skill: `@skills/sync-schemas/SKILL.md`
|
|
12
|
+
|
|
13
|
+
## Quick Process
|
|
14
|
+
|
|
15
|
+
### Step 1: Detect Monorepo Root
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
MONOREPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
|
|
19
|
+
|
|
20
|
+
# Handle worktree case
|
|
21
|
+
if [[ "$(pwd)" == *".worktrees"* ]]; then
|
|
22
|
+
MONOREPO_ROOT=$(pwd)
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
cd "$MONOREPO_ROOT"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Step 2: Run Sync
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm run sync:schemas
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Step 3: Verify
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm run typecheck
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Step 4: Report
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
## Schema Sync Complete
|
|
44
|
+
|
|
45
|
+
Generated files:
|
|
46
|
+
- `apps/aegis-api/openapi.json`
|
|
47
|
+
- `shared/types/src/generated/aegis.ts`
|
|
48
|
+
- `shared/validation/src/generated/aegis.zod.ts`
|
|
49
|
+
- `apps/ares-elite-web/src/api/generated/aegis.schemas.ts`
|
|
50
|
+
|
|
51
|
+
Typecheck: PASS
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## When to Use
|
|
55
|
+
|
|
56
|
+
Run this command after modifying:
|
|
57
|
+
- `*Endpoints.cs` - API endpoint definitions
|
|
58
|
+
- `**/Models/*.cs` - Request/response DTOs
|
|
59
|
+
- `**/Dtos/*.cs` - Data transfer objects
|
|
60
|
+
|
|
61
|
+
## Auto-Invocation
|
|
62
|
+
|
|
63
|
+
This command is auto-invoked by `/exarchos:delegate` when subagents modify API files. You typically only need to run it manually when:
|
|
64
|
+
- CI schema-check fails
|
|
65
|
+
- Making quick backend changes outside the workflow
|
|
66
|
+
- Verifying types after pulling changes
|
|
67
|
+
|
|
68
|
+
## Failure Recovery
|
|
69
|
+
|
|
70
|
+
| Issue | Solution |
|
|
71
|
+
|-------|----------|
|
|
72
|
+
| Build failure | Check C# compilation errors in Aegis.API |
|
|
73
|
+
| Orval failure | Verify `apps/aegis-api/openapi.json` is valid JSON |
|
|
74
|
+
| TypeScript errors | Breaking API change - update consumers |
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Create pull request from feature branch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Synthesize
|
|
6
|
+
|
|
7
|
+
Create final PR for: "$ARGUMENTS"
|
|
8
|
+
|
|
9
|
+
## Workflow Position
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
/exarchos:ideate → [CONFIRM] → /exarchos:plan → /exarchos:delegate → /exarchos:review → /exarchos:synthesize → [CONFIRM] → merge
|
|
13
|
+
▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
This command is the **exit point** of the development workflow. After creating the PR, asks for confirmation before merging.
|
|
17
|
+
|
|
18
|
+
## Skill Reference
|
|
19
|
+
|
|
20
|
+
Follow the synthesis skill: `@skills/synthesis/SKILL.md`
|
|
21
|
+
|
|
22
|
+
## Prerequisites
|
|
23
|
+
|
|
24
|
+
- [ ] Review phase complete (all checks passed)
|
|
25
|
+
- [ ] Spec review: PASS
|
|
26
|
+
- [ ] Quality review: APPROVED
|
|
27
|
+
|
|
28
|
+
## Process
|
|
29
|
+
|
|
30
|
+
### Step 1: Verify Branch State
|
|
31
|
+
```bash
|
|
32
|
+
git log --oneline -5 # Confirm all task commits present
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Step 2: Submit Stacked PRs
|
|
36
|
+
|
|
37
|
+
Follow `@rules/pr-descriptions.md` for concise format.
|
|
38
|
+
|
|
39
|
+
**Always use Graphite** to submit stacked PRs:
|
|
40
|
+
```typescript
|
|
41
|
+
mcp__graphite__run_gt_cmd({
|
|
42
|
+
args: ["submit", "--no-interactive", "--publish", "--merge-when-ready", "--stack"],
|
|
43
|
+
cwd: "<repo-root>"
|
|
44
|
+
})
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**NEVER use `gh pr create` or `mcp__plugin_github_github__create_pull_request`** — these create non-stacked PRs that bypass Graphite's stack management.
|
|
48
|
+
|
|
49
|
+
### Step 3: Cleanup (After Merge)
|
|
50
|
+
```bash
|
|
51
|
+
git worktree remove .worktrees/task-name
|
|
52
|
+
git branch -d feature/task-branch
|
|
53
|
+
git worktree prune
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Handling Failures
|
|
57
|
+
|
|
58
|
+
- **PR checks fail:** Push fixes to feature branch
|
|
59
|
+
- **Review feedback:** Use `/exarchos:delegate --pr-fixes` to address comments
|
|
60
|
+
|
|
61
|
+
## Output
|
|
62
|
+
|
|
63
|
+
When complete:
|
|
64
|
+
```markdown
|
|
65
|
+
## Synthesis Complete
|
|
66
|
+
|
|
67
|
+
PR: [URL]
|
|
68
|
+
Tests: X pass | Build: 0 errors
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Direct Edits
|
|
72
|
+
|
|
73
|
+
You can make direct edits to stack branches at any time:
|
|
74
|
+
- Edit files in your IDE
|
|
75
|
+
- Stage and commit via Graphite: `gt modify -m "fix: <description>"`
|
|
76
|
+
- Resubmit the stack: `gt submit --no-interactive`
|
|
77
|
+
|
|
78
|
+
**NEVER use `git commit` or `git push`** — always use `gt modify` and `gt submit` to keep the stack consistent.
|
|
79
|
+
|
|
80
|
+
## Idempotency
|
|
81
|
+
|
|
82
|
+
Before synthesizing, check synthesis status:
|
|
83
|
+
1. Check if `synthesis.prUrl` exists in state
|
|
84
|
+
2. If PR exists and is open, skip to merge confirmation
|
|
85
|
+
3. If PR merged, update phase to "completed"
|
|
86
|
+
|
|
87
|
+
## Human Checkpoint
|
|
88
|
+
|
|
89
|
+
After PR is created, this is a **human checkpoint** - user confirmation required.
|
|
90
|
+
|
|
91
|
+
### Save State
|
|
92
|
+
|
|
93
|
+
Update state using `mcp__exarchos__exarchos_workflow` with `action: "set"` and the `featureId`:
|
|
94
|
+
- Set `artifacts.pr` to the PR URL
|
|
95
|
+
- Set `synthesis.prUrl` to the PR URL
|
|
96
|
+
|
|
97
|
+
## Auto-Chain
|
|
98
|
+
|
|
99
|
+
After PR created:
|
|
100
|
+
|
|
101
|
+
1. Update state with PR URL
|
|
102
|
+
2. Output: "PR created: [URL]. All checks passing."
|
|
103
|
+
3. **PAUSE for user input**: "Merge PR? (yes/no/feedback)"
|
|
104
|
+
|
|
105
|
+
This is one of only TWO human checkpoints in the workflow.
|
|
106
|
+
|
|
107
|
+
4. **On 'yes'** (yes, y, merge):
|
|
108
|
+
```bash
|
|
109
|
+
gh pr merge <PR_NUMBER> --squash --auto
|
|
110
|
+
```
|
|
111
|
+
> Or use GitHub MCP `merge_pull_request` if available.
|
|
112
|
+
|
|
113
|
+
Update state: `.phase = "completed"`
|
|
114
|
+
|
|
115
|
+
5. **On 'feedback'** (feedback, comments, fixes, changes, address):
|
|
116
|
+
Auto-continue to fixes:
|
|
117
|
+
```typescript
|
|
118
|
+
Skill({ skill: "exarchos:delegate", args: "--pr-fixes [PR_URL]" })
|
|
119
|
+
```
|
|
120
|
+
After fixes complete, workflow returns here automatically.
|
|
121
|
+
|
|
122
|
+
6. **On 'no'**: "Workflow paused. Run `/exarchos:resume` to continue later."
|
package/commands/tdd.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tdd
|
|
3
|
+
description: "Plan implementation following strict TDD (Red-Green-Refactor)."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# TDD Implementation Plan
|
|
7
|
+
|
|
8
|
+
Create a detailed TDD implementation plan for: "$ARGUMENTS"
|
|
9
|
+
|
|
10
|
+
## Skill Reference
|
|
11
|
+
|
|
12
|
+
Follow the implementation-planning skill: `@skills/implementation-planning/SKILL.md`
|
|
13
|
+
|
|
14
|
+
## TDD Workflow Reference
|
|
15
|
+
|
|
16
|
+
Follow the strict TDD workflow from `rules/tdd.md`. For test code patterns, see `@skills/delegation/references/testing-patterns.md`.
|
|
17
|
+
|
|
18
|
+
## Plan Requirements
|
|
19
|
+
|
|
20
|
+
Generate a step-by-step implementation plan where:
|
|
21
|
+
|
|
22
|
+
1. **Every implementation step starts with a failing test**
|
|
23
|
+
2. **Each step is labeled with its TDD phase**: [RED], [GREEN], or [REFACTOR]
|
|
24
|
+
3. **Include test verification after each implementation**
|
|
25
|
+
|
|
26
|
+
## Plan Format
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
## Implementation Plan: [Feature Name]
|
|
30
|
+
|
|
31
|
+
### Step 1: [RED] Write failing test for [behavior]
|
|
32
|
+
- Create test file at [path]
|
|
33
|
+
- Test: `MethodName_Scenario_ExpectedOutcome`
|
|
34
|
+
- Expected failure reason: [reason]
|
|
35
|
+
- Run: `npm run test:run` or `dotnet test`
|
|
36
|
+
|
|
37
|
+
### Step 2: [GREEN] Implement minimum code
|
|
38
|
+
- Modify [file]
|
|
39
|
+
- Implementation: [brief description]
|
|
40
|
+
- Run: `npm run test:run` - verify test passes
|
|
41
|
+
|
|
42
|
+
### Step 3: [REFACTOR] Clean up
|
|
43
|
+
- Apply: [SOLID principle or improvement]
|
|
44
|
+
- Run: `npm run test:run` - verify tests stay green
|
|
45
|
+
|
|
46
|
+
### Step 4: [RED] Write failing test for [next behavior]
|
|
47
|
+
...
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Deliverables
|
|
51
|
+
|
|
52
|
+
The plan MUST include:
|
|
53
|
+
- [ ] Test file locations
|
|
54
|
+
- [ ] Test method names following naming convention
|
|
55
|
+
- [ ] Expected failure reasons for RED phase
|
|
56
|
+
- [ ] Minimal implementation description for GREEN phase
|
|
57
|
+
- [ ] Specific refactoring actions for REFACTOR phase
|
|
58
|
+
- [ ] Verification commands after each step
|