Skip to content

docs(ztd-cli): redefine BFA boundary terminology#782

Open
mk3008 wants to merge 1 commit intomainfrom
779-docs-bfa-を-root-boundary-feature-boundary-sub-boundary-の3層で再定義する

Hidden character warning

The head ref may contain hidden characters: "779-docs-bfa-\u3092-root-boundary-feature-boundary-sub-boundary-\u306e3\u5c64\u3067\u518d\u5b9a\u7fa9\u3059\u308b"
Open

docs(ztd-cli): redefine BFA boundary terminology#782
mk3008 wants to merge 1 commit intomainfrom
779-docs-bfa-を-root-boundary-feature-boundary-sub-boundary-の3層で再定義する

Conversation

@mk3008
Copy link
Copy Markdown
Owner

@mk3008 mk3008 commented Apr 16, 2026

Issue

Customer Value

  • Readers of ztd-cli docs and generated starter guidance can distinguish app-level roots from feature-owned boundaries and optional child boundaries.
  • boundary.ts remains easy to discover where the scaffold uses it, without being mistaken for the definition of BFA itself.

Outcome

  • Reframed the canonical BFA docs around root-boundary, feature-boundary, and sub-boundary.
  • Limited the concrete root-boundary set to src/features, src/adapters, and src/libraries.
  • Clarified that queries/ is a child-boundary container and that boundary.ts is a feature-scoped default convention.
  • Aligned tutorial, template README, prompt guidance, AGENTS guidance, and docs tests with the same vocabulary.

Acceptance Criteria

  • packages/ztd-cli/README.md explains BFA with root-boundary, feature-boundary, and sub-boundary.
  • packages/ztd-cli/templates/src/features/README.md explains the same model and keeps boundary.ts feature-scoped rather than universal.
  • Tutorial, starter README, prompt, and AGENTS text stop teaching universal boundary.ts wording.
  • Docs/tests confirm queries/ is a container, not a public boundary.
  • Docs/tests confirm tests/support/*, src/features/_shared/*, .ztd/*, and db/ are important areas but not root-boundaries.

Verification

  • pnpm --filter @rawsql-ts/ztd-cli test -- tests/sqlFirstTutorial.docs.test.ts tests/directoryFinding.docs.test.ts tests/furtherReading.docs.test.ts tests/init.command.test.ts

Repository Evidence

  • Canonical docs updated in packages/ztd-cli/README.md and packages/ztd-cli/templates/src/features/README.md
  • Derived guidance updated in packages/ztd-cli/templates/README.md, packages/ztd-cli/templates/PROMPT_DOGFOOD.md, packages/ztd-cli/templates/src/features/AGENTS.md, and docs/guide/sql-first-end-to-end-tutorial.md
  • Docs tests updated in packages/ztd-cli/tests/sqlFirstTutorial.docs.test.ts, packages/ztd-cli/tests/directoryFinding.docs.test.ts, packages/ztd-cli/tests/furtherReading.docs.test.ts, and packages/ztd-cli/tests/init.command.test.ts
  • Changeset added in .changeset/tall-kings-dance.md

Supplementary Evidence

  • none

Open Questions

  • none

Merge Blockers

  • none

Summary

  • Reframe ztd-cli BFA docs around root/feature/sub boundaries.
  • Keep boundary.ts as a feature-scoped scaffold convention instead of a universal rule.
  • Lock the new vocabulary with docs tests and a generated prompt assertion.

Verification

  • pnpm --filter @rawsql-ts/ztd-cli test -- tests/sqlFirstTutorial.docs.test.ts tests/directoryFinding.docs.test.ts tests/furtherReading.docs.test.ts tests/init.command.test.ts

Merge Readiness

  • No baseline exception requested.
  • Baseline exception requested and linked below.

Tracking issue: #779
Scoped checks run: pnpm --filter @rawsql-ts/ztd-cli test -- tests/sqlFirstTutorial.docs.test.ts tests/directoryFinding.docs.test.ts tests/furtherReading.docs.test.ts tests/init.command.test.ts
Why full baseline is not required: This PR only updates docs, generated guidance text, and the docs tests that lock those reader-facing contracts.

CLI Surface Migration

  • No migration packet required for this CLI change.
  • CLI/user-facing surface change and migration packet completed.

No-migration rationale: This PR changes documentation vocabulary and generated guidance text only; runtime CLI behavior and scaffold output shape stay the same.
Upgrade note: none
Deprecation/removal plan or issue: none
Docs/help/examples updated: packages/ztd-cli/README.md, packages/ztd-cli/templates/src/features/README.md, packages/ztd-cli/templates/README.md, packages/ztd-cli/templates/PROMPT_DOGFOOD.md, packages/ztd-cli/templates/src/features/AGENTS.md, docs/guide/sql-first-end-to-end-tutorial.md
Release/changeset wording: Added a patch changeset for @rawsql-ts/ztd-cli describing the BFA terminology clarification and the feature-scoped boundary.ts convention.

Scaffold Contract Proof

  • No scaffold contract proof required for this PR.
  • Scaffold contract proof completed.

No-proof rationale: n/a
Non-edit assertion: This PR does not change runtime CLI commands, scaffolded file names, or scaffold output shape; it only redefines the reader-facing BFA vocabulary and generated guidance text.
Fail-fast input-contract proof: Updated docs tests now assert that queries/ is a child-boundary container, the concrete root-boundary set is limited to src/features, src/adapters, and src/libraries, and legacy universal wording is absent from the public docs and generated prompt text.
Generated-output viability proof: tests/init.command.test.ts regenerates PROMPT_DOGFOOD.md and passes with the new feature-scoped guidance, showing the generated starter guidance remains coherent after the terminology change.

Summary by CodeRabbit

  • Documentation

    • Refined architectural guidance with clearer explanations of boundary structure, conventions, and terminology across tutorials, READMEs, and feature documentation.
    • Enhanced consistency in describing feature-scoped boundary concepts and folder organization rules.
  • Tests

    • Expanded validation checks to ensure comprehensive alignment of architectural documentation.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

📝 Walkthrough

Walkthrough

This PR updates documentation across ztd-cli and associated guides to redefine BFA from a boundary.ts-centric model into an explicit three-layer model: root-boundary, feature-boundary, and sub-boundary. It clarifies that only src/features, src/adapters, and src/libraries are concrete root-boundaries, and positions boundary.ts as a scaffold convention rather than the definition of BFA itself.

Changes

Cohort / File(s) Summary
Changesets and Release Notes
.changeset/tall-kings-dance.md
Added changeset entry documenting the BFA vocabulary update for ztd-cli patch release.
Core Documentation
docs/guide/sql-first-end-to-end-tutorial.md, packages/ztd-cli/README.md
Replaced recursive boundary rule with explicit root-boundary / feature-boundary / sub-boundary vocabulary; clarified concrete root-boundaries as src/features, src/adapters, src/libraries only; added exclusions for src/features/_shared/*, tests/support/*, .ztd/*, db/; repositioned boundary.ts as scaffold convention.
Template Guidance
packages/ztd-cli/templates/PROMPT_DOGFOOD.md, packages/ztd-cli/templates/README.md, packages/ztd-cli/templates/src/features/AGENTS.md, packages/ztd-cli/templates/src/features/README.md
Updated feature-scaffold and dogfooding prompts to use three-layer BFA terminology; clarified queries/ as child-boundary container (not public boundary); narrowed boundary.ts default scope to src/features/<feature>/ contexts; added explicit non-root-boundary exclusions.
Documentation Tests
packages/ztd-cli/tests/directoryFinding.docs.test.ts, packages/ztd-cli/tests/furtherReading.docs.test.ts, packages/ztd-cli/tests/init.command.test.ts, packages/ztd-cli/tests/sqlFirstTutorial.docs.test.ts
Added assertions validating that docs define root-boundary / feature-boundary / sub-boundary vocabulary, restrict concrete root-boundaries to three paths, identify queries/ as child-boundary container, and exclude specific directories from root-boundary counts.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Three layers bloom in BFA's garden now,
Root, Feature, Sub—clear boundaries bow.
No more boundary.ts confusion's dance,
Just scaffold convention, at first glance! 🌱

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'docs(ztd-cli): redefine BFA boundary terminology' clearly summarizes the main change: reframing BFA documentation around root/feature/sub-boundary vocabulary instead of the previous boundary.ts-centric approach.
Description check ✅ Passed The PR description is comprehensive and follows the repository template structure, covering Summary, Verification, Merge Readiness, CLI Surface Migration, and Scaffold Contract Proof sections with all required fields completed.
Linked Issues check ✅ Passed The PR fully addresses issue #779's objectives: defines boundary parent concept, establishes three-tier BFA model (root/feature/sub), limits root-boundaries to src/features/src/adapters/src/libraries, clarifies queries/ as child-boundary container, positions boundary.ts as scaffold convention, and updates all docs/tests accordingly.
Out of Scope Changes check ✅ Passed All changes are in-scope documentation and test updates aligned with issue #779 objectives. No runtime CLI behavior or scaffold output changes introduced; changes are purely vocabulary and documentation clarification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 779-docs-bfa-を-root-boundary-feature-boundary-sub-boundary-の3層で再定義する

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/ztd-cli/tests/furtherReading.docs.test.ts (1)

332-333: Harden negative guards across both READMEs for both legacy phrases.

Lines 332-333 only check one legacy phrase per README. A regression could still slip in if the phrase appears in the other README.

🧪 Suggested assertion hardening
-  expect(packageReadme).not.toContain('A folder is a boundary.');
-  expect(scaffoldReadme).not.toContain('Every boundary folder exposes only `boundary.ts`');
+  expect(packageReadme).not.toContain('A folder is a boundary.');
+  expect(packageReadme).not.toContain('Every boundary folder exposes only `boundary.ts`');
+  expect(scaffoldReadme).not.toContain('A folder is a boundary.');
+  expect(scaffoldReadme).not.toContain('Every boundary folder exposes only `boundary.ts`');
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/ztd-cli/tests/furtherReading.docs.test.ts` around lines 332 - 333,
The tests currently only assert each README omits a single legacy phrase; update
the negative guards so both packageReadme and scaffoldReadme are asserted not to
contain both legacy phrases ("A folder is a boundary." and "Every boundary
folder exposes only `boundary.ts`") — locate the assertions using the variables
packageReadme and scaffoldReadme in furtherReading.docs.test.ts and add the
missing not.toContain checks for the other phrase on each README variable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/ztd-cli/README.md`:
- Line 87: The sentence uses the awkward phrase "Features-external code"; update
the wording to something clearer — e.g., replace "Features-external code may
still use `boundary.ts` when it helps locally, but it is not a required filename
outside feature-boundaries and sub-boundaries." with "Code external to a feature
may still use `boundary.ts` when it helps locally, but it is not a required
filename outside feature-boundaries and sub-boundaries." — locate the sentence
referencing `boundary.ts`, `feature-boundaries`, and `sub-boundaries` and apply
this wording change.

---

Nitpick comments:
In `@packages/ztd-cli/tests/furtherReading.docs.test.ts`:
- Around line 332-333: The tests currently only assert each README omits a
single legacy phrase; update the negative guards so both packageReadme and
scaffoldReadme are asserted not to contain both legacy phrases ("A folder is a
boundary." and "Every boundary folder exposes only `boundary.ts`") — locate the
assertions using the variables packageReadme and scaffoldReadme in
furtherReading.docs.test.ts and add the missing not.toContain checks for the
other phrase on each README variable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1a007042-fac9-4ebe-981e-2405bfac47ac

📥 Commits

Reviewing files that changed from the base of the PR and between 34cf4a5 and 8d2af8f.

📒 Files selected for processing (11)
  • .changeset/tall-kings-dance.md
  • docs/guide/sql-first-end-to-end-tutorial.md
  • packages/ztd-cli/README.md
  • packages/ztd-cli/templates/PROMPT_DOGFOOD.md
  • packages/ztd-cli/templates/README.md
  • packages/ztd-cli/templates/src/features/AGENTS.md
  • packages/ztd-cli/templates/src/features/README.md
  • packages/ztd-cli/tests/directoryFinding.docs.test.ts
  • packages/ztd-cli/tests/furtherReading.docs.test.ts
  • packages/ztd-cli/tests/init.command.test.ts
  • packages/ztd-cli/tests/sqlFirstTutorial.docs.test.ts

- If `<tech>` is a family or plural container such as `aws` or `cloud`, treat `src/adapters/<tech>/` as a parent and create child boundaries such as `src/adapters/aws/s3/` and `src/adapters/aws/lambda/`.

Reserve `db/` for DDL, migration, and schema assets only; do not place runtime clients or adapters there.
Features-external code may still use `boundary.ts` when it helps locally, but it is not a required filename outside feature-boundaries and sub-boundaries.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix wording typo in boundary guidance sentence.

Line 87 reads as “Features-external code,” which is awkward in user-facing docs.

✏️ Suggested wording fix
-Features-external code may still use `boundary.ts` when it helps locally, but it is not a required filename outside feature-boundaries and sub-boundaries.
+Feature-external code may still use `boundary.ts` when it helps locally, but it is not a required filename outside feature-boundaries and sub-boundaries.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Features-external code may still use `boundary.ts` when it helps locally, but it is not a required filename outside feature-boundaries and sub-boundaries.
Feature-external code may still use `boundary.ts` when it helps locally, but it is not a required filename outside feature-boundaries and sub-boundaries.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/ztd-cli/README.md` at line 87, The sentence uses the awkward phrase
"Features-external code"; update the wording to something clearer — e.g.,
replace "Features-external code may still use `boundary.ts` when it helps
locally, but it is not a required filename outside feature-boundaries and
sub-boundaries." with "Code external to a feature may still use `boundary.ts`
when it helps locally, but it is not a required filename outside
feature-boundaries and sub-boundaries." — locate the sentence referencing
`boundary.ts`, `feature-boundaries`, and `sub-boundaries` and apply this wording
change.

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.

docs: BFA を root boundary / Feature boundary / Sub-boundary の3層で再定義する

1 participant