@boyingliu01/xp-gate 0.20.0 → 0.20.2

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 (90) hide show
  1. package/adapters/gate-8.sh +115 -73
  2. package/adapters/java.sh +373 -27
  3. package/adapters/powershell.sh +60 -5
  4. package/adapters/python.sh +38 -4
  5. package/build-integrity/__tests__/import-resolver.test.ts +59 -0
  6. package/build-integrity/gate-10.ts +17 -2
  7. package/gate-3.sh +51 -3
  8. package/gate-4.sh +32 -1
  9. package/gate-8.sh +115 -73
  10. package/hooks/gate-3.sh +51 -3
  11. package/hooks/gate-4.sh +32 -1
  12. package/hooks/gate-8.sh +115 -73
  13. package/hooks/pre-commit +404 -62
  14. package/lib/__tests__/doctor-spawn-capability.test.js +116 -0
  15. package/lib/__tests__/doctor-tui-skill-freshness.test.js +49 -10
  16. package/lib/doctor-tui.js +21 -3
  17. package/lib/doctor.js +111 -8
  18. package/lib/gate-audit.ts +3 -0
  19. package/lib/mattpocock-license-verdict.json +1 -1
  20. package/mock-policy/AGENTS.md +4 -4
  21. package/mutation/AGENTS.md +4 -4
  22. package/package.json +2 -2
  23. package/plugins/claude-code/.claude-plugin/plugin.json +1 -1
  24. package/plugins/claude-code/skills/admin-template-guidelines/SKILL.md +1 -0
  25. package/plugins/claude-code/skills/batch-grill-me/SKILL.md +1 -0
  26. package/plugins/claude-code/skills/clipboard-vision/SKILL.md +1 -0
  27. package/plugins/claude-code/skills/delphi-review/AGENTS.md +4 -4
  28. package/plugins/claude-code/skills/domain-modeling/SKILL.md +1 -0
  29. package/plugins/claude-code/skills/grill-with-docs/SKILL.md +1 -0
  30. package/plugins/claude-code/skills/grilling/SKILL.md +1 -0
  31. package/plugins/claude-code/skills/improve-codebase-architecture/SKILL.md +1 -0
  32. package/plugins/claude-code/skills/ralph-loop/SKILL.md +1 -0
  33. package/plugins/claude-code/skills/sprint-flow/AGENTS.md +4 -4
  34. package/plugins/claude-code/skills/test-driven-development/SKILL.md +1 -0
  35. package/plugins/claude-code/skills/test-specification-alignment/AGENTS.md +4 -4
  36. package/plugins/claude-code/skills/test-specification-alignment/SKILL.md +1 -0
  37. package/plugins/claude-code/skills/to-issues/SKILL.md +1 -0
  38. package/plugins/dsh/package.json +1 -1
  39. package/plugins/dsh/skills/admin-template-guidelines/SKILL.md +1 -0
  40. package/plugins/dsh/skills/batch-grill-me/SKILL.md +1 -0
  41. package/plugins/dsh/skills/clipboard-vision/SKILL.md +1 -0
  42. package/plugins/dsh/skills/delphi-review/AGENTS.md +4 -4
  43. package/plugins/dsh/skills/domain-modeling/SKILL.md +1 -0
  44. package/plugins/dsh/skills/grill-with-docs/SKILL.md +1 -0
  45. package/plugins/dsh/skills/grilling/SKILL.md +1 -0
  46. package/plugins/dsh/skills/improve-codebase-architecture/SKILL.md +1 -0
  47. package/plugins/dsh/skills/ralph-loop/SKILL.md +1 -0
  48. package/plugins/dsh/skills/sprint-flow/AGENTS.md +4 -4
  49. package/plugins/dsh/skills/test-driven-development/SKILL.md +1 -0
  50. package/plugins/dsh/skills/test-specification-alignment/AGENTS.md +4 -4
  51. package/plugins/dsh/skills/test-specification-alignment/SKILL.md +1 -0
  52. package/plugins/dsh/skills/to-issues/SKILL.md +1 -0
  53. package/plugins/opencode/package.json +1 -1
  54. package/plugins/opencode/skills/admin-template-guidelines/SKILL.md +1 -0
  55. package/plugins/opencode/skills/batch-grill-me/SKILL.md +1 -0
  56. package/plugins/opencode/skills/clipboard-vision/SKILL.md +1 -0
  57. package/plugins/opencode/skills/delphi-review/AGENTS.md +4 -4
  58. package/plugins/opencode/skills/domain-modeling/SKILL.md +1 -0
  59. package/plugins/opencode/skills/grill-with-docs/SKILL.md +1 -0
  60. package/plugins/opencode/skills/grilling/SKILL.md +1 -0
  61. package/plugins/opencode/skills/improve-codebase-architecture/SKILL.md +1 -0
  62. package/plugins/opencode/skills/ralph-loop/SKILL.md +1 -0
  63. package/plugins/opencode/skills/sprint-flow/AGENTS.md +4 -4
  64. package/plugins/opencode/skills/test-driven-development/SKILL.md +1 -0
  65. package/plugins/opencode/skills/test-specification-alignment/AGENTS.md +4 -4
  66. package/plugins/opencode/skills/test-specification-alignment/SKILL.md +1 -0
  67. package/plugins/opencode/skills/to-issues/SKILL.md +1 -0
  68. package/plugins/qoder/plugin.json +1 -1
  69. package/plugins/qoder/skills/delphi-review/AGENTS.md +4 -4
  70. package/plugins/qoder/skills/sprint-flow/AGENTS.md +4 -4
  71. package/plugins/qoder/skills/test-specification-alignment/AGENTS.md +4 -4
  72. package/principles/AGENTS.md +4 -4
  73. package/principles/adapters/__tests__/java.test.ts +317 -0
  74. package/principles/adapters/java.ts +325 -13
  75. package/principles/boy-scout.ts +36 -6
  76. package/scripts/sync-package-content.js +13 -6
  77. package/skills/admin-template-guidelines/SKILL.md +1 -0
  78. package/skills/batch-grill-me/SKILL.md +1 -0
  79. package/skills/clipboard-vision/SKILL.md +1 -0
  80. package/skills/delphi-review/AGENTS.md +4 -4
  81. package/skills/domain-modeling/SKILL.md +1 -0
  82. package/skills/grill-with-docs/SKILL.md +1 -0
  83. package/skills/grilling/SKILL.md +1 -0
  84. package/skills/improve-codebase-architecture/SKILL.md +1 -0
  85. package/skills/ralph-loop/SKILL.md +1 -0
  86. package/skills/sprint-flow/AGENTS.md +4 -4
  87. package/skills/test-driven-development/SKILL.md +1 -0
  88. package/skills/test-specification-alignment/AGENTS.md +4 -4
  89. package/skills/test-specification-alignment/SKILL.md +1 -0
  90. package/skills/to-issues/SKILL.md +1 -0
@@ -785,12 +785,44 @@ function reportBaselineUpdate(
785
785
  console.log(` preserved:${preserved.length > 0 ? ` ${list(preserved)}` : ' (none)'}`);
786
786
  }
787
787
 
788
+ /**
789
+ * Record budget entries for files the gate meets for the first time, then save
790
+ * and report the write. Split out of `runEnforcement` to keep both under the
791
+ * long-function threshold; also carries the #452 REQ-2 visibility contract:
792
+ * the report distinguishes "created" from "updated" and names every entry the
793
+ * auto-init introduced, never just a count.
794
+ */
795
+ async function autoInitMissingEntries(
796
+ baseline: Record<string, BaselineEntry>,
797
+ missingBaselineEntries: string[],
798
+ currentWarnings: Record<string, number>,
799
+ baselinePath: string,
800
+ baselineExisted: boolean,
801
+ ): Promise<void> {
802
+ recordAutoInitializedEntries(baseline, missingBaselineEntries, currentWarnings);
803
+ await saveBaseline(baselinePath, baseline);
804
+ const action = baselineExisted ? 'updated' : 'created';
805
+ const noun = missingBaselineEntries.length === 1 ? 'entry' : 'entries';
806
+ console.log(`ℹ️ Baseline ${action}: ${baselinePath}`);
807
+ console.log(` auto-initialized ${noun}: ${missingBaselineEntries.join(', ')}`);
808
+ }
809
+
788
810
  async function runEnforcement(newFiles: string[], modifiedFiles: string[], baselinePath: string): Promise<EnforcementResult> {
789
811
  const allFiles = [...newFiles.filter(f => f.trim()), ...modifiedFiles.filter(f => f.trim())];
790
812
  const currentWarnings = await analyzeWarningsForFiles(allFiles);
791
-
813
+
814
+ // Distinguishing "created" from "updated" is part of the auto-init contract
815
+ // (#452 REQ-2): a silently rewritten baseline is how unrelated entries used
816
+ // to vanish without anyone noticing.
817
+ let baselineExisted = false;
818
+ try {
819
+ await fs.access(baselinePath);
820
+ baselineExisted = true;
821
+ } catch {
822
+ baselineExisted = false;
823
+ }
792
824
  const baseline = await loadBaseline(baselinePath);
793
-
825
+
794
826
  // Check for missing baseline entries for modified files
795
827
  const missingBaselineEntries: string[] = [];
796
828
  for (const file of modifiedFiles) {
@@ -798,13 +830,11 @@ async function runEnforcement(newFiles: string[], modifiedFiles: string[], basel
798
830
  missingBaselineEntries.push(file);
799
831
  }
800
832
  }
801
-
833
+
802
834
  // Files being modified for the first time get their current count recorded, so
803
835
  // the next modification is compared against a real budget instead of nothing.
804
836
  if (missingBaselineEntries.length > 0) {
805
- recordAutoInitializedEntries(baseline, missingBaselineEntries, currentWarnings);
806
- await saveBaseline(baselinePath, baseline);
807
- console.log(`ℹ️ Auto-initialized baseline for ${missingBaselineEntries.length} files`);
837
+ await autoInitMissingEntries(baseline, missingBaselineEntries, currentWarnings, baselinePath, baselineExisted);
808
838
  }
809
839
 
810
840
  const deltaResults: DeltaResult[] = [];
@@ -419,7 +419,7 @@ function checkAdapterDrift(srcRootPath, mirrorRootPath) {
419
419
  if (mismatched.length > 0) {
420
420
  console.error(`[drift-check] ERROR: ${mismatched.length} adapter file(s) have drifted (SHA-256 mismatch):`);
421
421
  for (const f of mismatched) console.error(` - ${f}`);
422
- console.error('[drift-check] Fix: Run `node src/npm-package/scripts/sync-package-content.js` (or `npm pack`) to resync.');
422
+ console.error('[drift-check] Fix: Run `node src/npm-package/scripts/sync-package-content.js --fix` to resync (plain invocation is a check-only gate for CI).');
423
423
  }
424
424
 
425
425
  if (srcOnly.length > 0 || mirrorOnly.length > 0 || mismatched.length > 0) {
@@ -449,11 +449,18 @@ function checkDocsDrift(preCommitPath, prePushPath, readmePath, agentsPath) {
449
449
  function main() {
450
450
  console.error(`[sync] repo root: ${REPO_ROOT}`);
451
451
  console.error(`[sync] package root: ${PKG_ROOT}`);
452
- if (checkDocsDrift() === false) {
453
- process.exit(1);
454
- }
455
- if (checkAdapterDrift() === false) {
456
- process.exit(1);
452
+ // Drift gates run BEFORE the sync on purpose: CI's Mirror Parity job relies
453
+ // on a drifted commit failing here rather than being silently healed by the
454
+ // copy loop. Local repair therefore needs the explicit `--fix` escape hatch
455
+ // (the pre-sync "Fix: Run …" advice used to deadlock against this gate).
456
+ const fixMode = process.argv.includes('--fix');
457
+ if (!fixMode) {
458
+ if (checkDocsDrift() === false) {
459
+ process.exit(1);
460
+ }
461
+ if (checkAdapterDrift() === false) {
462
+ process.exit(1);
463
+ }
457
464
  }
458
465
  const skills = syncSkills();
459
466
  const plugins = syncPlugins();
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: admin-template-guidelines
3
+ version: 1.0.0
3
4
  description: "6 maintainability rules for AI-generated admin interfaces (Fastify + Nunjucks + HTMX + Alpine.js). Prevents route bloat, test inconsistency, Nunjucks traps, repeated data logic, auth blind spots, and HTMX/Alpine confusion."
4
5
  maturity: alpha
5
6
  ---
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: batch-grill-me
3
+ version: 1.0.0
3
4
  description: A relentless interview that asks every frontier question at once, round by round.
4
5
  disable-model-invocation: true
5
6
  ---
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: clipboard-vision
3
+ version: 1.0.0
3
4
  description: Use when the user explicitly asks to analyze, describe, OCR, or inspect a single image currently stored in the system clipboard.
4
5
  ---
5
6
 
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-10-07
4
- **Commit:** ff55f35b
5
- **Branch:** fix/batch-defects-20261007
6
- **Version:** 0.20.0.0
3
+ **Generated:** 2026-10-12
4
+ **Commit:** unknown
5
+ **Branch:** unknown
6
+ **Version:** 0.20.2.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, exactly 3 experts with distinct executable model IDs). Supports design, requirements, and code-walkthrough modes.
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: domain-modeling
3
+ version: 1.0.0
3
4
  description: Build and sharpen a project's domain model. Use when the user wants to pin down domain terminology or a ubiquitous language, record an architectural decision, or when another skill needs to maintain the domain model.
4
5
  ---
5
6
 
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: grill-with-docs
3
+ version: 1.0.0
3
4
  description: A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.
4
5
  disable-model-invocation: true
5
6
  ---
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: grilling
3
+ version: 1.0.0
3
4
  description: Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
4
5
  ---
5
6
 
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: improve-codebase-architecture
3
+ version: 1.0.0
3
4
  description: Find deepening opportunities in a codebase, informed by domain language in CONTEXT.md and decisions in ADRs. Use when user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more AI-navigable. Run periodically (weekly or after surges of development).
4
5
  ---
5
6
 
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: ralph-loop
3
+ version: 1.0.0
3
4
  description: Use when executing Sprint-Flow Phase 2 BUILD, processing one REQ, building the next requirement, iterating with clean context, or requiring full regression per requirement.
4
5
  maturity: stable
5
6
  ---
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-10-07
4
- **Commit:** ff55f35b
5
- **Branch:** fix/batch-defects-20261007
6
- **Version:** 0.20.0.0
3
+ **Generated:** 2026-10-12
4
+ **Commit:** unknown
5
+ **Branch:** unknown
6
+ **Version:** 0.20.2.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **6-phase** development pipeline (v2.0 compact redesign, Issue #290): PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE. Phase 3/6 BUILD default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: test-driven-development
3
+ version: 1.0.0
3
4
  description: Use when implementing any feature or bugfix, before writing implementation code
4
5
  ---
5
6
 
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-10-07
4
- **Commit:** ff55f35b
5
- **Branch:** fix/batch-defects-20261007
6
- **Version:** 0.20.0.0
3
+ **Generated:** 2026-10-12
4
+ **Commit:** unknown
5
+ **Branch:** unknown
6
+ **Version:** 0.20.2.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: test-specification-alignment
3
+ version: 1.0.0
3
4
  description: "Use when asked to run tests, verify tests, align tests with specification.yaml, before BUILD verification, or before release/ship."
4
5
  ---
5
6
 
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: to-issues
3
+ version: 1.0.0
3
4
  description: Break a plan, spec, or PRD into independently-grabbable issues using tracer-bullet vertical slices. Use when user wants to convert a plan into issues, create implementation tickets, or break down work into vertical slices. Integrates with XP-Gate sprint-flow Phase 1.
4
5
  ---
5
6