macca-method 2.1.2 → 3.0.0-rc.1

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 (89) hide show
  1. package/.agents/macca-lock.json +2 -1
  2. package/.agents/macca-managed-skills.txt +1 -0
  3. package/.agents/skills/_shared/references/additional-skills.md +17 -1
  4. package/.agents/skills/_shared/references/brainstorm-session.md +61 -21
  5. package/.agents/skills/_shared/references/config-mutation.md +58 -18
  6. package/.agents/skills/_shared/references/fix-mode.md +21 -7
  7. package/.agents/skills/_shared/references/human-loop.md +2 -0
  8. package/.agents/skills/_shared/references/implementation-principles.md +4 -0
  9. package/.agents/skills/_shared/references/interaction-contract.md +33 -0
  10. package/.agents/skills/_shared/references/invocation-policy.md +14 -3
  11. package/.agents/skills/_shared/references/language-config.md +24 -4
  12. package/.agents/skills/_shared/references/output-ownership.md +12 -5
  13. package/.agents/skills/_shared/references/planning-principles.md +35 -0
  14. package/.agents/skills/_shared/references/scope-delta.md +21 -0
  15. package/.agents/skills/_shared/references/scope-rules.md +1 -1
  16. package/.agents/skills/_shared/references/skill-catalog.md +30 -13
  17. package/.agents/skills/_shared/references/workspace-safety.md +11 -0
  18. package/.agents/skills/_shared/scripts/config-file.js +132 -0
  19. package/.agents/skills/_shared/scripts/config-validator.js +164 -0
  20. package/.agents/skills/_shared/scripts/read-preferences.js +128 -0
  21. package/.agents/skills/add-feature/SKILL.md +24 -18
  22. package/.agents/skills/brainstorm-api/SKILL.md +24 -23
  23. package/.agents/skills/brainstorm-api/assets/api.template.md +11 -23
  24. package/.agents/skills/brainstorm-architecture/SKILL.md +41 -48
  25. package/.agents/skills/brainstorm-architecture/assets/architecture.template.md +24 -16
  26. package/.agents/skills/brainstorm-prd/SKILL.md +26 -28
  27. package/.agents/skills/brainstorm-prd/assets/PRD.template.md +10 -9
  28. package/.agents/skills/brainstorm-rules/SKILL.md +42 -46
  29. package/.agents/skills/brainstorm-rules/assets/rules.template.md +8 -8
  30. package/.agents/skills/brainstorm-schema/SKILL.md +17 -17
  31. package/.agents/skills/brainstorm-schema/assets/schema.template.md +9 -8
  32. package/.agents/skills/brainstorm-styleguide/SKILL.md +27 -26
  33. package/.agents/skills/brainstorm-styleguide/assets/StyleGuide.template.md +27 -51
  34. package/.agents/skills/brainstorm-task/SKILL.md +53 -37
  35. package/.agents/skills/brainstorm-task/assets/Task.template.md +11 -12
  36. package/.agents/skills/bug-fix/SKILL.md +78 -175
  37. package/.agents/skills/bug-fix/assets/bug-log.template.md +61 -0
  38. package/.agents/skills/code-review/SKILL.md +14 -6
  39. package/.agents/skills/code-review/references/review-checklist.md +24 -44
  40. package/.agents/skills/developer/SKILL.md +23 -25
  41. package/.agents/skills/developer/references/close-phase.md +11 -6
  42. package/.agents/skills/developer/references/execute-task.md +15 -8
  43. package/.agents/skills/developer/references/onboarding.md +16 -19
  44. package/.agents/skills/help/SKILL.md +49 -49
  45. package/.agents/skills/meet/SKILL.md +37 -85
  46. package/.agents/skills/quick-dev/SKILL.md +40 -75
  47. package/.agents/skills/release-readiness/SKILL.md +1 -1
  48. package/.agents/skills/setup-macca-method/SKILL.md +79 -0
  49. package/.agents/skills/spec-audit/SKILL.md +21 -17
  50. package/.agents/skills/spec-compliance/SKILL.md +36 -18
  51. package/.agents/skills/spec-init/SKILL.md +53 -22
  52. package/CHANGELOG.md +31 -0
  53. package/README.md +92 -1195
  54. package/bin/macca-method.js +833 -286
  55. package/docs/configuration.md +174 -0
  56. package/docs/troubleshooting.md +180 -0
  57. package/docs/workflows.md +175 -0
  58. package/package.json +48 -4
  59. package/scripts/lib/npm-command.js +76 -0
  60. package/scripts/test-cli-setup.js +869 -0
  61. package/scripts/test-config.js +320 -0
  62. package/scripts/test-install.js +63 -28
  63. package/scripts/test-installer-safety.js +545 -0
  64. package/scripts/test-npm-command.js +143 -0
  65. package/scripts/test-package-safety.js +252 -0
  66. package/scripts/test-preferences.js +475 -0
  67. package/scripts/test-upgrade-legacy.js +11 -21
  68. package/scripts/validate-docs.js +166 -0
  69. package/scripts/validate-package.js +285 -0
  70. package/scripts/validate-skill-behavior.js +914 -12
  71. package/.agents/skills/antislop-copywriting/SKILL.md +0 -372
  72. package/.agents/skills/skill-creator/LICENSE.txt +0 -202
  73. package/.agents/skills/skill-creator/SKILL.md +0 -485
  74. package/.agents/skills/skill-creator/agents/analyzer.md +0 -274
  75. package/.agents/skills/skill-creator/agents/comparator.md +0 -202
  76. package/.agents/skills/skill-creator/agents/grader.md +0 -223
  77. package/.agents/skills/skill-creator/assets/eval_review.html +0 -146
  78. package/.agents/skills/skill-creator/eval-viewer/generate_review.py +0 -471
  79. package/.agents/skills/skill-creator/eval-viewer/viewer.html +0 -1325
  80. package/.agents/skills/skill-creator/references/schemas.md +0 -441
  81. package/.agents/skills/skill-creator/scripts/__init__.py +0 -0
  82. package/.agents/skills/skill-creator/scripts/aggregate_benchmark.py +0 -401
  83. package/.agents/skills/skill-creator/scripts/generate_report.py +0 -326
  84. package/.agents/skills/skill-creator/scripts/improve_description.py +0 -247
  85. package/.agents/skills/skill-creator/scripts/package_skill.py +0 -136
  86. package/.agents/skills/skill-creator/scripts/quick_validate.py +0 -103
  87. package/.agents/skills/skill-creator/scripts/run_eval.py +0 -310
  88. package/.agents/skills/skill-creator/scripts/run_loop.py +0 -328
  89. package/.agents/skills/skill-creator/scripts/utils.py +0 -47
@@ -9,6 +9,8 @@ metadata:
9
9
 
10
10
  # Add Feature
11
11
 
12
+ Read `../_shared/references/planning-principles.md` before impact analysis and recommendations. Add only the approved feature and necessary supporting controls, not speculative infrastructure or adjacent features. Deferred suggestions are not task authorization.
13
+
12
14
  ## Shared Runtime Setup
13
15
 
14
16
  Paths written as `../...` below are relative to this SKILL.md's own folder, not the project's working directory - resolve them as a sibling of the folder that contains this file.
@@ -18,7 +20,9 @@ At startup:
18
20
  1. Read `../_shared/references/language-config.md`.
19
21
  2. Read `../_shared/references/output-ownership.md`.
20
22
  3. Read `../_shared/references/scope-rules.md`.
21
- 4. Use `languagePreferences.communication.normalized` for feature analysis and reports.
23
+ 4. Use the resolved communication language from `language-config.md` for feature analysis and reports.
24
+
25
+ Follow `interaction-contract.md`, loaded automatically through `language-config.md`, for compact reports and handoff context. Reuse cached reads only when unchanged and backed by current evidence; refresh changed, stale, or uncertain applicable sections.
22
26
 
23
27
  ---
24
28
 
@@ -34,10 +38,10 @@ You are a **Product Engineer** adding features to a running project. Do not star
34
38
 
35
39
  **Workflow:**
36
40
 
37
- - Read all existing specs first
41
+ - Establish fresh evidence for applicable spec sections and their material dependencies
38
42
  - Identify the impact on each document
39
43
  - Update ALL impacted specs (required)
40
- - Add a phase and tasks to Task.md
44
+ - Delegate all Task.md authoring to `brainstorm-task`
41
45
  - Hand off to `developer`
42
46
  - Use a subagent for deep codebase analysis or implementation-pattern research
43
47
 
@@ -45,7 +49,7 @@ You are a **Product Engineer** adding features to a running project. Do not star
45
49
 
46
50
  ## Step 0: Get the Feature Description
47
51
 
48
- Ask the user:
52
+ Reuse the supplied feature description and current approval first. On an approval reply such as "oke mari perbaiki", resume the approved bounded update without onboarding or asking for the description again. Ask only missing material information:
49
53
 
50
54
  ```
51
55
  Describe the new feature:
@@ -55,13 +59,13 @@ Describe the new feature:
55
59
  - Why it is needed: [problem it solves]
56
60
  ```
57
61
 
58
- If the user gives a free-form description, extract the relevant information and confirm understanding before continuing.
62
+ If the user gives a free-form description, extract the relevant information; clarify only gaps or conflicts. Use the impact-analysis approval for confirmation rather than adding a redundant gate.
59
63
 
60
64
  ---
61
65
 
62
- ## Step 1: Read All Existing Specs
66
+ ## Step 1: Establish Fresh Applicable Spec Context
63
67
 
64
- Read every existing file in `project-context/`:
68
+ Inventory document roles, then read fresh applicable sections and dependencies from `project-context/`:
65
69
 
66
70
  - `PRD.md`
67
71
  - `architecture.md`
@@ -71,7 +75,7 @@ Read every existing file in `project-context/`:
71
75
  - `StyleGuide.md`
72
76
  - `Task.md` _(if it exists; otherwise it will be created by brainstorm-task)_
73
77
 
74
- Read everything that exists. Skip nothing. Note the ID patterns in use (`FEAT-*`, `BR-*`, `DATA-*`, `API-*`, etc.).
78
+ Assess every document's applicability and potential impact, but do not indiscriminately reread unrelated text. Reuse cached reads only when unchanged and backed by current evidence; refresh affected or uncertain sections. Note the ID patterns in use (`FEAT-*`, `BR-*`, `DATA-*`, `API-*`, etc.) and existing completion evidence. Resolve scope from explicit user context or saved scope; if absent, announce the fullstack working default without persisting it as consent. Persist only user-provided scope through `config-mutation.md`, clarifying conflicts first.
75
79
 
76
80
  ---
77
81
 
@@ -104,7 +108,7 @@ Impact analysis for "[feature name]":
104
108
  New phase: Phase [N+1] — [phase name]
105
109
  ```
106
110
 
107
- Pause for user confirmation. If the user corrects the analysis, adjust it before continuing.
111
+ Obtain approval of the bounded impact analysis before writing. Reuse an explicit approval already covering that same scope; pause only for a materially new decision, changed scope, or conflict. If the user corrects the analysis, adjust it before continuing.
108
112
 
109
113
  ---
110
114
 
@@ -127,7 +131,7 @@ For each **IMPACTED** document, update it in this order:
127
131
  - **Make additions clear** — place them logically; no special tags are needed
128
132
  - **Preserve old IDs** — assign new IDs for new items using the existing pattern
129
133
 
130
- After each update:
134
+ After the bounded updates, report changed sections and IDs together rather than repeating a report after every file:
131
135
 
132
136
  ```
133
137
  ✅ PRD.md updated
@@ -142,9 +146,9 @@ After each update:
142
146
 
143
147
  Call `brainstorm-task` to add a phase and tasks to `Task.md`.
144
148
 
145
- **Do not create tasks manually.** The `brainstorm-task` skill:
149
+ **Delegate all Task.md authoring to brainstorm-task**, whether the file exists or is missing. Do not create tasks manually, edit existing tasks, or update counts/traceability here. The `brainstorm-task` skill:
146
150
 
147
- - Performs deep analysis of the updated specs
151
+ - Analyzes fresh applicable sections of the updated specs and their material dependencies
148
152
  - Ensures task dependencies are ordered correctly
149
153
  - Creates testable acceptance criteria
150
154
  - Preserves consistency with existing phases
@@ -152,7 +156,9 @@ Call `brainstorm-task` to add a phase and tasks to `Task.md`.
152
156
  Provide context:
153
157
 
154
158
  - If `Task.md` exists: "Add a new phase for this feature (do not rewrite everything)"
155
- - If `Task.md` does not exist: "Create Task.md from scratch using all specs"
159
+ - If `Task.md` does not exist: "Create `project-context/Task.md` using applicable approved specs and brownfield classification; do not recreate existing verified work"
160
+ - In both cases carry **approved scope, IDs, changed sections, evidence freshness**, current input evidence, unresolved decisions, preserved completion history, and the exact Task-authoring authorization. Include settled priority/granularity/execution preferences so the receiver asks only missing material questions.
161
+ - The receiver validates freshness and reads affected sections and dependencies; unchanged current evidence may be reused. New decisions or conflicts return to the owner. A task-planning handoff is not implementation authorization.
156
162
 
157
163
  Reference format (informational only; `brainstorm-task` decides the actual tasks):
158
164
 
@@ -179,9 +185,9 @@ After everything is complete:
179
185
  Feature "[name]" is ready to build.
180
186
 
181
187
  Updated Specs:
182
- - ✅ PRD.md — [change summary]
183
- - ✅ schema.md — [change summary]
184
- - ✅ api.md — [change summary]
188
+ - ✅ `project-context/PRD.md` — [change summary]
189
+ - ✅ `project-context/schema.md` — [change summary]
190
+ - ✅ `project-context/api.md` — [change summary]
185
191
 
186
192
  New Tasks:
187
193
  - Phase [N]: [name] — [number of tasks] tasks
@@ -193,9 +199,9 @@ To start building, call `developer`.
193
199
 
194
200
  ## Required Rules
195
201
 
196
- 1. **Read all specs before impact analysis** — no assumptions
202
+ 1. **Establish fresh applicable evidence before impact analysis** — assess each document's impact, reuse unchanged current evidence, and refresh affected sections
197
203
  2. **Every impacted spec MUST be updated** — no exceptions
198
- 3. **Get user approval after impact analysis** — before making changes
204
+ 3. **Get user approval after impact analysis** — before making changes; reuse an existing explicit approval for the same bounded scope
199
205
  4. **Preserve unrelated content** — update stale affected statements instead of appending contradictions
200
206
  5. **Update Task.md last** — via `brainstorm-task` after all specs are done
201
207
  6. **Acceptance criteria must be testable** — not vague descriptions
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: brainstorm-api
3
- description: Interviews users and generates `api.md` for REST, GraphQL, RPC/tRPC, event-driven, or mixed contracts, including lifecycle and reliability. Use only when the user explicitly requests an API contract after applicable architecture/data decisions.
3
+ description: Creates or updates `api.md` for REST, GraphQL, RPC/tRPC, event-driven, or mixed contracts, including lifecycle and reliability. Use after applicable architecture/data decisions for explicit API planning, targeted completion/update user intent, or an authorized owner handoff, including spec-init Missing Decisions and approved technical sync.
4
4
  compatibility: Requires the complete MACCA-METHOD collection with sibling _shared resources and workspace file access.
5
5
  metadata:
6
6
  persona: "Fachri"
@@ -43,21 +43,21 @@ Before any interview:
43
43
  2. Read `../_shared/references/config-mutation.md`.
44
44
  3. Read `../_shared/references/brainstorm-session.md`.
45
45
  4. Read `../_shared/references/scope-rules.md`.
46
- 5. Use `languagePreferences.communication.normalized` for chat.
47
- 6. Use `languagePreferences.documents.normalized` for the final `project-context/api.md`.
46
+ 5. Use the resolved communication language from `language-config.md` for chat.
47
+ 6. Use the resolved document language from `language-config.md` for the final `project-context/api.md`.
48
48
  7. Apply `brainstormPreferences.discussionMode`, `recommendations`, and `discoveryDepth` using the shared session policy.
49
49
 
50
50
  ---
51
51
 
52
52
  ## How to Use This Skill
53
53
 
54
- 1. Load after the schema is complete, or right after architecture if user scope = `frontend` and the API is documented only as a consumer contract.
54
+ 1. Select the mode in `../_shared/references/brainstorm-session.md` before startup questions. Baseline-completion, targeted update, and approved technical sync take precedence over the new-document interview below. **Architecture is required; schema is required only for a persisted-data dependency in scope.** Otherwise record schema as `N/A`: a stateless provider API is valid without schema, as is a frontend consumer contract. If an applicable dependency is unresolved, route that decision to its owner rather than inventing a schema or silently bypassing it.
55
55
 
56
56
  2. **Read existing project-context**:
57
57
  - `project-context/PRD.md` — features that need endpoints
58
58
  - `project-context/architecture.md` — tech stack and API pattern (REST/GraphQL/tRPC)
59
- - `project-context/schema.md` — tables and fields available for endpoints
60
- - If `.agents/developer-config.json` exists, read `developerPreferences.scope`
59
+ - `project-context/schema.md` — read relevant entities and fields only when the API has a persisted-data dependency in scope; provider/full mode alone does not require schema
60
+ - Read the configured scope value from the safe preference summary under `language-config.md`
61
61
 
62
62
  3. Determine API contract mode from scope:
63
63
  - `frontend` → **consumer contract mode**
@@ -73,12 +73,16 @@ Before any interview:
73
73
 
74
74
  6. Run the interview in the chosen mode. Wait for answers.
75
75
 
76
- 7. After all topics, create `project-context/api.md`.
77
-
78
- > ⚠️ **If the file already exists:** "(A) Overwrite all, (B) Cancel and review first."
76
+ 7. In new-document mode, complete applicable discovery and create `project-context/api.md`. For an existing file, follow the selected bounded mode; retain evidence, confidence, IDs, unrelated unknowns, and unrelated text. Regenerate only on an explicit request with approval of the named replacement.
79
77
 
80
78
  8. Summarize the result and suggest next steps based on scope.
81
79
 
80
+ ## Domain Applicability: Smallest Sufficient Contract
81
+
82
+ Apply the shared planning principles loaded by `brainstorm-session.md`. Reuse the approved architecture and one adequate existing protocol. Additional protocols/components need a current requirement, why native/existing alternatives are insufficient, implementation/operating cost, and a concrete escalation trigger. Base choices on actual consumers, expected scale, team, budget, and operations.
83
+
84
+ Derive operations only from approved flows, not automatic CRUD for every entity. Do not add speculative versions, webhooks, pagination, queues, or endpoints for possible future consumers. Critical depth means deeper contract/failure questions, not more infrastructure. Use native limits, retries, and idempotency where actual abuse, duplicate effects, or delivery risks demand them; retain required authentication, authorization, validation, and recovery safeguards. Missing mandatory decisions stay unresolved rather than `N/A`.
85
+
82
86
  ## Interview Topics (5 Topics)
83
87
 
84
88
  Ask all five topics using the selected batch size. First determine the API style from `architecture.md`: REST, GraphQL, tRPC/RPC, event-driven, or mixed. Use protocol-neutral terms until that choice is known.
@@ -93,17 +97,17 @@ Protocol mapping:
93
97
 
94
98
  ### 1. Entry Point, Versioning, Auth & Contract Status
95
99
 
96
- _"What is the API entry point and protocol? How is compatibility/versioning handled? How do users authenticate? Is the contract confirmed, proposed, or mock-only?"_
100
+ _"What existing entry point and protocol serve the approved consumers? What compatibility and access requirements apply? Is the contract confirmed, proposed, or mock-only?"_
97
101
 
98
102
  Collect:
99
103
 
100
104
  - Entry point appropriate to the selected protocol (base URL, GraphQL endpoint, RPC router, channel/broker)
101
- - Compatibility/versioning strategy appropriate to the protocol
102
- - Deprecation policy for external consumers: support window, notice channel, replacement operation, and sunset criteria
103
- - Authentication/identity transport appropriate to the protocol
105
+ - Compatibility requirements; explicit versioning only where consumer lifecycle requires it
106
+ - Deprecation policy when external consumer commitments require one: support window, notice channel, replacement operation, and sunset criteria
107
+ - Authentication/identity transport when required by access rules
104
108
  - Does cookie/session auth need CSRF protection?
105
- - Token lifetime, refresh, rotation, logout behavior
106
- - Standard response wrapper format (for example `{ success, data, message, meta }`)
109
+ - Token lifetime, refresh, rotation, logout behavior when the chosen auth contract uses them
110
+ - Existing/protocol-native response shape; custom wrappers only for an approved contract need
107
111
  - Contract status by area: `confirmed`, `proposed`, `mock-only`, `backend-owned`, `pending backend confirmation`
108
112
 
109
113
  ### 2. Error Catalog
@@ -113,7 +117,7 @@ _"What is the error format for the selected protocol? For REST, which HTTP statu
113
117
  Collect:
114
118
 
115
119
  - Consistent error response structure
116
- - Meaning of HTTP status codes:
120
+ - For REST, select only applicable HTTP status codes; this is a reference menu:
117
121
  - `400` Bad Request — input validation failed
118
122
  - `401` Unauthorized — not logged in / token expired
119
123
  - `403` Forbidden — logged in but lacks permission
@@ -145,7 +149,7 @@ Collect by selected protocol:
145
149
  - **GraphQL:** operation name/type, arguments, selection/result type, union/error behavior
146
150
  - **RPC/tRPC:** procedure type/name, typed input/output, typed errors
147
151
  - **Event-driven:** channel/topic, producer/consumer, payload, key/order, delivery and retry semantics
148
- - **All modes:** field constraints, authorization/ownership, idempotency/replay, upload/payload limits, and real examples
152
+ - **All modes:** field constraints, applicable authorization/ownership, and real examples; idempotency/replay and upload/payload limits as actual risks require
149
153
 
150
154
  ### 5. Pagination, Filtering, Rate Limiting & Abuse Protection
151
155
 
@@ -168,15 +172,12 @@ Adapt only sections that are applicable and preserve every required contract fro
168
172
  ## After api.md Is Created
169
173
 
170
174
  1. Confirm the file was created successfully
171
- 2. Ask about UI/style guide:
172
- - _"Does this project have a UI? Define a style guide?"_
173
- - If yes and scope includes frontend/UI: `brainstorm-styleguide` → `brainstorm-rules` → `brainstorm-task`
174
- - If no: `brainstorm-rules` → `brainstorm-task`
175
+ 2. Reuse known UI applicability; ask only if unresolved. Recommend one next step using `brainstorm-session.md`: applicable unfinished StyleGuide, then rules after all applicable inputs, then tasks. For bounded updates, return approved scope, IDs, changed sections, and evidence freshness to the caller.
175
176
 
176
177
  ## Important Notes
177
178
 
178
179
  - **Error Catalog (topic 2) and security/abuse protection (topic 5)** are often skipped. Do not skip them.
179
180
  - Ask by resource, not all endpoints at once.
180
- - Always ask for real JSON examples. AI infers structure from examples.
181
- - If the user is unclear, suggest standard CRUD endpoints from `schema.md`.
181
+ - Ask for real protocol-native examples where they clarify the contract; do not impose JSON on every protocol.
182
+ - If the user is unclear and recommendations are enabled, suggest operations from approved requirements and applicable evidence. Use `schema.md` only for persisted-data dependencies; do not invent CRUD or persistence for a stateless API.
182
183
  - Render the final document in the configured document language
@@ -1,5 +1,7 @@
1
1
  # API Documentation
2
2
 
3
+ > **Authoring note:** This is a placeholder menu, not a checklist to build. Keep only contracts required by approved current flows and security/recovery obligations; prune inapplicable sections or mark `N/A` with a reason. Unknown mandatory decisions remain open, not `N/A`. Reuse the approved architecture and one adequate existing protocol. No automatic CRUD, versioning, webhooks, pagination, queues, or future-consumer endpoints. New components need a current requirement, why native/existing options are insufficient, cost within scale/team/budget/operations constraints, and a concrete escalation trigger. Critical depth deepens questions; native limits, retries, and idempotency apply where actual risk demands them.
4
+
3
5
  ## Document Role
4
6
 
5
7
  - **Source of Truth:** External API or integration contract for this project
@@ -22,14 +24,14 @@
22
24
 
23
25
  - **Style:** REST / GraphQL / RPC-tRPC / Event-driven / Mixed
24
26
  - **Entry Point:** [base URL / endpoint / router / broker/topic namespace]
25
- - **Versioning:** [strategy and current version]
26
- - **Deprecation:** [notice channel, support window, replacement, sunset criteria]
27
+ - **Compatibility / Versioning:** [actual consumer commitments; explicit versions only if needed]
28
+ - **Deprecation:** [notice/support/replacement/sunset only when consumer commitments require them]
27
29
 
28
30
  ## Authentication and Security Controls
29
31
 
30
32
  - **Authentication:** [method and transport]
31
33
  - **Authorization:** [role/ownership summary]
32
- - **Sensitive Operations:** [login / password reset / upload / webhook / payment / admin actions]
34
+ - **Sensitive Operations:** [actual approved operations requiring protection]
33
35
  - **CSRF / Replay / Signature / Idempotency:** [applicable controls]
34
36
  - **Rate / Concurrency Limits:** [limit and client-visible signals]
35
37
 
@@ -41,7 +43,7 @@
41
43
 
42
44
  ## Reliability and SLO
43
45
 
44
- - **Latency Target:** [p95/p99 or N/A]
46
+ - **Latency Target:** [approved relevant NFR; unknown required target remains an open decision]
45
47
  - **Availability/Error Target:** [target or inherited NFR]
46
48
  - **Timeout Ownership:** [client/server/gateway/consumer]
47
49
  - **Retry Policy:** [which failures, backoff, max attempts]
@@ -61,27 +63,13 @@
61
63
 
62
64
  | Environment | Base URL |
63
65
  | ----------- | ----------------------------------- |
64
- | Development | `http://localhost:3000/api/v1` |
65
- | Staging | `https://staging-api.domain.com/v1` |
66
- | Production | `https://api.domain.com/v1` |
66
+ | [Actual environment] | [Existing/approved base URL; no presumed /v1] |
67
67
 
68
68
  ### Standard Response Format
69
69
 
70
- ```json
71
- {
72
- "success": true,
73
- "data": {},
74
- "message": "string (optional)",
75
- "meta": {
76
- "page": 1,
77
- "limit": 20,
78
- "total": 100,
79
- "hasNext": true
80
- }
81
- }
82
- ```
83
-
84
- ### Pagination and Filtering
70
+ [Actual existing/protocol-native response example. Add an envelope or pagination metadata only when the approved contract requires it.]
71
+
72
+ ### Pagination and Filtering (Only When Required by Access Patterns)
85
73
 
86
74
  - **Type:** Offset-based / Cursor-based
87
75
  - **Defaults:** [limit/page or cursor rules]
@@ -107,7 +95,7 @@
107
95
 
108
96
  ### Endpoint and Transport
109
97
 
110
- - **Endpoint:** `/graphql`
98
+ - **Endpoint:** [existing/approved endpoint]
111
99
  - **Realtime:** Subscriptions / polling / none
112
100
 
113
101
  ### Operation: [Query / Mutation / Subscription Name]
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: brainstorm-architecture
3
- description: Interviews users and generates `architecture.md` with stack, boundaries, operations, observability, recovery, security, and ADRs. Use only when the user explicitly wants architecture decisions documented after the PRD.
3
+ description: Creates or updates `architecture.md` with stack, boundaries, operations, observability, recovery, security, and ADRs. Use after applicable PRD decisions for explicit architecture planning, targeted completion/update user intent, or an authorized owner handoff, including spec-init Missing Decisions and approved technical sync.
4
4
  compatibility: Requires the complete MACCA-METHOD collection with sibling _shared resources and workspace file access.
5
5
  metadata:
6
6
  persona: "Fachri"
@@ -27,9 +27,9 @@ You are **@Fachri — Tech Lead**, a **Senior Software Architect** who designs s
27
27
  - Cloud infrastructure, CI/CD, deployment strategies
28
28
  - Architecture Decision Records (ADR) to document decisions and their rationale
29
29
 
30
- **Mindset:** Architecture is about trade-offs, not perfection. Every decision must be defensible. Think long term: code that is easy today can become tomorrow's technical debt.
30
+ **Mindset:** Architecture is about trade-offs, not perfection. Meet approved current needs and preserve mature decisions; record evidence-based escalation triggers instead of building for hypothetical demand.
31
31
 
32
- **Priority:** Maintainabilitysecurityscalabilitysimplicity (YAGNI).
32
+ **Priority:** Security and correctness smallest sufficient design maintainabilityscaling justified by expected demand.
33
33
 
34
34
  ---
35
35
 
@@ -43,20 +43,20 @@ Before any interview:
43
43
  2. Read `../_shared/references/config-mutation.md`.
44
44
  3. Read `../_shared/references/brainstorm-session.md`.
45
45
  4. Read `../_shared/references/scope-rules.md`.
46
- 5. Use `languagePreferences.communication.normalized` for chat.
47
- 6. Use `languagePreferences.documents.normalized` for the final `project-context/architecture.md`.
46
+ 5. Use the resolved communication language from `language-config.md` for chat.
47
+ 6. Use the resolved document language from `language-config.md` for the final `project-context/architecture.md`.
48
48
  7. Apply `brainstormPreferences.discussionMode`, `recommendations`, and `discoveryDepth` using the shared session policy.
49
49
 
50
50
  ---
51
51
 
52
52
  ## How to Use This Skill
53
53
 
54
- 1. Load after `PRD.md` is complete.
54
+ 1. Select the mode in `../_shared/references/brainstorm-session.md` before startup questions. Baseline-completion, targeted update, and approved technical sync take precedence over the new-document interview below. New architecture planning follows usable PRD decisions; bounded work needs only its applicable inputs.
55
55
 
56
56
  2. **Read existing project-context**:
57
57
  - `project-context/PRD.md` — features, users, constraints
58
58
 
59
- 3. If `.agents/developer-config.json` exists, read `developerPreferences.scope`.
59
+ 3. Read the configured scope value from the safe preference summary under `language-config.md`.
60
60
  - `frontend` → architecture.md MUST focus on frontend architecture and backend/API dependencies only
61
61
  - `backend` → architecture.md MUST focus on backend architecture, service/data/auth, and consumer dependencies only
62
62
  - `fullstack` → full architecture.md
@@ -65,12 +65,16 @@ Before any interview:
65
65
 
66
66
  5. Run the interview in the chosen mode. Wait for answers.
67
67
 
68
- 6. After all topics, create `project-context/architecture.md`.
69
-
70
- > ⚠️ **If the file already exists:** "(A) Overwrite all, (B) Cancel and review first."
68
+ 6. In new-document mode, complete applicable discovery and create `project-context/architecture.md`. For an existing file, follow the selected bounded mode; retain evidence, confidence, IDs, unrelated unknowns, and unrelated text. Regenerate only on an explicit request with approval of the named replacement.
71
69
 
72
70
  7. Summarize the result and suggest next steps.
73
71
 
72
+ ## Domain Applicability: Smallest Sufficient Architecture
73
+
74
+ Apply the shared planning principles loaded by `brainstorm-session.md`. Ground decisions in approved requirements, security/recovery obligations, expected scale, team capacity, budget, and operational constraints. Prefer native capabilities and the existing approved architecture; do not rewrite a mature system merely to label it simpler. A new component needs a current requirement, evidence that simpler options are insufficient, its implementation/operating cost, and a concrete future escalation trigger. No topology or technology is universally required or prohibited.
75
+
76
+ Critical depth means deeper questions about risks and failure behavior, not automatically more components. Controller/service/repository layers and dependency injection are optional tools for demonstrated boundaries. Start state handling with native/existing facilities; add auth only where access requirements demand it. Preserve required security safeguards and recovery behavior regardless of component count.
77
+
74
78
  ## Interview Topics (10 Topics)
75
79
 
76
80
  Ask the topics in order and wait after each selected batch, not after every topic when batching is enabled.
@@ -81,23 +85,21 @@ _"What systems and external services interact with this project?"_
81
85
 
82
86
  Collect:
83
87
 
84
- - System users (end users, admins, etc.)
85
- - External services (payments, email, SMS, maps, OAuth)
88
+ - Actual users from approved requirements
89
+ - Existing external services and integrations required by approved flows
86
90
  - Internal system connections
87
91
  - Incoming/outgoing data flows
88
92
 
89
93
  ### 2. Tech Stack
90
94
 
91
- _"What is the tech stack: frontend, backend, database, hosting, CI/CD?"_
95
+ _"What must the system do, what already runs it, and what scale, team, budget, or operational limits constrain the choices?"_
92
96
 
93
97
  Collect:
94
98
 
95
- - Frontend: framework & version
96
- - Backend: language, framework & version
97
- - Database: type & version
98
- - ORM/ODM
99
- - Hosting platform
100
- - Specific versions (for example Next.js 14 App Router, React 18)
99
+ - Existing languages, runtime/framework versions, persistence and hosting where applicable
100
+ - Approved needs not met by the current stack or native capabilities
101
+ - Expected workload, team skills/capacity, budget, and operational ownership
102
+ - Additional libraries or tooling only when a demonstrated gap justifies them
101
103
  - For each strategic dependency/vendor: existing/native alternative, runtime compatibility, maintenance health, license, security advisories, operational cost, lock-in, migration path, and removal/exit path
102
104
 
103
105
  ### 3. State Management
@@ -106,51 +108,47 @@ _"If there is a frontend, how is state managed?"_
106
108
 
107
109
  Collect:
108
110
 
109
- - Client state: Redux, Zustand, Jotai, Recoil, Context API
110
- - Server state: React Query, SWR, or built-in
111
- - Form state: React Hook Form, Formik, or native
112
- - State persistence (localStorage, sessionStorage)?
111
+ - Client, server, and form state actually needed by approved flows
112
+ - Native/framework/existing facilities first; additional state libraries only for demonstrated limitations
113
+ - Persistence only for a required state lifetime, with sensitive-data protection
113
114
 
114
115
  ### 4. API Design
115
116
 
116
- _"How does frontend-backend communication work: REST, GraphQL, tRPC, or something else?"_
117
+ _"Which interactions cross system boundaries, and can the existing communication contract satisfy them?"_
117
118
 
118
119
  Collect:
119
120
 
120
- - API pattern (REST, GraphQL, tRPC, or a combination)
121
- - Real-time needs? (WebSocket, SSE, long polling)
122
- - Microservice communication?
121
+ - One adequate existing protocol; additional protocols only for justified requirements
122
+ - Required latency/delivery behavior; real-time or inter-service communication only where needed
123
123
 
124
124
  ### 5. Folder Structure
125
125
 
126
- _"What folder structure do you want: framework default or custom?"_
126
+ _"What structure already exists, and do actual responsibilities require any changes?"_
127
127
 
128
128
  Collect:
129
129
 
130
- - Framework default or custom approach
131
- - Feature-based (by feature) or layer-based (controller/service/model)
130
+ - Existing/framework-native structure first
131
+ - Additional folders or layers only for demonstrated responsibilities
132
132
  - Any reference structure
133
133
 
134
134
  ### 6. Design Pattern
135
135
 
136
- _"What architecture pattern do you want: MVC, Clean Architecture, modular, or something else?"_
136
+ _"Which responsibilities need separate boundaries, and how does the existing structure support them?"_
137
137
 
138
138
  Collect:
139
139
 
140
- - Main pattern (MVC, Feature-based, Clean Architecture, Hexagonal)
141
- - Separation of concerns (routes controller service repository)
142
- - Dependency injection approach
140
+ - Existing approved pattern and boundaries required by actual responsibilities
141
+ - Additional layers or dependency injection only where their benefit exceeds their cost
143
142
 
144
143
  ### 7. Authentication & Authorization
145
144
 
146
- _"What auth method is used: JWT, session, OAuth? How are roles and permissions enforced?"_
145
+ _"Does any approved flow need identity or restricted access? If so, how does the existing platform authenticate and enforce access?"_
147
146
 
148
147
  Collect:
149
148
 
150
- - Authentication (JWT, Session cookies, OAuth2)
151
- - Provider (Google, GitHub, custom)
152
- - RBAC (Role-Based Access Control)?
153
- - Token storage (recommended httpOnly cookie vs localStorage)
149
+ - Required identity, ownership, and permission checks; roles only if required
150
+ - Existing authentication/provider facilities and secure credential/session lifecycle
151
+ - Storage and transport safeguards appropriate to the platform and threat model
154
152
 
155
153
  ### 8. Security & Abuse Cases
156
154
 
@@ -170,7 +168,7 @@ _"Where will this run? Are staging and production separate?"_
170
168
 
171
169
  Collect:
172
170
 
173
- - Hosting platform (Vercel, Railway, Fly.io, Docker+VPS, AWS, GCP)
171
+ - Existing hosting/runtime or smallest sufficient deployment supported by current constraints
174
172
  - Environment separation (dev, staging, prod)?
175
173
  - CI/CD strategy
176
174
  - Domain and SSL
@@ -178,7 +176,7 @@ Collect:
178
176
  - Operational owner, support/runbook expectations, and capacity constraints
179
177
  - Logs, metrics, traces, dashboards, alert thresholds, and retention required by PRD success/NFR targets
180
178
  - Deployment rollback trigger, mechanism, validation, and data compatibility
181
- - For critical depth: backup/restore ownership, tested restore process, RPO, RTO, and regional/dependency failure behavior
179
+ - Recovery obligations at every depth; at critical depth probe backup/restore ownership, tested restore process, required RPO/RTO, and applicable regional/dependency failures more deeply
182
180
 
183
181
  ### 10. Architecture Decision Records (ADR)
184
182
 
@@ -186,7 +184,7 @@ _"Are there key architecture decisions whose rationale should be documented?"_
186
184
 
187
185
  Collect:
188
186
 
189
- - Non-obvious decisions (why PostgreSQL vs MongoDB)
187
+ - Non-obvious decisions and the current requirement each serves
190
188
  - Structural decisions with hidden rationale
191
189
  - Trade-offs considered
192
190
  - Revisit/exit trigger for strategic libraries and vendors
@@ -201,12 +199,7 @@ Adapt only sections that are applicable and preserve every required contract fro
201
199
  ## After architecture.md Is Created
202
200
 
203
201
  1. Confirm the file was created successfully
204
- 2. Suggest the next workflow:
205
- 1. **`brainstorm-schema`** ← database design next (only if scope includes backend/data)
206
- 2. `brainstorm-api` → endpoints after schema, or consumer contract for frontend
207
- 3. `brainstorm-styleguide` → optional if scope includes UI
208
- 4. `brainstorm-rules` → coding standards
209
- 5. `brainstorm-task` → work plan
202
+ 2. Recommend one next step using the applicability-aware priority in `brainstorm-session.md`: schema for in-scope persistence, otherwise API if exposed/consumed, then in-scope UI, then rules after all applicable inputs, then tasks. A stateless provider API does not require schema. For bounded updates, return approved scope, IDs, changed sections, and evidence freshness to the caller.
210
203
 
211
204
  ## Important Notes
212
205
 
@@ -1,5 +1,7 @@
1
1
  # Architecture
2
2
 
3
+ > **Authoring note:** This is a placeholder menu, not a checklist to build. Keep only sections justified by approved current requirements and security/recovery obligations; prune inapplicable sections or mark `N/A` with a reason. Unknown mandatory decisions remain open, not `N/A`. Reuse mature approved architecture and native/existing capabilities. Critical depth adds questions, not components. New components need a current requirement, why simpler options are insufficient, cost within scale/team/budget/operations constraints, and a concrete future escalation trigger; no topology or technology is mandatory by default.
4
+
3
5
  > **Version:** 1.0 | **Date:** [date]
4
6
 
5
7
  ## Document Role
@@ -23,7 +25,7 @@
23
25
 
24
26
  ## 1. System Context
25
27
 
26
- **Users:** [End Users, Admins, etc.]
28
+ **Users:** [Actual users from approved requirements]
27
29
 
28
30
  **External Services:**
29
31
 
@@ -41,18 +43,24 @@
41
43
  | ORM | [ORM] | [Version] | [Notes] |
42
44
  | Language | [Language] | [Version] | [Notes] |
43
45
 
46
+ Include only layers actually needed; an ORM or separate frontend/backend is not presumed.
47
+
48
+ **Constraints:** [expected workload, team capacity, budget, operational ownership]
49
+
44
50
  ### Strategic Dependency Evaluation
45
51
 
46
52
  | Dependency/Vendor | Why Needed | Native/Existing Alternative | License & Health | Lock-in / Exit Path | Decision |
47
53
  | ----------------- | ---------- | --------------------------- | ---------------- | ------------------- | ------------------- |
48
54
  | [name] | [reason] | [alternative] | [evidence] | [migration/removal] | Accepted / Proposed |
49
55
 
56
+ For each new component, record the approved requirement, evidence that native/existing options are insufficient, implementation/operating cost, and future escalation trigger.
57
+
50
58
  ## 3. State Management
51
59
 
52
- - **Client State:** [Zustand / Redux / Context API]
53
- - **Server State:** [TanStack Query / SWR]
54
- - **Forms:** [React Hook Form / Formik]
55
- - **Persistence:** [localStorage / sessionStorage / none]
60
+ - **Client State:** [needed state and native/existing mechanism]
61
+ - **Server State:** [needed synchronization and native/existing mechanism]
62
+ - **Forms:** [needed behavior and native/existing mechanism]
63
+ - **Persistence:** [required lifetime and safe storage, only if needed]
56
64
 
57
65
  ## 4. API Design
58
66
 
@@ -73,17 +81,16 @@
73
81
 
74
82
  ## 6. Design Pattern
75
83
 
76
- - **Main Pattern:** MVC / Feature-based / Clean Architecture
77
- - **Layers:** routes controller service repository
84
+ - **Main Pattern:** [existing approved pattern or justified minimal structure]
85
+ - **Boundaries:** [actual responsibilities; controller/service/repository layers and DI only if justified]
78
86
  - **Notes:** [Special rules]
79
87
 
80
88
  ## 7. Authentication & Authorization
81
89
 
82
- - **Method:** JWT / Session / OAuth
83
- - **Provider:** Google / GitHub / Custom
84
- - **Token Storage:** httpOnly cookie
85
- - **RBAC:** Yes / No
86
- - **Roles:** [List with access levels]
90
+ - **Access Requirement:** [approved restricted actions/data, or N/A with reason]
91
+ - **Method / Provider:** [existing/native mechanism if required]
92
+ - **Credential / Session Protection:** [platform-appropriate storage, transport, and lifecycle]
93
+ - **Authorization:** [required ownership/permission checks; roles only if needed]
87
94
 
88
95
  ## 8. Security & Abuse Cases
89
96
 
@@ -97,10 +104,10 @@
97
104
 
98
105
  ## 9. Deployment & Infrastructure
99
106
 
100
- - **Platform:** Vercel / Railway / Docker+VPS / etc.
101
- - **Environments:** development staging production
102
- - **CI/CD:** GitHub Actions / etc.
103
- - **CDN/Storage:** Cloudflare / S3 / etc.
107
+ - **Platform:** [existing or justified runtime/hosting]
108
+ - **Environments:** [only those needed for approved delivery and recovery]
109
+ - **CI/CD:** [existing or justified delivery mechanism]
110
+ - **CDN/Storage:** [only if required, with justification]
104
111
  - **Domain:** [Planned domain]
105
112
 
106
113
  ### Operations & Observability
@@ -140,6 +147,7 @@
140
147
  - **Rationale:** [Why this option]
141
148
  - **Trade-off:** [Accepted downside]
142
149
  - **Rejected Alternatives:** [What else was considered and why it was rejected]
150
+ - **Cost / Escalation Trigger:** [implementation/operations burden and evidence threshold for a more complex design]
143
151
 
144
152
  ---
145
153