@haposoft/cafekit 0.7.8 → 0.7.9
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 +43 -0
- package/package.json +1 -1
- package/src/claude/agents/brainstormer.md +1 -0
- package/src/claude/agents/code-auditor.md +2 -0
- package/src/claude/agents/god-developer.md +1 -0
- package/src/claude/agents/project-manager.md +1 -0
- package/src/claude/agents/researcher.md +6 -2
- package/src/claude/agents/spec-maker.md +1 -0
- package/src/claude/agents/ui-ux-designer.md +1 -0
- package/src/claude/rules/orchestrator.md +7 -7
- package/src/claude/skills/research/SKILL.md +13 -3
- package/src/claude/status.cjs +2 -2
package/bin/install.js
CHANGED
|
@@ -827,6 +827,43 @@ function copyRulesDirectory(platformKey, results, options = {}) {
|
|
|
827
827
|
}
|
|
828
828
|
}
|
|
829
829
|
|
|
830
|
+
// Ensure .gitignore configured at root
|
|
831
|
+
function ensureGitignore(results, options = {}) {
|
|
832
|
+
const gitignorePath = path.join(process.cwd(), '.gitignore');
|
|
833
|
+
const header = '# CafeKit / Ecosystem';
|
|
834
|
+
const patterns = [
|
|
835
|
+
'specs/_shared/',
|
|
836
|
+
'plans/',
|
|
837
|
+
'!plans/templates/'
|
|
838
|
+
];
|
|
839
|
+
|
|
840
|
+
if (!fs.existsSync(gitignorePath)) {
|
|
841
|
+
const content = ['# Git Ignore', '', header, ...patterns, ''].join('\n');
|
|
842
|
+
fs.writeFileSync(gitignorePath, content, 'utf8');
|
|
843
|
+
console.log(' ✓ .gitignore created at root');
|
|
844
|
+
results.copied++;
|
|
845
|
+
return;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
const content = fs.readFileSync(gitignorePath, 'utf8');
|
|
849
|
+
const lines = content.split('\n').map(l => l.trim());
|
|
850
|
+
const missing = patterns.filter(p => !lines.includes(p));
|
|
851
|
+
|
|
852
|
+
if (missing.length > 0) {
|
|
853
|
+
let newContent = content;
|
|
854
|
+
if (!newContent.endsWith('\n')) newContent += '\n';
|
|
855
|
+
if (!content.includes(header)) newContent += `\n${header}\n`;
|
|
856
|
+
|
|
857
|
+
newContent += missing.join('\n') + '\n';
|
|
858
|
+
fs.writeFileSync(gitignorePath, newContent, 'utf8');
|
|
859
|
+
console.log(` ↻ .gitignore updated: added ${missing.join(', ')}`);
|
|
860
|
+
results.updated++;
|
|
861
|
+
} else {
|
|
862
|
+
console.log(' → .gitignore already up to date');
|
|
863
|
+
results.skipped++;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
|
|
830
867
|
// ═══════════════════════════════════════════════════════════
|
|
831
868
|
// GEMINI CLI SETUP
|
|
832
869
|
// ═══════════════════════════════════════════════════════════
|
|
@@ -1024,6 +1061,12 @@ async function main() {
|
|
|
1024
1061
|
console.log();
|
|
1025
1062
|
}
|
|
1026
1063
|
|
|
1064
|
+
// Ensure root .gitignore is configured correctly
|
|
1065
|
+
console.log('Root Configuration');
|
|
1066
|
+
console.log('-'.repeat(40));
|
|
1067
|
+
ensureGitignore(results, installerOptions);
|
|
1068
|
+
console.log();
|
|
1069
|
+
|
|
1027
1070
|
// Setup Gemini CLI and API Key config
|
|
1028
1071
|
await setupGeminiCLI(platforms);
|
|
1029
1072
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haposoft/cafekit",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.9",
|
|
4
4
|
"description": "Spec-Driven Development workflow for AI coding assistants. Supports Claude Code and Antigravity with spec-first workflows plus Claude Code hapo: skills.",
|
|
5
5
|
"author": "Haposoft <nghialt@haposoft.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,6 +50,7 @@ Before concluding any brainstorm session, verify each measurement metric:
|
|
|
50
50
|
1. **Engineering Trinity:** YAGNI, KISS, and DRY.
|
|
51
51
|
2. **Brutal Honesty:** Interrogate assumptions. If a feature is over-engineered, unrealistic, or unscalable, confront it directly. Your value lies in preventing costly mistakes.
|
|
52
52
|
3. **Incremental Flow:** Never overwhelm the user with a massive document upfront. Proceed step by step, section by section.
|
|
53
|
+
4. **Web Search Protocol:** When needing to search the internet for references, benchmarks, or latest practices, ALWAYS use `node .claude/scripts/web-search.cjs "query"` first (Gemini Grounding). Use native WebSearch as secondary. Use `docs-fetch.js` only for known library docs.
|
|
53
54
|
|
|
54
55
|
## Ecosystem Alliances (Collaboration Tools)
|
|
55
56
|
|
|
@@ -11,6 +11,8 @@ Goal: Catch the mistakes AI-written code commonly makes — logic errors, securi
|
|
|
11
11
|
|
|
12
12
|
You DO NOT fix code. You only READ, SCORE, and REPORT.
|
|
13
13
|
|
|
14
|
+
**Web Search Protocol:** When needing to verify security best practices or lookup CVE databases, ALWAYS use `node .claude/scripts/web-search.cjs "query"` first (Gemini Grounding). Use native WebSearch as secondary.
|
|
15
|
+
|
|
14
16
|
## Pre-Review: Blast Radius Check (MANDATORY)
|
|
15
17
|
|
|
16
18
|
Before reading any specific logic, you MUST run a Dependency Scope Check (Blast Radius):
|
|
@@ -19,6 +19,7 @@ Any logic gaps must be clarified BEFORE typing, not discovered after bugs ship.
|
|
|
19
19
|
- **Token efficiency**: Write concisely, report briefly, no prose.
|
|
20
20
|
- **Surgical Reading (Large Files):** Never use blanket `Read` commands on files > 800 lines. Use nested `Grep` or chunked reading (offset/limit) to surgically target modified points.
|
|
21
21
|
- **Component Scaffold Limit:** Any React/UI component file that exceeds 200 LOC must trigger a proactive modularization step (split into smaller child files).
|
|
22
|
+
- **Web Search Protocol:** When needing to search the internet, ALWAYS use `node .claude/scripts/web-search.cjs "query"` first (Gemini Grounding). Use native WebSearch as secondary. Use `docs-fetch.js` only for known library docs.
|
|
22
23
|
|
|
23
24
|
## Self-Check Checklist (Before Reporting Complete)
|
|
24
25
|
|
|
@@ -15,6 +15,7 @@ Unlike typical managers who report on "feelings" or conversational summaries, yo
|
|
|
15
15
|
1. **Spec Syncing:** You validate if the output produced by sub-agents matches the `spec.json` requirements and the `design.md` architectural constraints.
|
|
16
16
|
2. **Blocker Assassination:** You identify task stagnation (e.g., a spec stuck in 'in-progress' across multiple sessions) and force the immediate assignment of next-step actions.
|
|
17
17
|
3. **Agile Aggregation:** When parallel sub-agents (like `god-developer` and `test-runner`) report completion, you sweep their logs, consolidate the facts, and generate a single authoritative **Feature Release Report**.
|
|
18
|
+
4. **Web Search Protocol:** When needing to search for project management best practices, dependency updates, or changelog references, ALWAYS use `node .claude/scripts/web-search.cjs "query"` first (Gemini Grounding). Use native WebSearch as secondary.
|
|
18
19
|
|
|
19
20
|
## Execution Constraints
|
|
20
21
|
|
|
@@ -48,9 +48,13 @@ You possess extreme proficiency in:
|
|
|
48
48
|
|
|
49
49
|
**ABSOLUTE IMMOVEABLE DIRECTIVE**: You are **STRICTLY PROHIBITED** from generating executable endpoint "Implementation Code". You exist ONLY to maneuver data streams, render synthesis Summary text, and return comprehensive Markdown documentation pathways to the main caller Agent.
|
|
50
50
|
|
|
51
|
-
## Report Output
|
|
51
|
+
## Report Output Routing
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Save research output based on context:
|
|
54
|
+
- **Feature research** (active spec exists) → `specs/<feature>/research.md`
|
|
55
|
+
- **System-wide research** (no active spec) → `specs/_shared/Research-<slug>-<date>.md`
|
|
56
|
+
|
|
57
|
+
Do NOT save to `plans/reports/` or `docs/`. All research belongs in `specs/`.
|
|
54
58
|
|
|
55
59
|
## Team Operations Mode
|
|
56
60
|
|
|
@@ -19,6 +19,7 @@ You DO NOT write implementation code. You produce Specifications that downstream
|
|
|
19
19
|
- **The 5 Whys:** Dig past the surface request to find the REAL problem.
|
|
20
20
|
- **80/20 MVP:** Identify the 20% of features that deliver 80% of value.
|
|
21
21
|
- **Systems Thinking:** How does this feature connect to (or break) existing systems?
|
|
22
|
+
- **Web Search Protocol:** When needing to search the internet, ALWAYS use `node .claude/scripts/web-search.cjs "query"` first (Gemini Grounding). Use native WebSearch as secondary. Use `docs-fetch.js` only for known library docs.
|
|
22
23
|
|
|
23
24
|
## Pre-Completion Checklist
|
|
24
25
|
|
|
@@ -18,6 +18,7 @@ You are an award-caliber UI/UX designer. You merge aesthetic excellence with eng
|
|
|
18
18
|
- **Micro-interactions:** Purposeful animations that enhance UX without performance cost.
|
|
19
19
|
- **Accessibility:** WCAG 2.1 AA compliance as a baseline, not an afterthought.
|
|
20
20
|
- **3D/WebGL:** Three.js scene composition, shader development (when appropriate).
|
|
21
|
+
- **Web Search Protocol:** When needing to search the internet for design trends, component libraries, or accessibility guides, ALWAYS use `node .claude/scripts/web-search.cjs "query"` first (Gemini Grounding). Use native WebSearch as secondary. Use `docs-fetch.js` only for known library docs.
|
|
21
22
|
|
|
22
23
|
## Design Workflow
|
|
23
24
|
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
Every subagent prompt **must** include these three paths:
|
|
6
6
|
|
|
7
7
|
- **Work Context** — the git root containing the target files
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
8
|
+
- **Specs Directory** — `{work_context}/specs/`
|
|
9
|
+
- **Docs Directory** — `{work_context}/docs/`
|
|
10
10
|
|
|
11
11
|
When CWD and work context differ (e.g., editing files in a sibling project), always use the **work context** paths.
|
|
12
12
|
|
|
@@ -14,8 +14,8 @@ When CWD and work context differ (e.g., editing files in a sibling project), alw
|
|
|
14
14
|
Example prompt:
|
|
15
15
|
"Resolve the date-parsing regression.
|
|
16
16
|
Work context: /repos/billing-service
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
Specs: /repos/billing-service/specs/
|
|
18
|
+
Docs: /repos/billing-service/docs/"
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
---
|
|
@@ -97,11 +97,11 @@ Files to modify: [list]
|
|
|
97
97
|
Files to read for context: [list]
|
|
98
98
|
Acceptance criteria: [list]
|
|
99
99
|
Constraints: [any relevant constraints]
|
|
100
|
-
|
|
100
|
+
Spec reference: [spec folder path if applicable]
|
|
101
101
|
|
|
102
102
|
Work context: [project path]
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
Specs: [specs path]
|
|
104
|
+
Docs: [docs path]
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
### Do
|
|
@@ -38,6 +38,16 @@ Instruct the Researcher Subagent with this strict requirement:
|
|
|
38
38
|
> "Sử dụng nguyên bản template tại `packages/spec/src/claude/skills/specs/templates/research.md`. Tuyệt đối không tự ý đẻ thêm các đề mục ngoài phạm vi file template này."
|
|
39
39
|
|
|
40
40
|
## Post-Execution
|
|
41
|
-
Once the `researcher` completes the Task and returns the Markdown output:
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
Once the `researcher` completes the Task and returns the Markdown output, save it based on context:
|
|
42
|
+
|
|
43
|
+
### Output Routing
|
|
44
|
+
| Context | Save to | Example |
|
|
45
|
+
|---|---|---|
|
|
46
|
+
| Active spec exists (`specs/<feature>/`) | `specs/<feature>/research.md` | `specs/auth-login/research.md` |
|
|
47
|
+
| No active spec (system-wide / general) | `specs/_shared/Research-<slug>-<date>.md` | `specs/_shared/Research-mv3-best-practices-2026-04-11.md` |
|
|
48
|
+
|
|
49
|
+
### Rules
|
|
50
|
+
1. **Feature research** → Always save inside the active spec folder. If `specs/<feature>/` doesn't exist yet, create it.
|
|
51
|
+
2. **System-wide research** → Save to `specs/_shared/`. Create the directory if it doesn't exist.
|
|
52
|
+
3. **Never** save to `plans/reports/` or `docs/`. All research belongs in `specs/`.
|
|
53
|
+
4. Conclude the workflow by providing the user with the saved file path.
|
package/src/claude/status.cjs
CHANGED
|
@@ -402,8 +402,8 @@ async function main() {
|
|
|
402
402
|
const session = JSON.parse(fs.readFileSync(sessionPath, 'utf8'));
|
|
403
403
|
const planPath = session.activePlan?.trim();
|
|
404
404
|
if (planPath) {
|
|
405
|
-
// Extract slug from path like "plans/260106-1554-
|
|
406
|
-
const match = planPath.match(/plans
|
|
405
|
+
// Extract slug from path like "specs/auth-login" or legacy "plans/260106-1554-feature"
|
|
406
|
+
const match = planPath.match(/(?:specs|plans)\/(?:\d+-\d+-)?(.+?)(?:\/|$)/);
|
|
407
407
|
activePlan = match ? match[1] : planPath.split('/').pop();
|
|
408
408
|
}
|
|
409
409
|
}
|