@haposoft/cafekit 0.3.11 → 0.4.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.
- package/README.md +83 -28
- package/bin/install.js +125 -1
- package/package.json +5 -3
- package/src/claude/hooks/agent.cjs +203 -0
- package/src/claude/hooks/lib/color.cjs +95 -0
- package/src/claude/hooks/lib/config.cjs +831 -0
- package/src/claude/hooks/lib/context.cjs +616 -0
- package/src/claude/hooks/lib/counter.cjs +103 -0
- package/src/claude/hooks/lib/detect.cjs +474 -0
- package/src/claude/hooks/lib/git.cjs +143 -0
- package/src/claude/hooks/lib/parser.cjs +182 -0
- package/src/claude/hooks/session.cjs +360 -0
- package/src/claude/hooks/usage.cjs +179 -0
- package/src/claude/migration-manifest.json +27 -2
- package/src/claude/settings/status.settings.json +54 -0
- package/src/claude/status.cjs +539 -0
- package/src/common/skills/code/SKILL.md +55 -0
- package/src/common/skills/code/references/execution-loop.md +21 -0
- package/src/common/skills/impact-analysis/references/change-detection.md +16 -16
- package/src/common/skills/impact-analysis/references/dependency-scouting.md +8 -8
- package/src/common/skills/impact-analysis/references/edge-case-identification.md +11 -11
- package/src/common/skills/impact-analysis/references/industry-techniques.md +36 -36
- package/src/common/skills/impact-analysis/references/practical-techniques-guide.md +16 -16
- package/src/common/skills/impact-analysis/references/project-detection.md +1 -1
- package/src/common/skills/impact-analysis/references/report-template.md +2 -2
- package/src/common/skills/impact-analysis/scripts/README.md +3 -3
- package/src/common/skills/review/SKILL.md +46 -0
- package/src/common/skills/review/references/review-focus.md +28 -0
- package/src/common/skills/spec-design/SKILL.md +66 -0
- package/src/common/skills/spec-design/references/design-discovery.md +46 -0
- package/src/common/skills/spec-init/SKILL.md +61 -0
- package/src/common/skills/spec-requirements/SKILL.md +59 -0
- package/src/common/skills/spec-requirements/references/requirements-workflow.md +36 -0
- package/src/common/skills/spec-tasks/SKILL.md +60 -0
- package/src/common/skills/spec-tasks/references/task-sizing.md +36 -0
- package/src/common/skills/test/SKILL.md +40 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hapo:spec-requirements
|
|
3
|
+
description: Generate EARS requirements with scope-lock checks. Use after hapo:spec-init in Claude Code.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
argument-hint: <feature-name>
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Hapo Spec Requirements
|
|
9
|
+
|
|
10
|
+
Generate complete, testable requirements from the initialized spec description.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
/hapo:spec-requirements <feature-name>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Load First
|
|
19
|
+
|
|
20
|
+
- `references/requirements-workflow.md`
|
|
21
|
+
- `.claude/skills/specs/rules/ears-format.md`
|
|
22
|
+
- `.claude/skills/specs/templates/requirements.md`
|
|
23
|
+
|
|
24
|
+
## Execute
|
|
25
|
+
|
|
26
|
+
1. Read `.specs/$ARGUMENTS/spec.json` first.
|
|
27
|
+
2. Stop if the spec folder is missing and tell the user to run `/hapo:spec-init` first.
|
|
28
|
+
3. Stop if requirements are already past this phase unless the user clearly wants regeneration.
|
|
29
|
+
4. Read:
|
|
30
|
+
- `.specs/$ARGUMENTS/spec.json`
|
|
31
|
+
- `.specs/$ARGUMENTS/requirements.md`
|
|
32
|
+
- `.specs/steering/` when present
|
|
33
|
+
- project docs under `docs/` when present
|
|
34
|
+
5. Respect `scope_lock` strictly. Keep new requirements inside `in_scope`. Move nearby but unapproved ideas to deferred or out-of-scope notes.
|
|
35
|
+
6. Analyze the existing codebase when this is an enhancement, not a greenfield feature.
|
|
36
|
+
7. Generate requirements in EARS format only. Focus on what the system shall do, not how to build it.
|
|
37
|
+
8. Normalize requirement headings to numeric IDs if needed.
|
|
38
|
+
9. Update `spec.json` phase and timestamps after writing the document.
|
|
39
|
+
|
|
40
|
+
## Output
|
|
41
|
+
|
|
42
|
+
Return:
|
|
43
|
+
- 3-5 bullet summary of requirement areas
|
|
44
|
+
- deferred or out-of-scope topics
|
|
45
|
+
- confirmation that `requirements.md` and `spec.json` were updated
|
|
46
|
+
- next command: `/hapo:spec-design $ARGUMENTS`
|
|
47
|
+
|
|
48
|
+
## Rules
|
|
49
|
+
|
|
50
|
+
- Use EARS syntax for acceptance criteria.
|
|
51
|
+
- Keep requirements testable and verifiable.
|
|
52
|
+
- Ask at most 1-2 focused clarification questions when scope is ambiguous.
|
|
53
|
+
- If templates or rules are missing, report the exact missing file.
|
|
54
|
+
|
|
55
|
+
## Related
|
|
56
|
+
|
|
57
|
+
- Command: `/spec-requirements`
|
|
58
|
+
- Previous skill: `/hapo:spec-init`
|
|
59
|
+
- Next skill: `/hapo:spec-design $ARGUMENTS`
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Requirements Workflow
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Generate requirement statements that stay inside the initialized scope and can be verified later.
|
|
6
|
+
|
|
7
|
+
## Sequence
|
|
8
|
+
|
|
9
|
+
1. Read `spec.json` first.
|
|
10
|
+
2. Read the current `requirements.md` seed content.
|
|
11
|
+
3. Load steering and `docs/` context when available.
|
|
12
|
+
4. Read shared rules from `.claude/skills/specs/rules/ears-format.md`.
|
|
13
|
+
5. Filter candidate requirement areas through `scope_lock`.
|
|
14
|
+
6. Write requirements in EARS format.
|
|
15
|
+
7. Update phase metadata.
|
|
16
|
+
|
|
17
|
+
## EARS reminder
|
|
18
|
+
|
|
19
|
+
- Event-driven: `When ... the system shall ...`
|
|
20
|
+
- State-driven: `While ... the system shall ...`
|
|
21
|
+
- Unwanted: `If ... the system shall ...`
|
|
22
|
+
- Optional: `Where ... the system shall ...`
|
|
23
|
+
- Ubiquitous: `The system shall ...`
|
|
24
|
+
|
|
25
|
+
## Scope rules
|
|
26
|
+
|
|
27
|
+
- Keep only what matches `scope_lock.in_scope`.
|
|
28
|
+
- Do not promote adjacent ideas automatically.
|
|
29
|
+
- Put unapproved expansions into deferred or out-of-scope notes.
|
|
30
|
+
|
|
31
|
+
## Output checklist
|
|
32
|
+
|
|
33
|
+
- Numeric requirement headings
|
|
34
|
+
- Testable acceptance criteria
|
|
35
|
+
- No implementation details
|
|
36
|
+
- Next step points to design
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hapo:spec-tasks
|
|
3
|
+
description: Break approved design into executable tasks with requirement mapping. Use after hapo:spec-design in Claude Code.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
argument-hint: <feature-name>
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Hapo Spec Tasks
|
|
9
|
+
|
|
10
|
+
Turn approved requirements and design into a task list that can be implemented incrementally.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
/hapo:spec-tasks <feature-name>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Load First
|
|
19
|
+
|
|
20
|
+
- `references/task-sizing.md`
|
|
21
|
+
- `.claude/skills/specs/rules/tasks-generation.md`
|
|
22
|
+
- `.claude/skills/specs/templates/tasks.md`
|
|
23
|
+
|
|
24
|
+
## Execute
|
|
25
|
+
|
|
26
|
+
1. Read `.specs/$ARGUMENTS/spec.json` first.
|
|
27
|
+
2. Stop if `requirements.md` or `design.md` is missing.
|
|
28
|
+
3. Read:
|
|
29
|
+
- `.specs/$ARGUMENTS/spec.json`
|
|
30
|
+
- `.specs/$ARGUMENTS/requirements.md`
|
|
31
|
+
- `.specs/$ARGUMENTS/design.md`
|
|
32
|
+
- `.specs/$ARGUMENTS/tasks.md` when it exists
|
|
33
|
+
- `.specs/$ARGUMENTS/research.md` when it exists
|
|
34
|
+
4. Respect `scope_lock` and use only valid in-scope numeric requirement IDs.
|
|
35
|
+
5. Generate tasks that are small, ordered, and incremental.
|
|
36
|
+
6. Keep a maximum of two levels: major tasks and sub-tasks.
|
|
37
|
+
7. Remove or defer tasks that only map to out-of-scope work.
|
|
38
|
+
8. Write `.specs/$ARGUMENTS/tasks.md`.
|
|
39
|
+
9. Update `spec.json` phase and task generation metadata.
|
|
40
|
+
|
|
41
|
+
## Output
|
|
42
|
+
|
|
43
|
+
Return:
|
|
44
|
+
- task generation status and file path
|
|
45
|
+
- total major tasks and sub-tasks
|
|
46
|
+
- confirmation that all in-scope requirements are covered
|
|
47
|
+
- next command: `/hapo:code $ARGUMENTS`
|
|
48
|
+
|
|
49
|
+
## Rules
|
|
50
|
+
|
|
51
|
+
- Every task must map to at least one valid numeric requirement ID.
|
|
52
|
+
- Keep sub-tasks sized for short implementation passes.
|
|
53
|
+
- Do not introduce new scope during task generation.
|
|
54
|
+
- If requirement IDs are invalid or missing, stop and report it.
|
|
55
|
+
|
|
56
|
+
## Related
|
|
57
|
+
|
|
58
|
+
- Command: `/spec-tasks`
|
|
59
|
+
- Previous skill: `/hapo:spec-design`
|
|
60
|
+
- Next skill: `/hapo:code $ARGUMENTS`
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Task Sizing
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Produce tasks small enough for incremental delivery and review.
|
|
6
|
+
|
|
7
|
+
## Good task size
|
|
8
|
+
|
|
9
|
+
Target sub-tasks that fit one focused implementation pass.
|
|
10
|
+
|
|
11
|
+
## Rules
|
|
12
|
+
|
|
13
|
+
- Every task maps to valid numeric requirement IDs.
|
|
14
|
+
- Keep only two levels: major tasks and sub-tasks.
|
|
15
|
+
- Prefer capability-based task names, not file-dump checklists.
|
|
16
|
+
- Remove tasks that only serve out-of-scope work.
|
|
17
|
+
|
|
18
|
+
## Good examples
|
|
19
|
+
|
|
20
|
+
- Add theme state provider
|
|
21
|
+
- Persist theme selection
|
|
22
|
+
- Update navigation to expose toggle
|
|
23
|
+
- Add tests for preference persistence
|
|
24
|
+
|
|
25
|
+
## Bad examples
|
|
26
|
+
|
|
27
|
+
- Build entire auth system
|
|
28
|
+
- Refactor everything first
|
|
29
|
+
- Add optional analytics that was never approved
|
|
30
|
+
|
|
31
|
+
## Ordering
|
|
32
|
+
|
|
33
|
+
1. foundations
|
|
34
|
+
2. feature behavior
|
|
35
|
+
3. integration points
|
|
36
|
+
4. tests and cleanup
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hapo:test
|
|
3
|
+
description: Run project tests after hapo:code and report failures concisely.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
argument-hint: [scope]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Hapo Test
|
|
9
|
+
|
|
10
|
+
Run the relevant test command for the current project and summarize the result.
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
/hapo:test
|
|
16
|
+
/hapo:test <scope>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Execute
|
|
20
|
+
|
|
21
|
+
1. Detect the project test command from the current repo.
|
|
22
|
+
2. Run the relevant tests for the recent changes or requested scope.
|
|
23
|
+
3. Report:
|
|
24
|
+
- total passed and failed
|
|
25
|
+
- failing test names
|
|
26
|
+
- likely root cause
|
|
27
|
+
- next fix action
|
|
28
|
+
4. If tests fail, do not hide failures. Point back to the failing area.
|
|
29
|
+
|
|
30
|
+
## Rules
|
|
31
|
+
|
|
32
|
+
- Prefer the smallest meaningful test scope first.
|
|
33
|
+
- Keep the report concise.
|
|
34
|
+
- Do not claim success when tests were not run.
|
|
35
|
+
|
|
36
|
+
## Related
|
|
37
|
+
|
|
38
|
+
- Command: `/test`
|
|
39
|
+
- Previous skill: `/hapo:code`
|
|
40
|
+
- Next skill: `/hapo:review`
|