Skip to content

feat: refactor waza new to use shared FileWriter #58#66

Merged
github-actions[bot] merged 2 commits into
squad/48-filewriter-init-inventoryfrom
squad/58-new-use-filewriter
Mar 4, 2026
Merged

feat: refactor waza new to use shared FileWriter #58#66
github-actions[bot] merged 2 commits into
squad/48-filewriter-init-inventoryfrom
squad/58-new-use-filewriter

Conversation

@wbreza

@wbreza wbreza commented Mar 4, 2026

Copy link
Copy Markdown
Collaborator

Closes #58 - Depends on #48. Refactored cmd_new.go to use shared FileWriter, removed inline write loop, consistent inventory output. All 25 tests pass.

wbreza and others added 2 commits March 4, 2026 14:52
Replace the inline write loop in cmd_new.go with the shared FileWriter
from internal/scaffold/writer.go. Malformed SKILL.md detection still runs
before FileWriter — the file is removed so FileWriter creates it fresh.

Inventory now uses consistent ➕/✅ emoji indicators (always visible,
not gated behind --verbose), matching the waza init behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot merged commit cb57439 into squad/48-filewriter-init-inventory Mar 4, 2026
2 checks passed
@wbreza wbreza deleted the squad/58-new-use-filewriter branch March 4, 2026 23:14
github-actions Bot pushed a commit that referenced this pull request Mar 5, 2026
* feat: add FileWriter service and refactor waza init inventory #48

- Create internal/scaffold/writer.go with FileWriter type that encapsulates
  the create-if-missing + skip-if-exists pattern
- FileWriter returns structured Inventory with per-entry outcomes (created/skipped)
- Inventory.Fprint() renders aligned table with emoji indicators:
  ➕ for created, ✅ (already exists) for skipped
- Refactor cmd/waza/cmd_init.go to use FileWriter instead of inline write loop
- Inventory is always visible (not gated behind --verbose)
- Add 8 tests in writer_test.go covering: create-if-missing, skip-if-exists,
  mixed outcomes, parent directory creation, inventory output, relative paths,
  empty content handling, and CreatedCount

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: update Linus history with FileWriter work (#48)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat: refactor waza new to use shared FileWriter #58 (#66)

* feat: refactor waza new to use shared FileWriter #58

Replace the inline write loop in cmd_new.go with the shared FileWriter
from internal/scaffold/writer.go. Malformed SKILL.md detection still runs
before FileWriter — the file is removed so FileWriter creates it fresh.

Inventory now uses consistent ➕/✅ emoji indicators (always visible,
not gated behind --verbose), matching the waza init behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore: update squad state for #58

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore: remove .squad/ files from PR branch

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore: remove .squad/ files from PR branch

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: improve error handling in FileWriter stat checks #48

- Directory branch: explicitly handle IsNotExist vs other stat errors
- File branch: detect directory-at-file-path type mismatch
- Both branches: return errors on permission failures instead of masking
- Add regression tests for type-mismatch error paths

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: improve error handling in FileWriter stat checks #48

- Directory branch: explicitly handle IsNotExist vs other stat errors
- File branch: detect directory-at-file-path type mismatch
- Both branches: return errors on permission failures instead of masking
- Add regression tests for type-mismatch error paths

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: improve error handling in FileWriter stat checks #48

- Directory branch: explicitly handle IsNotExist vs other stat errors
- Directory branch: error when path exists but is not a directory
- File branch: detect directory-at-file-path type mismatch
- Both branches: return errors on permission failures instead of masking
- Add regression tests for type-mismatch error paths

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: gofmt writer_test.go

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
spboyer pushed a commit to spboyer/waza-fk that referenced this pull request Mar 5, 2026
…ft#48 (microsoft#63)

* feat: add FileWriter service and refactor waza init inventory microsoft#48

- Create internal/scaffold/writer.go with FileWriter type that encapsulates
  the create-if-missing + skip-if-exists pattern
- FileWriter returns structured Inventory with per-entry outcomes (created/skipped)
- Inventory.Fprint() renders aligned table with emoji indicators:
  ➕ for created, ✅ (already exists) for skipped
- Refactor cmd/waza/cmd_init.go to use FileWriter instead of inline write loop
- Inventory is always visible (not gated behind --verbose)
- Add 8 tests in writer_test.go covering: create-if-missing, skip-if-exists,
  mixed outcomes, parent directory creation, inventory output, relative paths,
  empty content handling, and CreatedCount

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: update Linus history with FileWriter work (microsoft#48)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat: refactor waza new to use shared FileWriter microsoft#58 (microsoft#66)

* feat: refactor waza new to use shared FileWriter microsoft#58

Replace the inline write loop in cmd_new.go with the shared FileWriter
from internal/scaffold/writer.go. Malformed SKILL.md detection still runs
before FileWriter — the file is removed so FileWriter creates it fresh.

Inventory now uses consistent ➕/✅ emoji indicators (always visible,
not gated behind --verbose), matching the waza init behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore: update squad state for microsoft#58

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore: remove .squad/ files from PR branch

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore: remove .squad/ files from PR branch

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: improve error handling in FileWriter stat checks microsoft#48

- Directory branch: explicitly handle IsNotExist vs other stat errors
- File branch: detect directory-at-file-path type mismatch
- Both branches: return errors on permission failures instead of masking
- Add regression tests for type-mismatch error paths

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: improve error handling in FileWriter stat checks microsoft#48

- Directory branch: explicitly handle IsNotExist vs other stat errors
- File branch: detect directory-at-file-path type mismatch
- Both branches: return errors on permission failures instead of masking
- Add regression tests for type-mismatch error paths

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: improve error handling in FileWriter stat checks microsoft#48

- Directory branch: explicitly handle IsNotExist vs other stat errors
- Directory branch: error when path exists but is not a directory
- File branch: detect directory-at-file-path type mismatch
- Both branches: return errors on permission failures instead of masking
- Add regression tests for type-mismatch error paths

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: gofmt writer_test.go

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
chlowell pushed a commit to chlowell/waza that referenced this pull request Mar 5, 2026
- Defines waza platform vision and requirements
- Documents 7 epics with 42 user stories
- Establishes compliance scoring system
- Outlines phased roadmap (Primary/Secondary)

References: microsoft#66 (tracking issue)
Source: squad-proposal.md
chlowell pushed a commit to chlowell/waza that referenced this pull request Mar 5, 2026
- Refocus on waza-go as primary implementation
- Add Go code structure and patterns
- Add project tracking guidance (issue microsoft#66)
- Update CI/CD and branch protection info
- Add epics and priorities reference
- Remove legacy Python-specific content
@spboyer spboyer mentioned this pull request May 23, 2026
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant