Commit Graph

8 Commits

Author SHA1 Message Date
Affaan Mustafa
b497135b95 fix: correct box() off-by-one width calculation in skill-create-output
The box() helper produced lines that were width+1 characters instead of
the requested width. Adjusted all three formulas (top border, middle
content, bottom border) by -1 each. Added 4 tests verifying box width
accuracy across instincts(), analysisResults(), and nextSteps() output.
2026-02-13 04:05:12 -08:00
Affaan Mustafa
554b5d6704 fix: header subtitle width mismatch in skill-create-output; add 9 tests (Round 34)
- Fix subtitle padding 55→59 so line 94 matches 64-char border width
- Add 4 header width alignment tests (skill-create-output)
- Add 3 getExecCommand non-string args tests (package-manager)
- Add 2 detectFromPackageJson non-string type tests (package-manager)
2026-02-13 03:58:16 -08:00
Affaan Mustafa
167b105cac fix: reject flags passed as package manager names in setup-package-manager CLI
When --global or --project was followed by another flag (e.g., --global --project),
the flag was treated as a package manager name. Added pmName.startsWith('-') check
to both handlers. Added 20 tests across 4 test files covering argument validation,
ensureDir error propagation, runCommand stderr handling, and saveAliases failure paths.
2026-02-13 03:37:46 -08:00
Affaan Mustafa
b3db83d018 test: add 22 tests for validators, skill-create-output, and package-manager edge cases 2026-02-13 03:02:28 -08:00
Affaan Mustafa
5398ac793d fix: clamp progressBar to prevent RangeError on overflow, add 10 tests
progressBar() in skill-create-output.js could crash with RangeError when
percent > 100 because repeat() received a negative count. Fixed by
clamping filled to [0, width].

New tests:
- progressBar edge cases: 0%, 100%, and >100% confidence
- Empty patterns/instincts arrays
- post-edit-format: null tool_input, missing file_path, prettier failure
- setup-package-manager: --detect output completeness, current marker
2026-02-13 02:01:57 -08:00
Affaan Mustafa
5107b3669f fix: box() off-by-one alignment, add 5 tests for readStdinJson and box alignment
- skill-create-output.js: fix top border being 1 char narrower than
  middle/bottom lines (width - title - 5 → width - title - 4)
- Add box alignment regression test verifying all lines have equal width
- Add 4 readStdinJson tests via subprocess (valid JSON, invalid JSON,
  empty stdin, nested objects) — last untested exported utility function
- All 338 tests passing
2026-02-12 16:53:06 -08:00
Affaan Mustafa
64796f99be fix: remove unused imports in test files (ESLint)
- validators.test.js: remove unused execSync (only execFileSync used)
- skill-create-output.test.js: remove unused path module
2026-02-12 16:51:40 -08:00
Affaan Mustafa
924bac4ddf fix: add word boundary to dev server hook regex, fix box() crash, add 27 tests
- hooks.json: add \b word boundary anchors to dev server blocking regex
  to prevent false positives matching "npm run develop", "npm run devtools" etc.
- skill-create-output.js: guard box() horizontal repeat with Math.max(0, ...)
  to prevent RangeError when title exceeds container width
- Add 13 tests for setup-package-manager.js CLI argument parsing
- Add 14 tests for skill-create-output.js SkillCreateOutput class
- All 333 tests passing
2026-02-12 16:46:06 -08:00