@jakkrichm/create-nexus-devflow 2.17.9 → 2.18.0

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.
Files changed (86) hide show
  1. package/README.md +9 -10
  2. package/dist/bin/create-nexus-devflow.js +62 -80
  3. package/dist/bin/create-nexus-devflow.js.map +1 -1
  4. package/dist/lib/doctor.js +0 -27
  5. package/dist/lib/doctor.js.map +1 -1
  6. package/dist/lib/history.js +2 -2
  7. package/dist/lib/history.js.map +1 -1
  8. package/dist/lib/skill-registry-engine.js +3 -3
  9. package/dist/lib/skill-registry-engine.js.map +1 -1
  10. package/dist/lib/tooling/commands/scan-doc-contract.js +1 -0
  11. package/dist/lib/tooling/commands/scan-doc-contract.js.map +1 -1
  12. package/dist/lib/ui.d.ts +0 -23
  13. package/dist/lib/ui.js +0 -85
  14. package/dist/lib/ui.js.map +1 -1
  15. package/dist/lib/update.d.ts +6 -1
  16. package/dist/lib/update.js +78 -7
  17. package/dist/lib/update.js.map +1 -1
  18. package/dist/scripts/prepare-template.js +7 -3
  19. package/dist/scripts/prepare-template.js.map +1 -1
  20. package/package.json +2 -2
  21. package/template/.agents/skills/audit/SKILL.md +1 -4
  22. package/template/.agents/skills/brainstorm/SKILL.md +4 -5
  23. package/template/.agents/skills/bughunter/SKILL.md +1 -1
  24. package/template/.agents/skills/check/SKILL.md +116 -26
  25. package/template/.agents/skills/check/reference/guide.md +17 -53
  26. package/template/.agents/skills/ci/SKILL.md +13 -35
  27. package/template/.agents/skills/complete/SKILL.md +0 -2
  28. package/template/.agents/skills/devflow/SKILL.md +2 -3
  29. package/template/.agents/skills/discovery/SKILL.md +0 -9
  30. package/template/.agents/skills/doctor/SKILL.md +6 -6
  31. package/template/.agents/skills/feature/SKILL.md +1 -4
  32. package/template/.agents/skills/feature/reference/feature-spec-template.md +16 -16
  33. package/template/.agents/skills/fix/SKILL.md +3 -3
  34. package/template/.agents/skills/grill/SKILL.md +1 -6
  35. package/template/.agents/skills/idea/SKILL.md +6 -6
  36. package/template/.agents/skills/implement/SKILL.md +119 -45
  37. package/template/.agents/skills/setup-tests/reference/browser.md +95 -0
  38. package/template/.agents/skills/test/SKILL.md +0 -26
  39. package/template/.claude/skills/audit/SKILL.md +1 -4
  40. package/template/.claude/skills/brainstorm/SKILL.md +4 -5
  41. package/template/.claude/skills/bughunter/SKILL.md +1 -1
  42. package/template/.claude/skills/check/SKILL.md +116 -26
  43. package/template/.claude/skills/check/reference/guide.md +17 -53
  44. package/template/.claude/skills/ci/SKILL.md +13 -35
  45. package/template/.claude/skills/complete/SKILL.md +0 -2
  46. package/template/.claude/skills/devflow/SKILL.md +2 -3
  47. package/template/.claude/skills/discovery/SKILL.md +3 -11
  48. package/template/.claude/skills/doctor/SKILL.md +6 -6
  49. package/template/.claude/skills/feature/SKILL.md +1 -4
  50. package/template/.claude/skills/feature/reference/feature-spec-template.md +16 -16
  51. package/template/.claude/skills/fix/SKILL.md +3 -3
  52. package/template/.claude/skills/grill/SKILL.md +1 -6
  53. package/template/.claude/skills/idea/SKILL.md +6 -6
  54. package/template/.claude/skills/implement/SKILL.md +119 -45
  55. package/template/.claude/skills/setup-tests/reference/browser.md +95 -0
  56. package/template/.claude/skills/test/SKILL.md +0 -26
  57. package/template/AGENTS.md +39 -17
  58. package/template/devflow/build-plan.md +1 -1
  59. package/template/devflow/context/ai-interaction.md +14 -15
  60. package/template/devflow/context/coding-standards.md +19 -68
  61. package/template/devflow/context/glossary.md +6 -26
  62. package/template/devflow/decisions/README.md +1 -15
  63. package/template/devflow/docs/USAGE.md +194 -0
  64. package/template/devflow/docs/diagrams/nexus-devflow-architecture.html +14821 -0
  65. package/template/devflow/docs/diagrams/nexus-devflow-architecture.json +80 -0
  66. package/template/devflow/docs/diagrams/nexus-devflow-lifecycle.html +14860 -0
  67. package/template/devflow/docs/diagrams/nexus-devflow-lifecycle.json +88 -0
  68. package/template/devflow/docs/examples/living-spec/adr.example.md +43 -0
  69. package/template/devflow/docs/examples/living-spec/current-feature.example.md +113 -0
  70. package/template/devflow/docs/examples/living-spec/discovery.example.md +45 -0
  71. package/template/devflow/docs/examples/living-spec/ideas.example.md +22 -0
  72. package/template/devflow/docs/governance-rules.md +39 -0
  73. package/template/devflow/docs/manual-review-workflow-spec.md +116 -0
  74. package/template/devflow/docs/markdown-metadata-contract.md +140 -0
  75. package/template/devflow/docs/quickstart.md +124 -0
  76. package/template/devflow/docs/release-process.md +52 -0
  77. package/template/devflow/docs/skill-selection-policy.md +64 -0
  78. package/template/devflow/docs/workflow-surface-map.md +85 -0
  79. package/template/devflow/reference/feature-spec-template.md +79 -59
  80. package/template/devflow/runs/.gitkeep +1 -0
  81. package/template/.agents/skills/check/reference/verify.md +0 -129
  82. package/template/.agents/skills/explore/SKILL.md +0 -78
  83. package/template/.claude/skills/check/reference/verify.md +0 -129
  84. package/template/.claude/skills/explore/SKILL.md +0 -78
  85. package/template/devflow/reference/help-playbook-protocol.md +0 -33
  86. package/template/devflow/reference/slicing-archetypes.md +0 -105
@@ -1,78 +0,0 @@
1
- ---
2
- name: explore
3
- description: "[devflow] Explore an idea against the actual codebase without changing files. Investigate whether a change would help, compare alternatives and tradeoffs, and discuss uncertainty before deciding whether to plan anything. Use for /explore, considering an idea, or weighing options without writing a spec."
4
- argument-hint: "[<idea or question>]"
5
- ---
6
-
7
- # explore - investigate an idea before deciding to build
8
-
9
- **Context reuse:** Reuse any required file already loaded in project instructions or the current session. Read it again only if absent, changed, or exact current bytes or line references are needed.
10
-
11
- Explore is a read-only conversation grounded in the actual project. It can help
12
- with questions such as whether caching would help a dashboard, whether teams
13
- belong in the product, or which upload approach fits existing code.
14
-
15
- No plans or active feature are required. Do not require `/overview`, invent a
16
- plan, or treat missing DevFlow context as a blocker to discussing the idea.
17
- This command never writes activity state, including `devflow/.state/run.json`.
18
-
19
- ## Start from the question
20
-
21
- Use the supplied topic or relevant conversation context. With neither, ask what
22
- the user wants to investigate. For a vague idea, state a tentative interpretation
23
- and ask a focused question only when its answer changes the investigation.
24
-
25
- Reuse context already loaded in the session. Read relevant project instructions,
26
- code, tests as text, manifests, and existing plans when they help answer the
27
- question. Follow the actual implementation far enough to support your claims;
28
- point to concrete files or symbols. Avoid scanning unrelated parts of the repo.
29
- Read-only Git inspection can establish what exists or is already in progress.
30
-
31
- Authoritative documentation lookup is appropriate when technical uncertainty
32
- needs it. Distinguish documented facts from what this project actually uses.
33
- Missing code or evidence is an uncertainty to explain, not permission to execute
34
- an experiment or to invent current behavior.
35
-
36
- ## Discuss the options
37
-
38
- Keep the conversation proportional to the question. Compare plausible options
39
- against the user's needs and existing project constraints. Include doing nothing
40
- when the current behavior may already be sufficient. Do not invent scale,
41
- security requirements, or new abstractions to justify a change.
42
-
43
- Explain the strongest case against your recommendation and how confident you
44
- are. Separate observed facts, assumptions, and unanswered questions. Say what
45
- evidence could change the recommendation without gathering it through execution.
46
- An unresolved question or a recommendation to leave the project alone is a valid
47
- outcome.
48
-
49
- Use a small diagram in the response when it makes a relationship or tradeoff
50
- clearer. Do not create diagram files. There is no mandatory output template,
51
- report, question count, or next-step checklist. Follow the user's responses and
52
- let the discussion continue as long as useful.
53
-
54
- ## Keep the boundaries clear
55
-
56
- - Never create, edit, or delete files, including specs, plans, notes, generated
57
- output, and activity state. Do not save the conversation into the project.
58
- - Never install dependencies, execute product code, run tests or builds, start
59
- servers, perform browser interactions, or call state-changing tools. Read
60
- source and existing evidence instead of testing a hypothesis by execution.
61
- - Never create or switch branches, commit, merge, push, publish, or deploy.
62
- - Never turn a request to discuss an idea into approval to plan or implement it.
63
- If the user asks for changes, explain the appropriate handoff and keep this
64
- Explore invocation read-only. Do not invoke another command automatically.
65
-
66
- ## Neighbors and handoff
67
-
68
- - `/brief` explains an existing build-plan item, its scope, dependencies, and
69
- size. Explore can discuss an unplanned idea or question a planned approach.
70
- - `/discovery` develops broader product direction and reviewed planning drafts.
71
- Explore does not draft either planning file.
72
- - `/debug` reproduces and isolates an actual failure. Explore discusses options
73
- without executing code to diagnose or verify them.
74
- - `/feature` writes a buildable spec; `/fix` specifies a confirmed small change.
75
- Suggest the appropriate command only when the user is ready to proceed.
76
-
77
- Do not force a handoff at the end of every response. Keep discussing the idea
78
- when that is what the user wants, and leave the project unchanged.
@@ -1,129 +0,0 @@
1
- # Check verification
2
-
3
- **Context reuse:** Reuse any required file already loaded in project instructions or the current session. Read it again only if absent, changed, or exact current bytes or line references are needed.
4
-
5
- Verification activity was started by the dispatcher before loading this reference.
6
-
7
- Where this sits in the workflow:
8
-
9
- /implement -> [check] -> /complete
10
- (built a (run the app, (only once the
11
- step or prove each done-whens are
12
- the feature) done-when) proven)
13
-
14
- `/implement` builds and does a quick build-plus-screenshot check inline. `/check`
15
- is the deeper, repeatable gate for when a "done when" needs the *real running app*,
16
- not just a green build: a click that triggers a download, a route that returns a
17
- file, a flow across screens. Run it on a single step whose done-when is
18
- behavioral, or on the whole feature as the acceptance check before `/complete`.
19
-
20
- The point is evidence. A passing build proves the code compiles; `/check` proves
21
- the thing the spec promised actually happens. It changes no source and commits
22
- nothing - it runs the app and reports what it saw.
23
-
24
- ## Input
25
-
26
- Optional: a specific thing to check (a step, a flow, a URL). With no argument,
27
- verify the whole current feature against every "done when" in
28
- `devflow/context/{xxx-slug}/spec.md`.
29
-
30
- ## Step 1 - build the checklist
31
-
32
- Read `devflow/config.json` first. A missing file means the built-in defaults
33
- apply. If the file exists but is invalid, stop and point the user to `/doctor`.
34
- Configuration never grants permission to start a server or take any other action
35
- that the project instructions or user have not authorized.
36
- The quality-gate config controls automatic invocation only. An explicit `/check`
37
- or `$check` request always runs.
38
-
39
- Read `devflow/context/{xxx-slug}/spec.md`. Pull the observable "done when"
40
- criteria from the build steps (and any acceptance notes in the Testing section).
41
- Turn them into a concrete checklist of claims to prove - each one a specific,
42
- observable behavior, not "it works". If the user named one thing, scope to that.
43
-
44
- If there's no active feature spec, ask what to verify rather than guessing.
45
-
46
- ## Step 2 - get the app running
47
-
48
- Use the project's real commands (see Commands in `AGENTS.md`). Match the project
49
- type:
50
-
51
- - **Web app** - start (or reuse) the dev/preview server, then drive a real browser
52
- to the relevant routes. Prefer reusing an already-running server over starting a
53
- duplicate. If `AGENTS.md` declares `Browser tests: <command>`, run that exact
54
- command as repeatable evidence and use its harness for covered interactions.
55
- Reuse runner-owned server lifecycle instead of starting a duplicate. A green
56
- suite is one evidence source, not proof of claims it does not observe. If no
57
- command is declared but Playwright is already installed, prefer it for browser
58
- driving, screenshots, console errors, and failed request checks. Never install
59
- it from `/check`; use another real-browser evidence path and report what you
60
- used, or point to `/browser-tests` for later optional setup.
61
- - **CLI** - run the actual command(s) with representative inputs.
62
- - **Server/API** - start it and hit the endpoints.
63
- - **Library** - exercise the public API through an example or the test command.
64
-
65
- If a `test` command is declared in `AGENTS.md`, you may run it as *one* input, but
66
- `/check` is broader than unit tests: it checks real behavior, which is exactly the
67
- evidence UI and integration steps ride on instead of unit tests.
68
-
69
- ## Step 3 - exercise each claim
70
-
71
- Drive the app to each checklist item and capture evidence as you go:
72
-
73
- - Navigate and interact for real (click, type, submit, download) - don't assert
74
- from the code what the running app would do.
75
- - Capture **screenshots** for visual/UI claims, **output** for CLI/API claims.
76
- - Watch for **console errors and failed network requests**; a clean-looking screen
77
- with errors in the console is not a pass.
78
-
79
- With `verification.uiEvidence: "required"`, every UI claim needs direct browser
80
- evidence, including a screenshot and the relevant console and network check. If
81
- that evidence path is unavailable, mark the claim unverifiable instead of
82
- passing it from build output. With `when-available`, use the strongest available
83
- evidence and report any gap plainly.
84
-
85
- ### AC-to-Test Traceability Verification:
86
- Cross-reference each Acceptance Criterion (`- [ ] **AC-N**`) in `spec.md` against the test suite's executed assertions and observable evidence:
87
- - Match tagged test cases (e.g. `it('AC-1: ...')`) to their respective criteria.
88
- - Ensure 100% of defined acceptance criteria have empirical proof before issuing a `verified` status.
89
-
90
-
91
- ## Step 4 - report
92
-
93
- Give a short, honest verdict, one line per checklist item:
94
-
95
- [pass] Download PDF saves certificate-<slug>.pdf - file downloaded, opened to the cert
96
- [pass] Both buttons show a loading state - screenshot: loading-state.png
97
- [fail] PDF border missing - printBackground not set; screenshot: pdf-no-border.png
98
- [skip] Vercel render - can't verify locally (feature 9)
99
-
100
- Then state the bottom line: are all the feature's done-whens proven, or not yet.
101
-
102
- - All proven -> update only the `**Status:**` line in
103
- `devflow/context/{xxx-slug}/spec.md` to `verified`, then say it is ready for
104
- `/complete`.
105
- - Anything failed -> update only that status line to `verification failed`, then
106
- hand back to `/implement`; name what to fix. Do not fix it here.
107
- - Anything unverifiable -> update only that status line to `verification
108
- incomplete`, then say why; never report it as a pass.
109
-
110
- The status-line update is generated workflow state, not a product-source edit.
111
- Do not change the spec, checkboxes, findings, or product files from `/check`.
112
-
113
- ## Rules
114
-
115
- - **Observe product behavior, don't repair it.** `/check` changes only the
116
- current spec's status line as described above. It never edits product source,
117
- commits, or merges. Fixing is `/implement`'s job.
118
- - **Evidence or it didn't happen.** Every `pass` is backed by something observed -
119
- a screenshot, output, a response. No assumed passes from reading the code.
120
- - **Honest over green.** "Couldn't verify" and "failed" are valid, useful results.
121
- Faking a pass defeats the entire gate.
122
- - **Check the spec, not vibes.** Verify against the done-whens in
123
- `spec.md`, so "works" means what the spec said it would do.
124
-
125
- ## Formatting
126
-
127
- Format the output to match the project's conventions in
128
- `devflow/context/ai-interaction.md`: concise, scannable markdown, with lists for
129
- enumerations and tables for matrices rather than dense paragraphs.
@@ -1,78 +0,0 @@
1
- ---
2
- name: explore
3
- description: "[devflow] Explore an idea against the actual codebase without changing files. Investigate whether a change would help, compare alternatives and tradeoffs, and discuss uncertainty before deciding whether to plan anything. Use for /explore, considering an idea, or weighing options without writing a spec."
4
- argument-hint: "[<idea or question>]"
5
- ---
6
-
7
- # explore - investigate an idea before deciding to build
8
-
9
- **Context reuse:** Reuse any required file already loaded in project instructions or the current session. Read it again only if absent, changed, or exact current bytes or line references are needed.
10
-
11
- Explore is a read-only conversation grounded in the actual project. It can help
12
- with questions such as whether caching would help a dashboard, whether teams
13
- belong in the product, or which upload approach fits existing code.
14
-
15
- No plans or active feature are required. Do not require `/overview`, invent a
16
- plan, or treat missing DevFlow context as a blocker to discussing the idea.
17
- This command never writes activity state, including `devflow/.state/run.json`.
18
-
19
- ## Start from the question
20
-
21
- Use the supplied topic or relevant conversation context. With neither, ask what
22
- the user wants to investigate. For a vague idea, state a tentative interpretation
23
- and ask a focused question only when its answer changes the investigation.
24
-
25
- Reuse context already loaded in the session. Read relevant project instructions,
26
- code, tests as text, manifests, and existing plans when they help answer the
27
- question. Follow the actual implementation far enough to support your claims;
28
- point to concrete files or symbols. Avoid scanning unrelated parts of the repo.
29
- Read-only Git inspection can establish what exists or is already in progress.
30
-
31
- Authoritative documentation lookup is appropriate when technical uncertainty
32
- needs it. Distinguish documented facts from what this project actually uses.
33
- Missing code or evidence is an uncertainty to explain, not permission to execute
34
- an experiment or to invent current behavior.
35
-
36
- ## Discuss the options
37
-
38
- Keep the conversation proportional to the question. Compare plausible options
39
- against the user's needs and existing project constraints. Include doing nothing
40
- when the current behavior may already be sufficient. Do not invent scale,
41
- security requirements, or new abstractions to justify a change.
42
-
43
- Explain the strongest case against your recommendation and how confident you
44
- are. Separate observed facts, assumptions, and unanswered questions. Say what
45
- evidence could change the recommendation without gathering it through execution.
46
- An unresolved question or a recommendation to leave the project alone is a valid
47
- outcome.
48
-
49
- Use a small diagram in the response when it makes a relationship or tradeoff
50
- clearer. Do not create diagram files. There is no mandatory output template,
51
- report, question count, or next-step checklist. Follow the user's responses and
52
- let the discussion continue as long as useful.
53
-
54
- ## Keep the boundaries clear
55
-
56
- - Never create, edit, or delete files, including specs, plans, notes, generated
57
- output, and activity state. Do not save the conversation into the project.
58
- - Never install dependencies, execute product code, run tests or builds, start
59
- servers, perform browser interactions, or call state-changing tools. Read
60
- source and existing evidence instead of testing a hypothesis by execution.
61
- - Never create or switch branches, commit, merge, push, publish, or deploy.
62
- - Never turn a request to discuss an idea into approval to plan or implement it.
63
- If the user asks for changes, explain the appropriate handoff and keep this
64
- Explore invocation read-only. Do not invoke another command automatically.
65
-
66
- ## Neighbors and handoff
67
-
68
- - `/brief` explains an existing build-plan item, its scope, dependencies, and
69
- size. Explore can discuss an unplanned idea or question a planned approach.
70
- - `/discovery` develops broader product direction and reviewed planning drafts.
71
- Explore does not draft either planning file.
72
- - `/debug` reproduces and isolates an actual failure. Explore discusses options
73
- without executing code to diagnose or verify them.
74
- - `/feature` writes a buildable spec; `/fix` specifies a confirmed small change.
75
- Suggest the appropriate command only when the user is ready to proceed.
76
-
77
- Do not force a handoff at the end of every response. Keep discussing the idea
78
- when that is what the user wants, and leave the project unchanged.
@@ -1,33 +0,0 @@
1
- # Contextual Help Playbook
2
-
3
- **Universal Contextual Help & Playbook Protocol (`help`, `--help`, `-h`, `?`)**:
4
- Whenever any skill or command is invoked with a help keyword or flag (e.g., `/bughunter help`, `bughunter --help`, `/archify -h`, `/check ?`, `/feature help`):
5
- - **Execution Safety Gate**: DO NOT execute the skill's primary or mutating actions (do not launch scans/attacks, do not modify source code, and do not initialize new task runs).
6
- - **Dynamic Workspace Inspection**: Read the target skill in the active adapter. Inspect only workspace files and selected references needed to tailor its examples; reuse current context.
7
- - **Persistent HTML Playbook & Token-Saving Cache**:
8
- - **Output Location & Light Theme Mandate**: Compile and persist the tailored playbook as a standalone, styled HTML report at `devflow/reference/playbooks/{skill}.html` adhering to the **Paper/Ink Light Theme Standard** (`data-theme="light"`, teal accent, ruler corner, terminal mockup UI, and a real diagram). Build the standalone page using these conventions.
9
- - **First Run**: Render the comprehensive 5W1H playbook in chat and write the complete HTML report to `devflow/reference/playbooks/{skill}.html`.
10
- - **Subsequent Invocations (Delta Updates & Zero Token Bloat)**: If `devflow/reference/playbooks/{skill}.html` already exists:
11
- - Inspect the existing HTML file and compute the diff/delta against the current repository state (e.g., new file paths, modified endpoints, or newly installed vendor assets).
12
- - DO NOT repeat unchanged boilerplate or full static content in chat.
13
- - Provide a concise **Delta Summary** in chat (highlighting what changed, new recommendations, or newly available commands).
14
- - In-place update `devflow/reference/playbooks/{skill}.html` with the fresh timestamp and state.
15
- - Provide a clickable link to the actual resolved output file using the active client's supported local-file link format.
16
- - **Render the User-Friendly 5W1H Playbook**: Emit an easy-to-read, practical guide organized around the **5W 1H Framework** (rendered on initial run or updated in the HTML playbook):
17
- 1. **What (Concept & Capabilities)**: Clear, jargon-free summary of what this skill does, its core concept, and its bundled tools/capabilities.
18
- 2. **Why (Problems Solved & Key Benefits)**: The problems it solves, key advantages, and why you should use it instead of ad-hoc manual work.
19
- 3. **Who (Target Roles & Personas)**: Target audience or engineering role (e.g., Feature Developer, Senior QA, Security Auditor, Solo Dev, or Tech Lead).
20
- 4. **Where (Boundaries & Artifact Locations)**: Target workspace boundaries, affected directories, and generated artifact locations (e.g., `devflow/context/`, `devflow/discoveries/`, `findings.md`).
21
- 5. **When (Timing & Prerequisites/Next Steps)**:
22
- - **Timing & Triggers**: Practical situations or milestones when this skill should be invoked.
23
- - **Run Before (Prerequisites)**: What to check, prepare, or run beforehand to get the best result.
24
- - **Run After (Next Steps)**: What DevFlow command or lifecycle stage should follow next (e.g., handing off to `/fix`, `/feature`, or `/complete`).
25
- 6. **How (Execution Lifecycle & Real Command Examples)**:
26
- - **How It Works (Lifecycle)**: Simple, plain-language breakdown of the execution steps or phases.
27
- - **Available Commands & Options**: Common sub-commands, arguments, and flags with brief explanations.
28
- - **Safety, Guardrails & Precautions**: Operational boundaries, credential hygiene, read-only vs. mutating constraints, and explicit special safety constraints / precautions.
29
- 7. **Diagram Slot & Architecture Flow**:
30
- - **Real Diagram Mandate**: MUST embed a real, verified vector SVG or interactive diagram reflecting actual skill lifecycle, state transitions, or threat models in Light Theme (`data-theme="light"`).
31
- - **Thai Language & Legible Typography**: Architecture and flow diagrams must describe workflows and nodes in Thai language while preserving technical identifiers, paths, and commands in English. Typography must be sufficiently sized and legible for Thai script (Headers 13–14px, box content/descriptions 11–12px, line spacing 18–22px) to prevent tone marks and vowels from clipping or overlapping.
32
- - **Strictly No Placeholders**: NEVER output empty placeholder cards, generic instruction text, or phrases like *"when invoking archify..."*. Every playbook must ship with a real visual architectural diagram.
33
- - Always conclude the response with: `"Help menu displayed successfully"`.
@@ -1,105 +0,0 @@
1
- # 🧩 4 Slicing Archetypes Framework
2
-
3
- > คู่มือมาตรฐานการแบ่งขนาดฟีเจอร์ (Feature Slicing & Decomposition) ใน Nexus-DevFlow เพื่อให้แต่ละรอบการส่งมอบ (Feature Run) มีขนาดเล็ก ส่งมอบคุณค่าได้จริง และทดสอบได้รอบด้าน
4
-
5
- ---
6
-
7
- ## 🎯 ทำไมต้องมี Slicing Archetypes?
8
-
9
- ในการพัฒนาซอฟต์แวร์และการทำงานร่วมกับ AI Coding Agents ปัญหาคลาสสิก 2 ประการคือ:
10
- 1. **Slicing by Technical Layer** (เช่น ทำเฉพาะ Database หรือทำเฉพาะ Backend API ก่อน): ทำให้ในรอบนั้นไม่มี UI ให้ทดสอบ หรือไม่สามารถทดสอบแบบ End-to-End ได้
11
- 2. **Oversized Features** (ก้อนใหญ่เกินไป): ทำให้ Context Window เต็มเร็ว AI เริ่มเพี้ยน และการ Review ทำได้ยาก
12
-
13
- **4 Slicing Archetypes** ช่วยให้คุณและ Agent เลือกกลยุทธ์การหั่นงานที่เหมาะสมที่สุดตามเป้าหมายของแต่ละ Milestone:
14
-
15
- ---
16
-
17
- ## 🛹 1. Skateboard Archetype (Minimal Functional Loop)
18
-
19
- > *"อย่าเริ่มสร้างรถยนต์ด้วยการทำล้อ แต่ให้เริ่มด้วยการทำสเก็ตบอร์ดที่พาผู้ใช้เคลื่อนที่ได้จริง"*
20
-
21
- ### นิยาม & วัตถุประสงค์:
22
- - สร้าง Core Business Logic & State Machine ที่ทำงานได้จริงครบ Loop แม้ UI จะเรียบง่ายที่สุด (Minimal UI หรือ Single Route / Basic Form / CLI interface)
23
- - เน้นความถูกต้องของ Logic, Validation, Edge Cases และ Data Flow
24
-
25
- ### เหมาะสำหรับ:
26
- - ฟีเจอร์ที่ Logic ซับซ้อน มีการคำนวณ การแปลงข้อมูล หรือ State transitions หลายขั้นตอน
27
- - ต้องการพิสูจน์ว่าแนวคิดหลัก (Core Mechanism) ทำงานได้จริงก่อนลงทุนตกแต่งหน้าจอ
28
-
29
- ### ตัวอย่าง:
30
- - **Search & Filter**: สร้างหน้าค้นหาที่มี Search Input เรียบๆ และแสดงผลลัพธ์แบบ Text List เพื่อทดสอบ Search Query, Debounce, Pagination และ Filter Logic
31
- - **Payment Processing**: ระบบคำนวณราคาสินค้า ส่วนลด ภาษี และสร้าง Transaction Record โดยยังไม่ต้องมี UI สวยหรู
32
-
33
- ---
34
-
35
- ## 🎭 2. Facade Archetype (Rich UI / Mock-Backed DX)
36
-
37
- > *"สร้างประสบการณ์ใช้งานจริงที่สวยงามและจับต้องได้ โดยเชื่อมต่อกับ Mock Data ก่อนพัฒนา Backend จริง"*
38
-
39
- ### นิยาม & วัตถุประสงค์:
40
- - สร้าง Full Rich Interactive UI, Component Interactions, Micro-animations และ Design System สมบูรณ์แบบ
41
- - จำลอง Data Source ด้วย In-Memory Mock หรือ JSON Fixtures เพื่อเก็บ Feedback เรื่อง UX/DX ทันที
42
-
43
- ### เหมาะสำหรับ:
44
- - ฟีเจอร์ที่เน้นประสบการณ์ผู้ใช้ (UI/UX Heavy), Dashboard, Data Visualization, Complex Multi-step Wizards
45
- - ต้องการให้ Stakeholders / ผู้ใช้เห็นหน้าตาและสัมผัส Flow การกดจริงเพื่อสรุป Design ก่อนลงมือทำ Backend
46
-
47
- ### ตัวอย่าง:
48
- - **Analytics Dashboard**: สร้างชาร์ต กราฟ และ Card KPIs สวยงาม Interactive เต็มรูปแบบโดยอ่านข้อมูลจาก Mock Dataset
49
- - **Interactive Kanban Board**: Drag & drop การ์ด ย้ายคอลัมน์ ปรับแท็กแบบ Real-time บน Local State ก่อนเชื่อมต่อ Database จริง
50
-
51
- ---
52
-
53
- ## 🎯 3. Tracer Bullet Archetype (End-to-End Vertical Slice)
54
-
55
- > *"ยิงกระสุนส่องวิถี ทะลวงผ่านทุกเลเยอร์ของระบบจากบนลงล่าง สำหรับ 1 Happy Path ที่สมบูรณ์"*
56
-
57
- ### นิยาม & วัตถุประสงค์:
58
- - สร้าง Full-Stack Vertical Slice ตั้งแต่ UI -> API Controller -> Service/Logic -> Database Model & Migration สำหรับ **1 Single Happy Path**
59
- - พิสูจน์ Contract, Network Protocol, Serialization, Type Safety และ Infrastructure ทั้งหมดว่าเชื่อมต่อกันได้จริง
60
-
61
- ### เหมาะสำหรับ:
62
- - สถาปัตยกรรมใหม่ หรือเมื่อต้องต่อเชื่อม Third-Party Service, DB ใหม่, หรือ Auth Flow ใหม่
63
- - ต้องการลดความเสี่ยงด้าน Integration Risk ในช่วงต้นของโปรเจกต์
64
-
65
- ### ตัวอย่าง:
66
- - **User Authentication**: สร้าง Registration Form -> Submit API -> Hash Password -> บันทึกลง PostgreSQL DB -> Issue JWT Token -> Redirect ไปหน้า Profile สำหรับกรณีข้อมูลถูกต้อง 1 กรณี
67
- - **Report Export**: กดปุ่ม Export -> Backend Query ข้อมูล -> สร้าง PDF Stream -> Browser ดาวน์โหลดไฟล์สำเร็จ
68
-
69
- ---
70
-
71
- ## 🧭 4. Journey Archetype (Slice by User Workflow / Milestones)
72
-
73
- > *"แบ่งฟีเจอร์ตามขั้นตอนการเดินทางของผู้ใช้งาน (User Journey Steps)"*
74
-
75
- ### นิยาม & วัตถุประสงค์:
76
- - หั่นงานตามลำดับขั้นตอนธรรมชาติของ Business Process (เช่น Stage 1: Onboarding -> Stage 2: Core Activity -> Stage 3: Summary & Export)
77
- - แต่ละชิ้นงานจบในตัว และปลดล็อคขั้นตอนถัดไปใน Journey ของผู้ใช้
78
-
79
- ### เหมาะสำหรับ:
80
- - Workflow ขนาดใหญ่ที่มีหลายสเตจ, Checkout Flows, Multi-step Form Wizard, Approval Pipeline
81
-
82
- ### ตัวอย่าง:
83
- - **E-Commerce Checkout**:
84
- - *Slice 1 (Cart Review)*: หน้าสรุปรายการสินค้าและปรับจำนวน
85
- - *Slice 2 (Shipping & Address)*: แบบฟอร์มกรอกที่อยู่จัดส่งและคำนวณค่าส่ง
86
- - *Slice 3 (Payment & Order Confirmation)*: เลือกวิธีชำระเงินและสรุปใบสั่งซื้อ
87
-
88
- ---
89
-
90
- ## 📊 ตารางเปรียบเทียบและการเลือกใช้งาน (Selection Matrix)
91
-
92
- | Archetype | จุดเน้นหลัก (Focus) | UI Level | Backend / DB | เมื่อไหร่ควรเลือก? |
93
- | :--- | :--- | :---: | :---: | :--- |
94
- | 🛹 **Skateboard** | Core Logic & Flow | Minimal | Real | Logic ซับซ้อน ต้องการความถูกต้องก่อนตกแต่ง |
95
- | 🎭 **Facade** | UX, DX & Interaction | Rich / Complete | Mocked | ต้องการทดสอบ UX / รับ Feedback จากผู้ใช้เร็ว |
96
- | 🎯 **Tracer Bullet** | Full Architecture Path | Functional | Real | ต้องการทดสอบ Integration & Pipeline ทะลุทุกชั้น |
97
- | 🧭 **Journey** | Step-by-Step Workflow | Balanced | Real | Workflow ยาว แบ่งทำทีละสเตจตามลำดับ |
98
-
99
- ---
100
-
101
- ## 💡 แนวทางปฏิบัติใน DevFlow Workflow
102
-
103
- 1. **ใน `/discovery` หรือ `/brainstorm`**: เมื่อวิเคราะห์ฟีเจอร์ใหญ่ ให้เสนอ Archetype ที่แนะนำในการแบ่ง Sub-features
104
- 2. **ใน `/feature` (Step 2 Sizing & Splitting)**: หากต้องแยกฟีเจอร์ย่อย (เช่น 4a, 4b, 4c) ให้ระบุ Archetype กำกับ เช่น `4a. (Tracer Bullet) Core Export Engine` -> `4b. (Facade) Interactive Export Modal & Template Preview`
105
- 3. **ใน Living Spec (`spec.md`)**: ระบุ Archetype ในส่วนหัวของ Spec เพื่อให้ Agent ในขั้นตอน `/implement` ทราบความคาดหวังเรื่องระดับ UI และ Data Source อย่างชัดเจน