@haposoft/cafekit 0.8.6 → 0.8.7

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/bin/install.js CHANGED
@@ -424,8 +424,15 @@ function copyPlatformFiles(platformKey, results, options = {}) {
424
424
 
425
425
  // Keep templates in sync for claude command runtime copies under .claude/skills/specs
426
426
  if (platformKey === 'claude') {
427
+ const legacyInitTemplate = path.join(platform.skillsDir, 'specs', 'templates', 'init.json');
428
+ if (fs.existsSync(legacyInitTemplate)) {
429
+ fs.rmSync(legacyInitTemplate, { force: true });
430
+ console.log(` ↻ Removed legacy template: ${legacyInitTemplate}`);
431
+ results.updated++;
432
+ }
433
+
427
434
  const specTemplates = [
428
- 'init.json',
435
+ 'spec-state.json',
429
436
  'requirements-init.md',
430
437
  'requirements.md',
431
438
  'design.md',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haposoft/cafekit",
3
- "version": "0.8.6",
3
+ "version": "0.8.7",
4
4
  "description": "Claude Code-first spec-driven workflow for AI coding assistants. Bundles CafeKit hapo: skills, runtime hooks, agents, and installer scaffolding.",
5
5
  "author": "Haposoft <nghialt@haposoft.com>",
6
6
  "license": "MIT",
@@ -15,6 +15,23 @@ You DO NOT write implementation code. You produce Specifications that downstream
15
15
 
16
16
  **Before ANY action**, you MUST read `.claude/skills/specs/SKILL.md` and follow it step-by-step. `SKILL.md` is the authoritative workflow. This agent file provides behavioral guidance; `SKILL.md` provides the execution protocol.
17
17
 
18
+ ## Artifact Contract (MANDATORY)
19
+
20
+ Generate only the CafeKit spec artifacts defined by `hapo:specs`:
21
+
22
+ ```
23
+ specs/<feature>/
24
+ ├── spec.json
25
+ ├── requirements.md
26
+ ├── research.md
27
+ ├── design.md
28
+ └── tasks/task-R{N}-{SEQ}-<slug>.md
29
+ ```
30
+
31
+ - `spec.json` is generated from `.claude/skills/specs/templates/spec-state.json`; never write `init.json` or `spec-state.json` into the spec directory.
32
+ - Task filenames MUST include the `task-` prefix, requirement number, two-digit sequence, and descriptive slug, for example `tasks/task-R0-01-project-scaffolding.md`.
33
+ - Do NOT write `hydration.md`; task hydration is session/task-state synchronization only.
34
+
18
35
  ## Mental Models (How You Think)
19
36
 
20
37
  - **Decomposition:** Break epics into concrete, testable tasks.
@@ -197,7 +214,7 @@ specs/<feature>/
197
214
 
198
215
  - Output format follows `hapo:specs` protocol (see `skills/specs/SKILL.md`)
199
216
  - Task files follow `skills/specs/templates/task.md` template
200
- - `spec.json` follows `skills/specs/templates/init.json` schema
217
+ - `spec.json` follows the `skills/specs/templates/spec-state.json` schema; the generated file must still be named `spec.json`
201
218
  - Research output follows `skills/specs/templates/research.md` template
202
219
  - Requirements follow EARS format per `skills/specs/rules/ears-format.md`
203
220
  - Design follows principles per `skills/specs/rules/design-principles.md`
@@ -69,7 +69,7 @@ Generate a unique feature name from the project description ($ARGUMENTS) and ini
69
69
  1. **Check Uniqueness**: Verify `.specs/` for naming conflicts (append number suffix if needed)
70
70
  2. **Create Directory**: `.specs/[feature-name]/`
71
71
  3. **Initialize Files Using Templates**:
72
- - Read `{{SKILLS_DIR}}/specs/templates/init.json`
72
+ - Read `{{SKILLS_DIR}}/specs/templates/spec-state.json`
73
73
  - Read `{{SKILLS_DIR}}/specs/templates/requirements-init.md`
74
74
  - Replace placeholders:
75
75
  - `{{FEATURE_NAME}}` → generated feature name
@@ -92,7 +92,7 @@ Generate a unique feature name from the project description ($ARGUMENTS) and ini
92
92
 
93
93
  ## Tool Guidance
94
94
  - Use **Glob** to check existing spec directories for name uniqueness
95
- - Use **Read** to fetch templates: `init.json` and `requirements-init.md`
95
+ - Use **Read** to fetch templates: `spec-state.json` and `requirements-init.md`
96
96
  - Use **Write** to create spec.json and requirements.md after placeholder replacement
97
97
  - Perform validation before any file write operation
98
98
 
@@ -56,6 +56,31 @@ Analyze → Dependency Scan → Complexity Assessment → Init → Evidence Gate
56
56
  - Insert code samples/pseudocode when needed to clarify flow
57
57
  - Comply with `./docs/development-rules.md` if it exists
58
58
 
59
+ ### Hard Output Contract
60
+ For a normal `/hapo:specs <feature-description>` run, the persistent spec artifacts MUST use this shape:
61
+
62
+ ```
63
+ specs/<feature>/
64
+ ├── spec.json
65
+ ├── requirements.md
66
+ ├── research.md
67
+ ├── design.md
68
+ ├── tasks/
69
+ │ ├── task-R0-01-<slug>.md
70
+ │ ├── task-R1-01-<slug>.md
71
+ │ └── ...
72
+ └── reports/
73
+ └── <optional-review-or-research-report>.md
74
+ ```
75
+
76
+ Forbidden generated artifacts:
77
+ - Do NOT create `specs/<feature>/init.json`.
78
+ - Do NOT create `specs/<feature>/spec-state.json`.
79
+ - Do NOT create `specs/<feature>/hydration.md`.
80
+ - Do NOT create shorthand task files such as `tasks/task-R0-1.md`, `tasks/task-R1-1.md`, or `tasks/R0-1-<slug>.md`.
81
+ - The template file name is never the output file name. `templates/spec-state.json` is only the schema source for generated `spec.json`.
82
+ - Task hydration is session/task-state synchronization only; it MUST NOT be written as a markdown artifact.
83
+
59
84
  ### Writing Style
60
85
  - Concise, prefer bullet lists
61
86
  - Get straight to the point, no fluff
@@ -190,7 +215,7 @@ Load: `references/scope-inquiry.md`
190
215
  ### Step 4: Init
191
216
  - Check for duplicate slugs in `specs/` via Glob
192
217
  - Create directory `specs/<feature-name>/`
193
- - Create `spec.json` from template `templates/init.json`
218
+ - Create `spec.json` from template `templates/spec-state.json`. The output file name MUST be `spec.json`; never write the template filename into the spec directory.
194
219
  - Create empty `requirements.md` from template `templates/requirements-init.md`
195
220
  - Initialize `scope_lock` in `spec.json`:
196
221
  - `source`: original description
@@ -502,7 +527,7 @@ Before finalizing any specification, assert all the following:
502
527
  ## Resources
503
528
 
504
529
  ### Templates (`templates/`)
505
- - `init.json` — Metadata schema for spec.json
530
+ - `spec-state.json` — Metadata/state schema used to create `spec.json`
506
531
  - `requirements-init.md` — Empty requirements template
507
532
  - `requirements.md` — Full requirements template
508
533
  - `design.md` — Design document template
@@ -6,7 +6,7 @@ The following guidelines dictate exactly how `hapo:sync` should interact with fi
6
6
 
7
7
  ## 1. Updating `spec.json`
8
8
 
9
- When requested to update a phase or change task configuration, `spec.json` must maintain its strict schema (defined in `hapo:specs/templates/init.json`).
9
+ When requested to update a phase or change task configuration, `spec.json` must maintain its strict schema (defined in `hapo:specs/templates/spec-state.json`).
10
10
 
11
11
  * **JSON Modification Rule:** Do not output whole files. Instead, load the JSON structure, apply the update to `status`, `current_phase`, `blocker` (if any), `task_files`, and the relevant `task_registry` entry, then overwrite the file cleanly.
12
12
  * **Task Registry Rule:** Resolve the incoming task reference to a single relative path in `task_registry`. Accept either: