@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.
Files changed (153) hide show
  1. package/.claude-plugin/marketplace.json +22 -0
  2. package/.claude-plugin/plugin.json +17 -0
  3. package/.mcp.json +17 -0
  4. package/AGENTS.md +59 -0
  5. package/CLAUDE.md.template +62 -0
  6. package/LICENSE +202 -0
  7. package/README.md +258 -0
  8. package/commands/autocompact.md +37 -0
  9. package/commands/checkpoint.md +85 -0
  10. package/commands/cleanup.md +99 -0
  11. package/commands/debug.md +145 -0
  12. package/commands/delegate.md +56 -0
  13. package/commands/ideate.md +82 -0
  14. package/commands/plan.md +150 -0
  15. package/commands/refactor.md +139 -0
  16. package/commands/reload.md +37 -0
  17. package/commands/resume.md +130 -0
  18. package/commands/review.md +51 -0
  19. package/commands/sync-schemas.md +74 -0
  20. package/commands/synthesize.md +122 -0
  21. package/commands/tdd.md +58 -0
  22. package/dist/exarchos-cli.js +8828 -0
  23. package/dist/exarchos-mcp.js +50 -0
  24. package/hooks/hooks.json +53 -0
  25. package/package.json +59 -0
  26. package/rules/coding-standards.md +46 -0
  27. package/rules/mcp-tool-guidance.md +26 -0
  28. package/rules/pr-descriptions.md +12 -0
  29. package/rules/rm-safety.md +9 -0
  30. package/rules/skill-path-resolution.md +10 -0
  31. package/rules/tdd.md +41 -0
  32. package/rules/telemetry-awareness.md +9 -0
  33. package/scripts/assess-refactor-scope.sh +239 -0
  34. package/scripts/check-benchmark-regression.sh +229 -0
  35. package/scripts/check-coderabbit.sh +288 -0
  36. package/scripts/check-coverage-thresholds.sh +194 -0
  37. package/scripts/check-polish-scope.sh +245 -0
  38. package/scripts/check-property-tests.sh +167 -0
  39. package/scripts/check-tdd-compliance.sh +265 -0
  40. package/scripts/coderabbit-review-gate.sh +518 -0
  41. package/scripts/debug-review-gate.sh +201 -0
  42. package/scripts/extract-fix-tasks.sh +179 -0
  43. package/scripts/extract-task.sh +67 -0
  44. package/scripts/generate-traceability.sh +209 -0
  45. package/scripts/investigation-timer.sh +171 -0
  46. package/scripts/needs-schema-sync.sh +174 -0
  47. package/scripts/new-project.sh +103 -0
  48. package/scripts/post-delegation-check.sh +317 -0
  49. package/scripts/pre-synthesis-check.sh +440 -0
  50. package/scripts/reconcile-state.sh +346 -0
  51. package/scripts/reconstruct-stack.sh +432 -0
  52. package/scripts/review-diff.sh +63 -0
  53. package/scripts/review-verdict.sh +169 -0
  54. package/scripts/security-scan.sh +248 -0
  55. package/scripts/select-debug-track.sh +186 -0
  56. package/scripts/setup-worktree.sh +323 -0
  57. package/scripts/spec-coverage-check.sh +230 -0
  58. package/scripts/static-analysis-gate.sh +236 -0
  59. package/scripts/sync-labels.sh +122 -0
  60. package/scripts/validate-companion.sh +161 -0
  61. package/scripts/validate-dotnet-standards.sh +267 -0
  62. package/scripts/validate-installation.sh +101 -0
  63. package/scripts/validate-plugin.sh +223 -0
  64. package/scripts/validate-refactor.sh +234 -0
  65. package/scripts/validate-rm.sh +93 -0
  66. package/scripts/verify-delegation-saga.sh +240 -0
  67. package/scripts/verify-doc-links.sh +211 -0
  68. package/scripts/verify-ideate-artifacts.sh +296 -0
  69. package/scripts/verify-plan-coverage.sh +228 -0
  70. package/scripts/verify-review-triage.sh +219 -0
  71. package/scripts/verify-worktree-baseline.sh +159 -0
  72. package/scripts/verify-worktree.sh +84 -0
  73. package/settings.json +47 -0
  74. package/skills/brainstorming/SKILL.md +127 -0
  75. package/skills/brainstorming/references/design-template.md +65 -0
  76. package/skills/cleanup/SKILL.md +147 -0
  77. package/skills/cleanup/references/merge-verification.md +40 -0
  78. package/skills/debug/SKILL.md +204 -0
  79. package/skills/debug/references/hotfix-track.md +134 -0
  80. package/skills/debug/references/investigation-checklist.md +217 -0
  81. package/skills/debug/references/rca-template.md +150 -0
  82. package/skills/debug/references/state-schema.md +294 -0
  83. package/skills/debug/references/thorough-track.md +194 -0
  84. package/skills/debug/references/triage-questions.md +155 -0
  85. package/skills/debug/references/troubleshooting.md +47 -0
  86. package/skills/delegation/SKILL.md +150 -0
  87. package/skills/delegation/references/adaptive-orchestration.md +31 -0
  88. package/skills/delegation/references/agent-teams-saga.md +248 -0
  89. package/skills/delegation/references/fix-mode.md +74 -0
  90. package/skills/delegation/references/fixer-prompt.md +162 -0
  91. package/skills/delegation/references/implementer-prompt.md +322 -0
  92. package/skills/delegation/references/parallel-strategy.md +124 -0
  93. package/skills/delegation/references/pbt-patterns.md +172 -0
  94. package/skills/delegation/references/pr-fixes-mode.md +154 -0
  95. package/skills/delegation/references/state-management.md +51 -0
  96. package/skills/delegation/references/testing-patterns.md +129 -0
  97. package/skills/delegation/references/troubleshooting.md +33 -0
  98. package/skills/delegation/references/workflow-steps.md +127 -0
  99. package/skills/delegation/references/worktree-enforcement.md +64 -0
  100. package/skills/dotnet-standards/SKILL.md +269 -0
  101. package/skills/dotnet-standards/references/csharp-standards.md +120 -0
  102. package/skills/dotnet-standards/templates/.editorconfig +366 -0
  103. package/skills/dotnet-standards/templates/Directory.Build.props +56 -0
  104. package/skills/dotnet-standards/templates/Directory.Packages.props +69 -0
  105. package/skills/dotnet-standards/templates/global.json +6 -0
  106. package/skills/dotnet-standards/templates/nuget.config +9 -0
  107. package/skills/dotnet-standards/templates/stylecop.json +37 -0
  108. package/skills/git-worktrees/SKILL.md +255 -0
  109. package/skills/implementation-planning/SKILL.md +233 -0
  110. package/skills/implementation-planning/references/plan-document-template.md +42 -0
  111. package/skills/implementation-planning/references/spec-tracing-guide.md +51 -0
  112. package/skills/implementation-planning/references/task-template.md +43 -0
  113. package/skills/implementation-planning/references/testing-strategy-guide.md +88 -0
  114. package/skills/quality-review/SKILL.md +278 -0
  115. package/skills/quality-review/references/code-quality-checklist.md +159 -0
  116. package/skills/quality-review/references/review-report-template.md +65 -0
  117. package/skills/quality-review/references/security-checklist.md +79 -0
  118. package/skills/quality-review/references/typescript-standards.md +24 -0
  119. package/skills/refactor/COMMAND.md +67 -0
  120. package/skills/refactor/SKILL.md +198 -0
  121. package/skills/refactor/phases/auto-chain.md +262 -0
  122. package/skills/refactor/phases/brief.md +176 -0
  123. package/skills/refactor/phases/explore.md +132 -0
  124. package/skills/refactor/phases/overhaul-delegate.md +136 -0
  125. package/skills/refactor/phases/overhaul-plan.md +312 -0
  126. package/skills/refactor/phases/overhaul-review.md +304 -0
  127. package/skills/refactor/phases/polish-implement.md +349 -0
  128. package/skills/refactor/phases/polish-validate.md +218 -0
  129. package/skills/refactor/phases/update-docs.md +234 -0
  130. package/skills/refactor/references/brief-template.md +81 -0
  131. package/skills/refactor/references/doc-update-checklist.md +110 -0
  132. package/skills/refactor/references/explore-checklist.md +73 -0
  133. package/skills/refactor/references/overhaul-track.md +215 -0
  134. package/skills/refactor/references/polish-track.md +170 -0
  135. package/skills/shared/prompts/context-reading.md +58 -0
  136. package/skills/shared/prompts/report-format.md +54 -0
  137. package/skills/shared/prompts/tdd-requirements.md +39 -0
  138. package/skills/shepherd/SKILL.md +264 -0
  139. package/skills/shepherd/references/assess-checklist.md +124 -0
  140. package/skills/shepherd/references/fix-strategies.md +191 -0
  141. package/skills/spec-review/SKILL.md +229 -0
  142. package/skills/spec-review/references/review-checklist.md +60 -0
  143. package/skills/sync-schemas/SKILL.md +114 -0
  144. package/skills/sync-schemas/references/configuration.md +73 -0
  145. package/skills/synthesis/SKILL.md +129 -0
  146. package/skills/synthesis/references/pr-descriptions.md +87 -0
  147. package/skills/synthesis/references/synthesis-steps.md +109 -0
  148. package/skills/synthesis/references/troubleshooting.md +115 -0
  149. package/skills/validate-all-skills.sh +57 -0
  150. package/skills/validate-frontmatter.sh +237 -0
  151. package/skills/workflow-state/SKILL.md +210 -0
  152. package/skills/workflow-state/references/mcp-tool-reference.md +111 -0
  153. package/skills/workflow-state/references/phase-transitions.md +141 -0
@@ -0,0 +1,317 @@
1
+ #!/usr/bin/env bash
2
+ # post-delegation-check.sh — Post-delegation result collection and validation
3
+ # Replaces the "Collect Results" prose in delegation SKILL.md.
4
+ #
5
+ # Usage: post-delegation-check.sh --state-file <path> --repo-root <path> [--skip-tests]
6
+ #
7
+ # Exit codes:
8
+ # 0 = all pass
9
+ # 1 = failures detected
10
+ # 2 = usage error (missing required args)
11
+
12
+ set -euo pipefail
13
+
14
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
15
+
16
+ # Colors
17
+ RED='\033[0;31m'
18
+ GREEN='\033[0;32m'
19
+ YELLOW='\033[1;33m'
20
+ NC='\033[0m'
21
+
22
+ # ============================================================
23
+ # ARGUMENT PARSING
24
+ # ============================================================
25
+
26
+ STATE_FILE=""
27
+ REPO_ROOT=""
28
+ SKIP_TESTS=false
29
+
30
+ usage() {
31
+ cat << 'USAGE'
32
+ Usage: post-delegation-check.sh --state-file <path> --repo-root <path> [--skip-tests]
33
+
34
+ Required:
35
+ --state-file <path> Path to the workflow state JSON file
36
+ --repo-root <path> Repository root directory
37
+
38
+ Optional:
39
+ --skip-tests Skip per-worktree test execution
40
+ --help Show this help message
41
+
42
+ Exit codes:
43
+ 0 All checks pass
44
+ 1 Failures detected
45
+ 2 Usage error (missing required args)
46
+ USAGE
47
+ }
48
+
49
+ while [[ $# -gt 0 ]]; do
50
+ case "$1" in
51
+ --state-file)
52
+ if [[ -z "${2:-}" ]]; then
53
+ echo "Error: --state-file requires a path argument" >&2
54
+ exit 2
55
+ fi
56
+ STATE_FILE="$2"
57
+ shift 2
58
+ ;;
59
+ --repo-root)
60
+ if [[ -z "${2:-}" ]]; then
61
+ echo "Error: --repo-root requires a path argument" >&2
62
+ exit 2
63
+ fi
64
+ REPO_ROOT="$2"
65
+ shift 2
66
+ ;;
67
+ --skip-tests)
68
+ SKIP_TESTS=true
69
+ shift
70
+ ;;
71
+ --help)
72
+ usage
73
+ exit 0
74
+ ;;
75
+ *)
76
+ echo "Error: Unknown argument '$1'" >&2
77
+ usage >&2
78
+ exit 2
79
+ ;;
80
+ esac
81
+ done
82
+
83
+ if [[ -z "$STATE_FILE" ]]; then
84
+ echo "Error: --state-file is required" >&2
85
+ usage >&2
86
+ exit 2
87
+ fi
88
+
89
+ if [[ -z "$REPO_ROOT" ]]; then
90
+ echo "Error: --repo-root is required" >&2
91
+ usage >&2
92
+ exit 2
93
+ fi
94
+
95
+ # ============================================================
96
+ # DEPENDENCY CHECK
97
+ # ============================================================
98
+
99
+ if ! command -v jq &>/dev/null; then
100
+ echo "Error: jq is required but not installed" >&2
101
+ exit 2
102
+ fi
103
+
104
+ # ============================================================
105
+ # CHECK FUNCTIONS
106
+ # ============================================================
107
+
108
+ CHECK_PASS=0
109
+ CHECK_FAIL=0
110
+ RESULTS=()
111
+
112
+ check_pass() {
113
+ local name="$1"
114
+ RESULTS+=("- **PASS**: $name")
115
+ CHECK_PASS=$((CHECK_PASS + 1))
116
+ }
117
+
118
+ check_fail() {
119
+ local name="$1"
120
+ local detail="${2:-}"
121
+ if [[ -n "$detail" ]]; then
122
+ RESULTS+=("- **FAIL**: $name — $detail")
123
+ else
124
+ RESULTS+=("- **FAIL**: $name")
125
+ fi
126
+ CHECK_FAIL=$((CHECK_FAIL + 1))
127
+ }
128
+
129
+ check_skip() {
130
+ local name="$1"
131
+ RESULTS+=("- **SKIP**: $name")
132
+ }
133
+
134
+ # ============================================================
135
+ # CHECK 1: State file exists and is valid JSON
136
+ # ============================================================
137
+
138
+ check_state_file() {
139
+ if [[ ! -f "$STATE_FILE" ]]; then
140
+ check_fail "State file exists" "File not found: $STATE_FILE"
141
+ return 1
142
+ fi
143
+
144
+ if ! jq empty "$STATE_FILE" 2>/dev/null; then
145
+ check_fail "State file exists" "Invalid JSON: $STATE_FILE"
146
+ return 1
147
+ fi
148
+
149
+ check_pass "State file exists"
150
+ return 0
151
+ }
152
+
153
+ # ============================================================
154
+ # CHECK 2: Tasks array has entries
155
+ # ============================================================
156
+
157
+ check_tasks_exist() {
158
+ local task_count
159
+ task_count="$(jq '.tasks | length' "$STATE_FILE")"
160
+
161
+ if [[ "$task_count" -eq 0 ]]; then
162
+ check_fail "Tasks exist" "No tasks found in state file"
163
+ return 1
164
+ fi
165
+
166
+ check_pass "Tasks exist ($task_count tasks)"
167
+ return 0
168
+ }
169
+
170
+ # ============================================================
171
+ # CHECK 3: All tasks report completion
172
+ # ============================================================
173
+
174
+ check_all_tasks_complete() {
175
+ local task_count
176
+ local incomplete_count
177
+ local incomplete_tasks
178
+
179
+ task_count="$(jq '.tasks | length' "$STATE_FILE")"
180
+ incomplete_count="$(jq '[.tasks[] | select(.status != "complete")] | length' "$STATE_FILE")"
181
+
182
+ if [[ "$incomplete_count" -gt 0 ]]; then
183
+ incomplete_tasks="$(jq -r '[.tasks[] | select(.status != "complete") | "\(.id) (\(.status))"] | join(", ")' "$STATE_FILE")"
184
+ check_fail "All tasks complete" "$incomplete_count incomplete: $incomplete_tasks"
185
+ return 1
186
+ fi
187
+
188
+ check_pass "All tasks complete ($task_count/$task_count)"
189
+ return 0
190
+ }
191
+
192
+ # ============================================================
193
+ # CHECK 4: Per-worktree test runs
194
+ # ============================================================
195
+
196
+ check_worktree_tests() {
197
+ if [[ "$SKIP_TESTS" == true ]]; then
198
+ check_skip "Worktree tests (--skip-tests)"
199
+ return 0
200
+ fi
201
+
202
+ local worktree_count=0
203
+ local worktree_pass=0
204
+ local worktree_fail=0
205
+
206
+ # Get worktree paths from tasks
207
+ local worktrees
208
+ worktrees="$(jq -r '.tasks[] | select(.worktree != null) | .worktree' "$STATE_FILE" 2>/dev/null | sort -u)"
209
+
210
+ if [[ -z "$worktrees" ]]; then
211
+ check_skip "Worktree tests (no worktree paths in tasks)"
212
+ return 0
213
+ fi
214
+
215
+ while IFS= read -r wt_rel; do
216
+ [[ -z "$wt_rel" ]] && continue
217
+ local wt_path="$REPO_ROOT/$wt_rel"
218
+ worktree_count=$((worktree_count + 1))
219
+
220
+ if [[ ! -d "$wt_path" ]]; then
221
+ check_fail "Worktree tests: $wt_rel" "Directory not found"
222
+ worktree_fail=$((worktree_fail + 1))
223
+ continue
224
+ fi
225
+
226
+ if [[ ! -f "$wt_path/package.json" ]]; then
227
+ check_skip "Worktree tests: $wt_rel (no package.json)"
228
+ continue
229
+ fi
230
+
231
+ if (cd "$wt_path" && npm run test:run 2>/dev/null 1>/dev/null); then
232
+ check_pass "Worktree tests: $wt_rel"
233
+ worktree_pass=$((worktree_pass + 1))
234
+ else
235
+ check_fail "Worktree tests: $wt_rel" "npm run test:run failed"
236
+ worktree_fail=$((worktree_fail + 1))
237
+ fi
238
+ done <<< "$worktrees"
239
+
240
+ return 0
241
+ }
242
+
243
+ # ============================================================
244
+ # CHECK 5: State file consistency
245
+ # ============================================================
246
+
247
+ check_state_consistency() {
248
+ # Verify tasks array has required fields
249
+ local invalid_tasks
250
+ invalid_tasks="$(jq '[.tasks[] | select(.id == null or .status == null)] | length' "$STATE_FILE")"
251
+
252
+ if [[ "$invalid_tasks" -gt 0 ]]; then
253
+ check_fail "State consistency" "$invalid_tasks tasks missing id or status"
254
+ return 1
255
+ fi
256
+
257
+ check_pass "State consistency (all tasks have id and status)"
258
+ return 0
259
+ }
260
+
261
+ # ============================================================
262
+ # EXECUTE CHECKS
263
+ # ============================================================
264
+
265
+ # Check 1: State file — all other checks depend on this
266
+ if check_state_file; then
267
+ # Check 2: Tasks exist
268
+ if check_tasks_exist; then
269
+ # Check 3: All tasks complete
270
+ check_all_tasks_complete || true
271
+
272
+ # Check 4: Per-worktree tests
273
+ check_worktree_tests || true
274
+
275
+ # Check 5: State consistency
276
+ check_state_consistency || true
277
+ fi
278
+ fi
279
+
280
+ # ============================================================
281
+ # STRUCTURED OUTPUT
282
+ # ============================================================
283
+
284
+ echo "## Post-Delegation Results Report"
285
+ echo ""
286
+ echo "**State file:** \`$STATE_FILE\`"
287
+ echo ""
288
+
289
+ # Per-task status table
290
+ if [[ -f "$STATE_FILE" ]] && jq empty "$STATE_FILE" 2>/dev/null; then
291
+ local_task_count="$(jq '.tasks | length' "$STATE_FILE")"
292
+ if [[ "$local_task_count" -gt 0 ]]; then
293
+ echo "### Task Status"
294
+ echo ""
295
+ echo "| Task | Status | Branch |"
296
+ echo "|------|--------|--------|"
297
+ jq -r '.tasks[] | "| \(.id) | \(.status) | \(.branch // "n/a") |"' "$STATE_FILE"
298
+ echo ""
299
+ fi
300
+ fi
301
+
302
+ for result in "${RESULTS[@]}"; do
303
+ echo "$result"
304
+ done
305
+
306
+ echo ""
307
+ TOTAL=$((CHECK_PASS + CHECK_FAIL))
308
+ echo "---"
309
+ echo ""
310
+
311
+ if [[ $CHECK_FAIL -eq 0 ]]; then
312
+ echo "**Result: PASS** ($CHECK_PASS/$TOTAL checks passed)"
313
+ exit 0
314
+ else
315
+ echo "**Result: FAIL** ($CHECK_FAIL/$TOTAL checks failed)"
316
+ exit 1
317
+ fi