v0.8.1 — path-based kindGuess + directory-tree
Correctness fixes to /design-system scan based on real-world testing.
What was broken
EntityCarousel(sitting incomponents/organisms/) was classified as atom because the structural heuristic only looked at composition + prop count- Typed
Textwrappers (7+ props but rendering a single RN primitive) were classified as molecule - The scanner could only see components in hardcoded default folders (
components/,src/components/,app/components/) — components hidden in non-default layouts (atomic-design, feature folders) were invisible
The root cause was the same in all three cases: the scanner ignored stated developer intent encoded in folder placement. Folder kind is the most authoritative signal available; structural inference is a fallback.
What's new
directory-tree.mjs — first script in Act 1. Maps the codebase shape with strict folder-kind recognition:
- Atomic design (
atoms/molecules/organisms/templates/pages) — only when sitting directly under acomponents/root or at top-level. Filters out.specify/templatesand other false positives. - Expo-router
app/and React Navigationscreens/ - Feature folders (
features/<name>/components/) - Component-per-folder vs flat layouts; barrel exports; test/story colocation; naming convention
- Unknown folders (
shared/,primitives/, etc.) surfaced inneedsClarification[]with a reason the agent can quote
component-inventory.mjs upgrades:
- Reads
--tree=path.json(auto-generates if absent) - Component roots derived from
tree.roots.components— invisible-components problem solved - Path-based
kindGuesswins; structural heuristic kept askindStructuralfallback - Per-entry
kindSource,kindConflict,folderKindso disagreement is surfaced rather than hidden missingComponentFolders[]for leaf folders yielding zero components (barrel re-exports, wrapper chains)- Structural fallback improvements: atom prop threshold 4 → 6, single-primitive-wrapper escape (renders only RN built-ins → atom regardless of prop count), molecule threshold raised to 7
design-system-scan.mjs orchestrator:
- Runs
directory-treefirst, threads its path to all downstream scripts - Three new readiness flags:
unknown-folders— count ofneedsClarificationentriesparser-misses— count of missing-component folderskind-conflicts— count of path-vs-structural disagreements
- Terminal output now shows a
treerow with conventions + inline conflict/missing counts on thecomponentsrow
Verified
| Test case | Before | After |
|---|---|---|
EntityCarousel in organisms/ with trivial structure |
atom | organism (path), with kindConflict: true for Act 2 review |
Typed Text wrapping <RNText> with 7 props |
molecule | atom (path AND structural — wrapper escape) |
Barrel-only folder (organisms/EmptyExport/index.ts re-export) |
silently dropped | surfaced in missingComponentFolders |
Component in components/atoms/Button/ (default scan didn't find it) |
invisible | found via tree-derived roots |
.specify/templates/ directory in skill source repo |
false-classified as templates-folder |
filtered (depth + parent check) |
84/84 tests pass.
🤖 Generated with Claude Code