@punks/cli 3.1.10 → 3.1.12
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.
- package/dist/BASELINE_CHANGELOG.md +61 -0
- package/dist/CHANGELOG.md +57 -0
- package/dist/data/subagents/manifest.mjs +11 -6
- package/dist/index.js +28 -28
- package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +5 -0
- package/dist/skills/agnostic/docs/writing-beats/LICENSE +21 -0
- package/dist/skills/agnostic/docs/writing-beats/UPSTREAM.md +11 -0
- package/dist/skills/agnostic/docs/writing-fragments/LICENSE +21 -0
- package/dist/skills/agnostic/docs/writing-fragments/UPSTREAM.md +11 -0
- package/dist/skills/agnostic/docs/writing-shape/LICENSE +21 -0
- package/dist/skills/agnostic/docs/writing-shape/UPSTREAM.md +11 -0
- package/dist/skills/agnostic/frontend/frontend-domain-structure/SKILL.md +24 -42
- package/dist/skills/agnostic/frontend/frontend-domain-structure/agents/openai.yaml +1 -1
- package/dist/skills/agnostic/frontend/frontend-domain-structure/references/react/structure.md +51 -78
- package/dist/skills/agnostic/frontend/frontend-domain-structure/references/structure.md +89 -212
- package/dist/skills/agnostic/generic/handoff/LICENSE +21 -0
- package/dist/skills/agnostic/generic/handoff/UPSTREAM.md +11 -0
- package/dist/skills/agnostic/planning/create-plan/REFERENCE.md +1 -1
- package/dist/skills/agnostic/planning/create-plan/SKILL.md +19 -7
- package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +19 -0
- package/dist/skills/agnostic/planning/create-plan/references/planner-task-graph.md +27 -10
- package/dist/skills/agnostic/planning/implement-spec/SKILL.md +6 -2
- package/dist/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +22 -6
- package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +12 -0
- package/dist/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +10 -2
- package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +10 -1
- package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +2 -0
- package/dist/skills/agnostic/quality/autoreview/SKILL.md +11 -2
- package/dist/skills/agnostic/quality/codebase-design/LICENSE +21 -0
- package/dist/skills/agnostic/quality/codebase-design/UPSTREAM.md +11 -0
- package/dist/skills/agnostic/quality/review/LICENSE +21 -0
- package/dist/skills/agnostic/quality/review/SKILL.md +16 -11
- package/dist/skills/agnostic/quality/review/UPSTREAM.md +11 -0
- package/dist/skills/agnostic/quality/tdd/LICENSE +21 -0
- package/dist/skills/agnostic/quality/tdd/UPSTREAM.md +11 -0
- package/dist/skills/agnostic/research/improve-codebase-architecture/LICENSE +21 -0
- package/dist/skills/agnostic/research/improve-codebase-architecture/UPSTREAM.md +11 -0
- package/dist/skills/frameworks/effect/effect/SKILL.md +5 -12
- package/dist/skills/frameworks/effect/effect/references/CONFIG.md +10 -19
- package/dist/skills/frameworks/effect/effect/references/SERVICES_LAYERS.md +3 -63
- package/dist/skills/frameworks/effect/effect/references/TESTING.md +2 -72
- package/dist/skills/frameworks/effect/effect-backend-structure/SKILL.md +12 -29
- package/dist/skills/frameworks/effect/effect-backend-structure/agents/openai.yaml +1 -1
- package/dist/skills/frameworks/effect/effect-backend-structure/references/layout.md +9 -9
- package/dist/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/SKILL.md +199 -0
- package/dist/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/UPSTREAM.md +31 -0
- package/dist/skills/frameworks/sqlalchemy/sqlalchemy-schema-design/agents/openai.yaml +4 -0
- package/dist/skills/languages/python/python-backend-structure/SKILL.md +91 -0
- package/dist/skills/languages/python/python-backend-structure/agents/openai.yaml +4 -0
- package/dist/skills/languages/python/python-design-patterns/SKILL.md +93 -69
- package/dist/skills/languages/python/python-project-structure/SKILL.md +4 -247
- package/dist/skills/phases/delivery-phase/SKILL.md +13 -4
- package/dist/skills/phases/delivery-phase/phases/closeout.md +3 -0
- package/dist/skills/phases/delivery-phase/phases/debug.md +8 -1
- package/dist/skills/phases/delivery-phase/phases/implement.md +11 -2
- package/dist/skills/phases/delivery-phase/phases/review.md +50 -29
- package/dist/skills/phases/delivery-phase/phases/router.md +56 -36
- package/dist/skills/phases/delivery-phase/references/artifact-state.md +8 -2
- package/dist/skills/phases/delivery-phase/references/phase-handoff.md +60 -10
- package/dist/skills/phases/finder-phase/references/root-routing.md +6 -1
- package/dist/skills/phases/prototype-phase/agents/openai.yaml +2 -0
- package/dist/skills/phases/review-phase/AUTHORING-HANDOFF.md +622 -0
- package/dist/skills/phases/review-phase/SKILL.md +11 -42
- package/dist/skills/phases/review-phase/agents/openai.yaml +2 -0
- package/dist/skills/phases/review-phase/phases/prepare-review.md +105 -0
- package/dist/skills/phases/review-phase/phases/retain-report.md +113 -0
- package/dist/skills/phases/review-phase/phases/return-route.md +95 -0
- package/dist/skills/phases/review-phase/phases/router.md +78 -0
- package/dist/skills/phases/review-phase/phases/run-review.md +128 -0
- package/dist/skills/phases/review-phase/references/durable-report.md +153 -0
- package/dist/skills/phases/review-phase/references/runtime-handoff.md +138 -0
- package/dist/skills/phases/review-phase/references/state-graph.md +69 -0
- package/dist/skills/phases/review-phase/references/targets.md +156 -0
- package/dist/skills/phases/review-phase/scripts/review-contract.mjs +819 -0
- package/package.json +56 -2
- package/dist/skills/phases/review-phase/REFERENCE.md +0 -147
|
@@ -33,6 +33,11 @@ If an expected artifact is missing, continue and report it.
|
|
|
33
33
|
Then:
|
|
34
34
|
|
|
35
35
|
- author the requested root, docs, and workspace guidance
|
|
36
|
+
- treat `.devpunks/specs/prompts/**` as the complete prompt-authoring contract; apply every scoped-prompt criterion it contains
|
|
37
|
+
- ground scoped prompts in current code evidence: structure, placement, dependencies, and boundaries first; applied coding conventions second; enforced constraints outrank the nearest stable module-family pattern
|
|
38
|
+
- keep each scoped prompt lean with exact-trigger pointers to co-authored reference content; references disclose content and never create deeper prompt scopes
|
|
39
|
+
- render every selected non-phase skill in a `Skill | What / when` table derived from its complete `SKILL.md`
|
|
40
|
+
- always link `opensrc/README.md` from scoped prompts and read it when work depends on third-party library behavior
|
|
36
41
|
- reconcile only the generated skills, prompts, lint, hooks, scripts, subagents, tools, and wiki assets in scope
|
|
37
42
|
- preserve repo-owned edits and ask before changing project policy
|
|
38
43
|
- run targeted validation for the outputs reconciled
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Matt Pocock
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Upstream provenance
|
|
2
|
+
|
|
3
|
+
Adapted from [`mattpocock/skills`](https://github.com/mattpocock/skills/tree/694fa30311e02c2639942308513555e61ee84a6f/skills/in-progress/writing-beats) at commit:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
694fa30311e02c2639942308513555e61ee84a6f
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The adjacent `LICENSE` is the upstream MIT license retained with this skill.
|
|
10
|
+
|
|
11
|
+
Devpunks adapts the upstream beat-shaping stage for standalone public docs and private docs-ingest artifacts.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Matt Pocock
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Upstream provenance
|
|
2
|
+
|
|
3
|
+
Adapted from [`mattpocock/skills`](https://github.com/mattpocock/skills/tree/694fa30311e02c2639942308513555e61ee84a6f/skills/in-progress/writing-fragments) at commit:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
694fa30311e02c2639942308513555e61ee84a6f
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The adjacent `LICENSE` is the upstream MIT license retained with this skill.
|
|
10
|
+
|
|
11
|
+
Devpunks adapts the upstream writing-fragment stage for standalone public docs and private docs-ingest artifacts.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Matt Pocock
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Upstream provenance
|
|
2
|
+
|
|
3
|
+
Adapted from [`mattpocock/skills`](https://github.com/mattpocock/skills/tree/694fa30311e02c2639942308513555e61ee84a6f/skills/in-progress/writing-shape) at commit:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
694fa30311e02c2639942308513555e61ee84a6f
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The adjacent `LICENSE` is the upstream MIT license retained with this skill.
|
|
10
|
+
|
|
11
|
+
Devpunks adapts the upstream page-shaping stage for standalone public docs and private docs-ingest artifacts.
|
|
@@ -1,55 +1,37 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: frontend-domain-structure
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import boundaries across React, Vue, Svelte, Solid, or other UI frameworks.
|
|
4
|
+
Review frontend domain boundaries, domain granularity, imports, and React component splitting.
|
|
5
|
+
Use when creating or refactoring frontend code, deciding whether a feature or module deserves its
|
|
6
|
+
own domain, replacing flat technical buckets, reviewing React component boundaries, or changing
|
|
7
|
+
framework composition and cross-domain dependencies.
|
|
9
8
|
---
|
|
10
9
|
|
|
11
10
|
# Frontend Domain Structure
|
|
12
11
|
|
|
13
|
-
Use this skill to
|
|
14
|
-
Treat `features/*` and `modules/*` as the main app-local domain containers.
|
|
12
|
+
Use this skill to give frontend behavior one clear domain owner and deliberate boundaries.
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
The [agnostic reference](references/structure.md) is the single source of truth for domain
|
|
15
|
+
classification, layer placement, and dependency rules. Read it for every frontend structure decision.
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
For React scopes, also read the [React addendum](references/react/structure.md). It owns component,
|
|
18
|
+
hook, context, provider, JSX, and behavior-test guidance.
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
## Workflow
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
1. Inspect nearby structure, imports, and project conventions.
|
|
23
|
+
2. Read the agnostic reference and identify each changed behavior's invariant owner.
|
|
24
|
+
3. Scan sibling domains and apply the domain-worthiness classifier before creating or splitting one.
|
|
25
|
+
4. Trace affected public entrypoints and dependency direction recursively.
|
|
26
|
+
5. In React scopes, read the React addendum and review component boundaries at responsibility and test seams.
|
|
27
|
+
6. Complete in the requested mode.
|
|
28
|
+
- For a review or diagnostic request, return findings and a recommended target structure without editing files.
|
|
29
|
+
- Only change files when the user explicitly asks to create, refactor, or implement; then make the smallest coherent move and validate with focused behavior tests and the narrowest relevant static checks.
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
## Completion
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
- Do not move app-specific product features into shared libraries.
|
|
36
|
-
- Avoid root-level generic buckets like `components`, `hooks`, `utils`, `helpers`, or `lib` when code can belong to a domain.
|
|
37
|
-
|
|
38
|
-
## Shared Library Rule
|
|
39
|
-
|
|
40
|
-
Use shared libraries for code reused across app boundaries.
|
|
41
|
-
|
|
42
|
-
- Keep app-local reusable domains in `modules/*`.
|
|
43
|
-
- Keep user-facing product domains in `features/*`.
|
|
44
|
-
- Move only truly shared domains, presentation layers, primitives, tokens, or utilities into shared libraries.
|
|
45
|
-
|
|
46
|
-
In a monorepo, shared packages should still be domain-first internally instead of becoming global buckets.
|
|
47
|
-
|
|
48
|
-
## Use This Skill
|
|
49
|
-
|
|
50
|
-
- Read `references/structure.md`.
|
|
51
|
-
- Add framework-specific references only when the current scope uses that framework.
|
|
52
|
-
- Classify each file by responsibility first.
|
|
53
|
-
- Group by domain second.
|
|
54
|
-
- Organize inside each domain by local technical role only when needed.
|
|
55
|
-
- Keep imports flowing downward: framework composition -> `features` -> `modules` -> shared libraries or shared packages.
|
|
33
|
+
- Review mode finishes when every affected responsibility and boundary is classified, findings cite the
|
|
34
|
+
current evidence, and the recommended target structure resolves each finding.
|
|
35
|
+
- Implementation mode finishes when every changed responsibility has an honest owner, every new boundary
|
|
36
|
+
passes its applicable classifier, affected imports remain deliberate, and focused validation proves the
|
|
37
|
+
changed behavior.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Frontend Domain Structure"
|
|
3
3
|
short_description: "Domain-first frontend structure"
|
|
4
|
-
default_prompt: "Use $frontend-domain-structure to
|
|
4
|
+
default_prompt: "Use $frontend-domain-structure to review frontend domain worthiness, public dependency boundaries, and framework composition. In React scopes, review React component boundaries; split only at a cohesive responsibility boundary evidenced by distinct behavior, meaningful inputs, repeated use, or a focused test seam; keep tiny, private, related JSX local."
|
package/dist/skills/agnostic/frontend/frontend-domain-structure/references/react/structure.md
CHANGED
|
@@ -1,102 +1,75 @@
|
|
|
1
1
|
# React Domain Structure Addendum
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- framework composition
|
|
8
|
-
- `features/*`
|
|
9
|
-
- `modules/*`
|
|
10
|
-
- shared libraries and packages
|
|
11
|
-
|
|
12
|
-
This reference owns React-specific placement for hooks, context, providers, components, route modules, and Next.js route files.
|
|
3
|
+
Read this after the agnostic structure reference when the current scope uses React or a React-based
|
|
4
|
+
framework. The agnostic reference owns domain granularity and dependency direction. This addendum owns
|
|
5
|
+
React component, hook, context, provider, and JSX decisions.
|
|
13
6
|
|
|
14
7
|
## Framework Composition
|
|
15
8
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- `app/` in Next.js App Router
|
|
21
|
-
- `pages/` in Next.js Pages Router or Remix-style route modules
|
|
22
|
-
- `routes/` in TanStack Router, Remix, or file-route setups
|
|
23
|
-
- `src/app/` in app-shell conventions
|
|
9
|
+
Keep route and screen components as thin orchestration shells. They translate framework inputs, invoke
|
|
10
|
+
feature entrypoints, and compose the result. Put reusable UI, state orchestration, query behavior, and
|
|
11
|
+
product workflows with their owning feature or module.
|
|
24
12
|
|
|
25
|
-
|
|
13
|
+
Framework folders vary: `app/`, `pages/`, `routes/`, and screen registries can all be composition layers.
|
|
14
|
+
Follow the framework convention without letting that convention become the product domain model.
|
|
26
15
|
|
|
27
|
-
-
|
|
28
|
-
- `layout.tsx`
|
|
29
|
-
- route modules
|
|
30
|
-
- route-level `loading`, `error`, and `not-found`
|
|
31
|
-
- route metadata
|
|
32
|
-
- tiny route composition wrappers
|
|
16
|
+
## Component-Splitting Classifier
|
|
33
17
|
|
|
34
|
-
|
|
18
|
+
Split by **responsibility and test seam**, not by line count or JSX size. Extract a child when it owns a
|
|
19
|
+
cohesive responsibility with its own behavior, meaningful inputs, repeated use, or focused test seam.
|
|
20
|
+
The parent should become a thin orchestration shell that coordinates named responsibilities.
|
|
35
21
|
|
|
36
|
-
|
|
37
|
-
- data orchestration that belongs to a feature
|
|
38
|
-
- reusable product sections
|
|
39
|
-
- provider setup repeated across routes
|
|
40
|
-
- low-level hooks imported directly by routes when a feature entrypoint should own them
|
|
22
|
+
Choose the extraction by what it owns:
|
|
41
23
|
|
|
42
|
-
|
|
24
|
+
- A display component receives display-ready props and owns rendering or interaction for one coherent
|
|
25
|
+
part of the interface. Shape raw transport data before it reaches this boundary.
|
|
26
|
+
- A custom hook owns cohesive state, query, mutation, or workflow logic whose lifecycle belongs
|
|
27
|
+
together. Keep its returned contract smaller than its implementation mechanics.
|
|
28
|
+
- A model owns pure state transitions, policy, or derived data that does not need React lifecycle.
|
|
29
|
+
- Pure utilities own stateless transformations with no component or hook identity.
|
|
43
30
|
|
|
44
|
-
|
|
31
|
+
Keep tiny, private, related JSX local when its only meaning comes from the parent and it has no distinct
|
|
32
|
+
behavior or test seam. Co-locate tiny related render helpers. Give one a separate file only when it
|
|
33
|
+
develops an independent responsibility that makes the boundary useful.
|
|
45
34
|
|
|
46
|
-
|
|
35
|
+
## Domain Placement
|
|
47
36
|
|
|
48
|
-
|
|
37
|
+
Place extracted components, hooks, models, and utilities under their invariant owner. Technical folders
|
|
38
|
+
such as `components/`, `hooks/`, `context/`, `providers/`, `queries/`, `mutations/`, `models/`, and
|
|
39
|
+
`utils/` are useful only as secondary grouping inside a worthy domain.
|
|
49
40
|
|
|
50
|
-
|
|
51
|
-
- `hooks/`
|
|
52
|
-
- `context/`
|
|
53
|
-
- `providers/`
|
|
54
|
-
- `state/` or `store/`
|
|
55
|
-
- `queries/`
|
|
56
|
-
- `mutations/`
|
|
57
|
-
- `actions/`
|
|
58
|
-
- `forms/`
|
|
59
|
-
- `lib/`
|
|
60
|
-
- `utils/`
|
|
41
|
+
Context and providers follow scope:
|
|
61
42
|
|
|
62
|
-
|
|
43
|
+
- feature-scoped context stays in that feature;
|
|
44
|
+
- app-wide reusable providers stay in an app-local module;
|
|
45
|
+
- cross-app providers belong in a shared package only when they have real cross-app consumers.
|
|
63
46
|
|
|
64
|
-
|
|
47
|
+
Hooks follow the owner of the state, side effect, query, mutation, or workflow they wrap. Display
|
|
48
|
+
components depend on owner-provided contracts rather than reaching through another domain's internals.
|
|
65
49
|
|
|
66
|
-
|
|
50
|
+
## Public React Boundaries
|
|
67
51
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
- `features/dashboard/queries/useDashboardSummary.ts`
|
|
72
|
-
- `modules/auth/providers/AuthProvider.tsx`
|
|
73
|
-
- `modules/auth/hooks/useCurrentUser.ts`
|
|
74
|
-
- `modules/api/lib/httpClient.ts`
|
|
75
|
-
- `modules/ui/components/Button.tsx`
|
|
76
|
-
- `<shared-ui-root>/src/primitives/button.tsx`
|
|
77
|
-
- `<shared-ui-root>/src/brand/components/Logo.tsx`
|
|
52
|
+
Route components import feature or module entrypoints. A feature entrypoint may expose its top-level
|
|
53
|
+
component, public hook, workflow operation, and deliberate types. Consumers stay independent of its
|
|
54
|
+
private component tree, query keys, mutation details, and context implementation.
|
|
78
55
|
|
|
79
|
-
|
|
56
|
+
Apply the agnostic dependency law unchanged: use public entrypoints for cross-domain imports, keep edges
|
|
57
|
+
one-way and acyclic, and use the narrow peer-feature exception only when justified.
|
|
80
58
|
|
|
81
|
-
|
|
82
|
-
- `src/hooks/useCurrentUser.ts`
|
|
83
|
-
- `src/context/SettingsDraftContext.tsx`
|
|
84
|
-
- `src/providers/AuthProvider.tsx`
|
|
85
|
-
- `src/lib/httpClient.ts`
|
|
59
|
+
## Behavior Tests and Validation
|
|
86
60
|
|
|
87
|
-
|
|
61
|
+
Add focused behavior tests at the owning component, hook, model, or feature seam affected by the change:
|
|
88
62
|
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
- Context providers should live where their scope lives: feature-scoped context in `features/*`, app-wide reusable providers in `modules/*`, cross-app providers in shared packages.
|
|
94
|
-
- Hooks follow the same ownership rule as the state or side effect they wrap.
|
|
63
|
+
- component tests cover visible output and user interaction;
|
|
64
|
+
- hook tests cover cohesive lifecycle or state transitions when the hook is the public behavior seam;
|
|
65
|
+
- model tests cover pure rules and transformations;
|
|
66
|
+
- feature tests cover a workflow when coordination across the pieces is the behavior under change.
|
|
95
67
|
|
|
96
|
-
|
|
68
|
+
Choose the narrowest validation that proves the changed responsibility, then run the relevant type,
|
|
69
|
+
lint, or build check for moved exports and imports. Existing architecture checks may supplement this
|
|
70
|
+
proof; this skill does not mandate architecture tests or file-count thresholds. The behavior and its
|
|
71
|
+
dependency boundary determine the split.
|
|
97
72
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
- Are providers app-local modules unless they are feature-specific or shared across apps?
|
|
102
|
-
- Are root-level React technical folders avoided unless the project has an explicit app-shell convention?
|
|
73
|
+
The React review is complete when each extracted unit owns a coherent responsibility, orchestration
|
|
74
|
+
shells stay thin, props cross display-ready boundaries, and focused tests prove the changed behavior at
|
|
75
|
+
its owning seam.
|