@haposoft/cafekit 0.7.14 → 0.7.16
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 +2 -1
- package/package.json +1 -1
- package/src/claude/CLAUDE.md +85 -15
- package/src/claude/agents/spec-maker.md +1 -1
- package/src/claude/gitignore +17 -0
- package/src/claude/hooks/lib/config.cjs +2 -2
- package/src/claude/migration-manifest.json +5 -2
- package/src/claude/skills/docx/LICENSE.txt +30 -0
- package/src/claude/skills/docx/SKILL.md +200 -0
- package/src/claude/skills/docx/docx-js.md +350 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/src/claude/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/src/claude/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/src/claude/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/src/claude/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/src/claude/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/src/claude/skills/docx/ooxml/schemas/mce/mc.xsd +75 -0
- package/src/claude/skills/docx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/src/claude/skills/docx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/src/claude/skills/docx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/src/claude/skills/docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/src/claude/skills/docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/src/claude/skills/docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/src/claude/skills/docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/src/claude/skills/docx/ooxml/scripts/pack.py +159 -0
- package/src/claude/skills/docx/ooxml/scripts/unpack.py +29 -0
- package/src/claude/skills/docx/ooxml/scripts/validate.py +69 -0
- package/src/claude/skills/docx/ooxml/scripts/validation/__init__.py +15 -0
- package/src/claude/skills/docx/ooxml/scripts/validation/base.py +951 -0
- package/src/claude/skills/docx/ooxml/scripts/validation/docx.py +274 -0
- package/src/claude/skills/docx/ooxml/scripts/validation/pptx.py +315 -0
- package/src/claude/skills/docx/ooxml/scripts/validation/redlining.py +279 -0
- package/src/claude/skills/docx/ooxml.md +610 -0
- package/src/claude/skills/docx/scripts/__init__.py +1 -0
- package/src/claude/skills/docx/scripts/document.py +1276 -0
- package/src/claude/skills/docx/scripts/templates/comments.xml +3 -0
- package/src/claude/skills/docx/scripts/templates/commentsExtended.xml +3 -0
- package/src/claude/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
- package/src/claude/skills/docx/scripts/templates/commentsIds.xml +3 -0
- package/src/claude/skills/docx/scripts/templates/people.xml +3 -0
- package/src/claude/skills/docx/scripts/utilities.py +374 -0
- package/src/claude/skills/pdf/LICENSE.txt +30 -0
- package/src/claude/skills/pdf/SKILL.md +297 -0
- package/src/claude/skills/pdf/forms.md +205 -0
- package/src/claude/skills/pdf/reference.md +612 -0
- package/src/claude/skills/pdf/scripts/check_bounding_boxes.py +70 -0
- package/src/claude/skills/pdf/scripts/check_bounding_boxes_test.py +226 -0
- package/src/claude/skills/pdf/scripts/check_fillable_fields.py +12 -0
- package/src/claude/skills/pdf/scripts/convert_pdf_to_images.py +35 -0
- package/src/claude/skills/pdf/scripts/create_validation_image.py +41 -0
- package/src/claude/skills/pdf/scripts/extract_form_field_info.py +152 -0
- package/src/claude/skills/pdf/scripts/fill_fillable_fields.py +114 -0
- package/src/claude/skills/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
- package/src/claude/skills/pptx/LICENSE.txt +30 -0
- package/src/claude/skills/pptx/SKILL.md +487 -0
- package/src/claude/skills/pptx/html2pptx.md +625 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/src/claude/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/src/claude/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/src/claude/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/src/claude/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/src/claude/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/src/claude/skills/pptx/ooxml/schemas/mce/mc.xsd +75 -0
- package/src/claude/skills/pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/src/claude/skills/pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/src/claude/skills/pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/src/claude/skills/pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/src/claude/skills/pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/src/claude/skills/pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/src/claude/skills/pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/src/claude/skills/pptx/ooxml/scripts/pack.py +159 -0
- package/src/claude/skills/pptx/ooxml/scripts/unpack.py +29 -0
- package/src/claude/skills/pptx/ooxml/scripts/validate.py +69 -0
- package/src/claude/skills/pptx/ooxml/scripts/validation/__init__.py +15 -0
- package/src/claude/skills/pptx/ooxml/scripts/validation/base.py +951 -0
- package/src/claude/skills/pptx/ooxml/scripts/validation/docx.py +274 -0
- package/src/claude/skills/pptx/ooxml/scripts/validation/pptx.py +315 -0
- package/src/claude/skills/pptx/ooxml/scripts/validation/redlining.py +279 -0
- package/src/claude/skills/pptx/ooxml.md +427 -0
- package/src/claude/skills/pptx/scripts/html2pptx.js +979 -0
- package/src/claude/skills/pptx/scripts/inventory.py +1020 -0
- package/src/claude/skills/pptx/scripts/rearrange.py +231 -0
- package/src/claude/skills/pptx/scripts/replace.py +385 -0
- package/src/claude/skills/pptx/scripts/thumbnail.py +450 -0
- package/src/claude/skills/specs/SKILL.md +11 -4
- package/src/claude/skills/specs/rules/tasks-generation.md +11 -7
- package/src/claude/skills/xlsx/LICENSE.txt +30 -0
- package/src/claude/skills/xlsx/SKILL.md +292 -0
- package/src/claude/skills/xlsx/recalc.py +191 -0
- package/src/claude/skills/code/SKILL.md +0 -55
- package/src/claude/skills/code/references/execution-loop.md +0 -21
package/bin/install.js
CHANGED
|
@@ -281,7 +281,8 @@ function copyRecursive(src, dest, options = {}) {
|
|
|
281
281
|
fs.mkdirSync(dest, { recursive: true });
|
|
282
282
|
}
|
|
283
283
|
fs.readdirSync(src).forEach(childItemName => {
|
|
284
|
-
|
|
284
|
+
const destItemName = childItemName === 'gitignore' ? '.gitignore' : childItemName;
|
|
285
|
+
copyRecursive(path.join(src, childItemName), path.join(dest, destItemName), options);
|
|
285
286
|
});
|
|
286
287
|
} else {
|
|
287
288
|
if (fs.existsSync(dest) && !shouldOverwriteManagedFiles) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haposoft/cafekit",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.16",
|
|
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",
|
package/src/claude/CLAUDE.md
CHANGED
|
@@ -6,6 +6,69 @@ This document serves as the primary configuration and instruction manual for Cla
|
|
|
6
6
|
|
|
7
7
|
You act as the primary orchestrator for the project. Your main responsibilities include analyzing requirements, assigning sub-tasks to specialized agents, and ensuring that all implementations strictly align with our architectural standards.
|
|
8
8
|
|
|
9
|
+
## Behavioral Principles
|
|
10
|
+
|
|
11
|
+
> These principles shape how you approach every task. They take precedence over speed-oriented shortcuts.
|
|
12
|
+
|
|
13
|
+
### 1. Think Before Coding
|
|
14
|
+
|
|
15
|
+
**Don't assume. Don't hide confusion. Surface tradeoffs.**
|
|
16
|
+
|
|
17
|
+
- State assumptions explicitly before implementing. If uncertain, ask.
|
|
18
|
+
- If multiple interpretations exist, present them — don't pick silently.
|
|
19
|
+
- If a simpler approach exists, say so. Push back when warranted.
|
|
20
|
+
- If something is unclear, stop. Name what's confusing. Ask.
|
|
21
|
+
- Before starting any feature planning or coding, read the `./README.md` to acquire project context.
|
|
22
|
+
|
|
23
|
+
### 2. Simplicity First
|
|
24
|
+
|
|
25
|
+
**Minimum code that solves the problem. Nothing speculative.**
|
|
26
|
+
|
|
27
|
+
- No features beyond what was asked.
|
|
28
|
+
- No abstractions for single-use code.
|
|
29
|
+
- No "flexibility" or "configurability" that wasn't requested.
|
|
30
|
+
- No error handling for impossible scenarios.
|
|
31
|
+
- If you write 200 lines and it could be 50, rewrite it.
|
|
32
|
+
- Before generating a new helper or module, check if an existing one can be reused.
|
|
33
|
+
|
|
34
|
+
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
|
|
35
|
+
|
|
36
|
+
### 3. Surgical Changes
|
|
37
|
+
|
|
38
|
+
**Touch only what you must. Clean up only your own mess.**
|
|
39
|
+
|
|
40
|
+
When editing existing code:
|
|
41
|
+
- Don't "improve" adjacent code, comments, or formatting.
|
|
42
|
+
- Don't refactor things that aren't broken.
|
|
43
|
+
- Match existing style, even if you'd do it differently.
|
|
44
|
+
- If you notice unrelated issues, mention them — don't fix them.
|
|
45
|
+
|
|
46
|
+
When your changes create orphans:
|
|
47
|
+
- Remove imports/variables/functions that YOUR changes made unused.
|
|
48
|
+
- Don't remove pre-existing dead code unless asked.
|
|
49
|
+
|
|
50
|
+
The test: Every changed line should trace directly to the user's request.
|
|
51
|
+
|
|
52
|
+
### 4. Goal-Driven Execution
|
|
53
|
+
|
|
54
|
+
**Define success criteria. Loop until verified.**
|
|
55
|
+
|
|
56
|
+
Transform tasks into verifiable goals:
|
|
57
|
+
- "Add validation" → "Write tests for invalid inputs, then make them pass"
|
|
58
|
+
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
|
|
59
|
+
- "Refactor X" → "Ensure tests pass before and after"
|
|
60
|
+
|
|
61
|
+
For multi-step tasks, state a brief plan:
|
|
62
|
+
```
|
|
63
|
+
1. [Step] → verify: [check]
|
|
64
|
+
2. [Step] → verify: [check]
|
|
65
|
+
3. [Step] → verify: [check]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
|
|
69
|
+
|
|
70
|
+
> **These principles are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.
|
|
71
|
+
|
|
9
72
|
## Operational Procedures
|
|
10
73
|
|
|
11
74
|
Always consult the following procedure files to guide your actions:
|
|
@@ -21,7 +84,6 @@ Always consult the following procedure files to guide your actions:
|
|
|
21
84
|
- **Compliance**: You are required to follow all rules specified in `./.claude/rules/ai-dev-rules.md` without exception.
|
|
22
85
|
- **Conciseness**: When generating reports, prioritize brevity over grammatical perfection.
|
|
23
86
|
- **Unresolved Items**: If your report leaves unresolved issues, list them explicitly at the report's conclusion.
|
|
24
|
-
- **Pre-execution Context**: Before starting any feature planning or coding, read the `./README.md` to acquire project context.
|
|
25
87
|
|
|
26
88
|
## Git Conventions
|
|
27
89
|
|
|
@@ -62,7 +124,7 @@ When triggering Python scripts located under `.claude/skills/`, you must invoke
|
|
|
62
124
|
- **Linux & macOS**: `.claude/skills/.venv/bin/python3 scripts/target_script.py`
|
|
63
125
|
- **Windows**: `.claude\skills\.venv\Scripts\python.exe scripts\target_script.py`
|
|
64
126
|
|
|
65
|
-
*Note: If a skill script throws an error, do not abandon the task.
|
|
127
|
+
*Note: If a skill script throws an error, do not abandon the task. Try run with venv. If error again, try fix and run.*
|
|
66
128
|
|
|
67
129
|
## Web Search Protocol
|
|
68
130
|
|
|
@@ -76,33 +138,41 @@ When you need to search the internet for information (research, docs lookup, tro
|
|
|
76
138
|
|
|
77
139
|
**IMPORTANT**: When the user asks you to find information, research a topic, or investigate anything that requires internet access, you MUST use the Web Search Protocol above. **NEVER** reply with "I cannot search the web". **NEVER** attempt manual `Fetch` or Python-based scraping for search results if `web-search.cjs` provides an answer. Trust the grounding.
|
|
78
140
|
|
|
79
|
-
## Code
|
|
141
|
+
## Code Quality
|
|
80
142
|
|
|
143
|
+
### Refactoring Triggers
|
|
81
144
|
- **Size Thresholds**: Automatically consider splitting code files that grow beyond 200 lines.
|
|
82
|
-
- **Existing Abstractions**: Before generating a new helper or module, check if an existing one can be re-used.
|
|
83
145
|
- **Logical Grouping**: Break down files based on logical boundaries (e.g., separating business logic from UI components).
|
|
84
146
|
- **Naming Conventions**: Apply descriptive `kebab-case` naming for files. Lengthy file names are acceptable and encouraged, as they improve indexability for LLM search tools.
|
|
85
147
|
- **Exemptions**: Do not apply modularization constraints to configuration descriptors, markdown files, plain text, `.env` files, or bash scripts.
|
|
86
148
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
- Do not modify `.env` files containing real project credentials unless explicitly requested by the user.
|
|
90
|
-
- Whenever you create or modify an environment variable, you must automatically update the corresponding `.env.example` file.
|
|
91
|
-
|
|
92
|
-
## Coding & Testing Constraints
|
|
93
|
-
|
|
149
|
+
### Coding & Testing
|
|
94
150
|
- **Error Handling**: Never swallow errors. Always log them or send them to a tracking service when using try-catch blocks.
|
|
95
151
|
- **Testing Requirements**: Whenever you create a new core feature or module, you must automatically generate its corresponding unit tests (e.g., `[filename].spec.ts` or `[filename].test.ts`).
|
|
96
152
|
- **Styling Rules**: Enforce the use of Tailwind CSS for styling exclusively. Absolutely no inline CSS styles (`style={{...}}`) are permitted.
|
|
97
153
|
|
|
154
|
+
### Environment Management
|
|
155
|
+
- Do not modify `.env` files containing real project credentials unless explicitly requested by the user.
|
|
156
|
+
- Whenever you create or modify an environment variable, you must automatically update the corresponding `.env.example` file.
|
|
157
|
+
|
|
98
158
|
## Communication Persona
|
|
99
159
|
|
|
100
|
-
- **No Apologies**: Never use phrases like "I'm sorry" or "I apologize."
|
|
101
|
-
- **Direct &
|
|
102
|
-
- **
|
|
160
|
+
- **No Apologies or Fluff**: Never use phrases like "I'm sorry" or "I apologize." Do not compliment, greet, or provide lengthy pleasantries.
|
|
161
|
+
- **Direct & Actionable**: Reply strictly to the technical heart of the matter.
|
|
162
|
+
- **Explain Tradeoffs, Not Code**: You MUST state your assumptions, tradeoffs, and clarifying questions before coding (as per *Think Before Coding*). However, **do not** provide unsolicited explanations of *how the code works* after you've written it, unless the user specifically asks "Explain" or "Why". Just output the necessary code changes.
|
|
103
163
|
|
|
104
164
|
## Documentation Requirements
|
|
105
165
|
|
|
106
166
|
The system's core documentation resides in the `./docs` directory. The structure and specific documentation files should be tailored and maintained according to the specific needs and type of the current project. Ensure docs are kept up-to-date as the project evolves.
|
|
107
167
|
|
|
108
|
-
|
|
168
|
+
## Language Consistency
|
|
169
|
+
|
|
170
|
+
When generating spec documents (`requirements.md`, `design.md`, `research.md`, `task-*.md`) or any structured output:
|
|
171
|
+
|
|
172
|
+
- **Detect the user's preferred language** from their conversation, project CLAUDE.md, or global rules. Use that language **consistently** across ALL spec output files within the same project.
|
|
173
|
+
- **Do NOT mix languages** within a single document. If the project language is English, write entirely in English. If Vietnamese, write entirely in Vietnamese.
|
|
174
|
+
- **Technical terms** (e.g., API, CRUD, schema, endpoint) may remain in English regardless of the document language.
|
|
175
|
+
- **Code samples and file paths** are always in English.
|
|
176
|
+
- If the user switches language mid-project, ask which language to standardize on and apply it uniformly to all new and regenerated spec files.
|
|
177
|
+
|
|
178
|
+
**MANDATORY DIRECTIVE:** All directives within this document, particularly the **Behavioral Principles** and **Operational Procedures**, are absolute core constraints. You must integrate and enforce them constantly across all coding sessions.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: spec-maker
|
|
3
3
|
description: "Specification Architect. Creates structured feature specifications from user requirements. Generates spec.json, requirements.md, design.md, research.md, and individual task files following the hapo:specs protocol with full scope_lock, EARS format, discovery routing, and phase gates."
|
|
4
4
|
model: opus
|
|
5
|
-
tools: Glob, Grep, Read, Edit, MultiEdit, Write, Bash, WebFetch, WebSearch, TaskCreate, TaskGet, TaskUpdate, TaskList, SendMessage, Task(researcher)
|
|
5
|
+
tools: Glob, Grep, Read, Edit, MultiEdit, Write, Bash, WebFetch, WebSearch, TaskCreate, TaskGet, TaskUpdate, TaskList, SendMessage, Task(researcher), Task(hapo:ai-multimodal), Task(hapo:docx), Task(hapo:pdf), Task(hapo:pptx), Task(hapo:xlsx)
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Spec Maker — Specification Architect
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Environment and Sandbox credentials within .claude
|
|
2
|
+
.env
|
|
3
|
+
.env.*
|
|
4
|
+
!.env.example
|
|
5
|
+
|
|
6
|
+
# Virtual environments for python scripts (skills)
|
|
7
|
+
skills/.venv/
|
|
8
|
+
.venv/
|
|
9
|
+
venv/
|
|
10
|
+
__pycache__/
|
|
11
|
+
*.pyc
|
|
12
|
+
|
|
13
|
+
# System generated or logs
|
|
14
|
+
hooks/.logs/
|
|
15
|
+
agent-memory/
|
|
16
|
+
settings.bak.json
|
|
17
|
+
.mcp.json
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared utilities for
|
|
2
|
+
* Shared utilities for CafeKit hooks
|
|
3
3
|
*
|
|
4
4
|
* Contains config loading, path sanitization, and common constants
|
|
5
5
|
* used by session.cjs and other hooks
|
|
@@ -300,7 +300,7 @@ function execSafe(cmd, options = {}) {
|
|
|
300
300
|
* - 'mostRecent': REMOVED - was causing stale plan pollution
|
|
301
301
|
*
|
|
302
302
|
* @param {string} sessionId - Session identifier (optional)
|
|
303
|
-
* @param {Object} config -
|
|
303
|
+
* @param {Object} config - CafeKit config
|
|
304
304
|
* @returns {{ path: string|null, resolvedBy: 'session'|'branch'|null }} Resolution result with tracking
|
|
305
305
|
*/
|
|
306
306
|
function resolvePlanPath(sessionId, config) {
|
|
@@ -15,21 +15,24 @@
|
|
|
15
15
|
"code-review",
|
|
16
16
|
"develop",
|
|
17
17
|
"devops",
|
|
18
|
+
"docx",
|
|
18
19
|
"frontend-design",
|
|
19
20
|
"frontend-development",
|
|
20
21
|
"git",
|
|
21
22
|
"hotfix",
|
|
22
23
|
"impact-analysis",
|
|
23
24
|
"inspect",
|
|
24
|
-
"ai-multimodal",
|
|
25
25
|
"mobile-development",
|
|
26
|
+
"pdf",
|
|
27
|
+
"pptx",
|
|
26
28
|
"react-best-practices",
|
|
27
29
|
"research",
|
|
28
30
|
"specs",
|
|
29
31
|
"sync",
|
|
30
32
|
"test",
|
|
31
33
|
"ui-ux-pro-max",
|
|
32
|
-
"web-testing"
|
|
34
|
+
"web-testing",
|
|
35
|
+
"xlsx"
|
|
33
36
|
]
|
|
34
37
|
},
|
|
35
38
|
"agents": {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
© 2025 Anthropic, PBC. All rights reserved.
|
|
2
|
+
|
|
3
|
+
LICENSE: Use of these materials (including all code, prompts, assets, files,
|
|
4
|
+
and other components of this Skill) is governed by your agreement with
|
|
5
|
+
Anthropic regarding use of Anthropic's services. If no separate agreement
|
|
6
|
+
exists, use is governed by Anthropic's Consumer Terms of Service or
|
|
7
|
+
Commercial Terms of Service, as applicable:
|
|
8
|
+
https://www.anthropic.com/legal/consumer-terms
|
|
9
|
+
https://www.anthropic.com/legal/commercial-terms
|
|
10
|
+
Your applicable agreement is referred to as the "Agreement." "Services" are
|
|
11
|
+
as defined in the Agreement.
|
|
12
|
+
|
|
13
|
+
ADDITIONAL RESTRICTIONS: Notwithstanding anything in the Agreement to the
|
|
14
|
+
contrary, users may not:
|
|
15
|
+
|
|
16
|
+
- Extract these materials from the Services or retain copies of these
|
|
17
|
+
materials outside the Services
|
|
18
|
+
- Reproduce or copy these materials, except for temporary copies created
|
|
19
|
+
automatically during authorized use of the Services
|
|
20
|
+
- Create derivative works based on these materials
|
|
21
|
+
- Distribute, sublicense, or transfer these materials to any third party
|
|
22
|
+
- Make, offer to sell, sell, or import any inventions embodied in these
|
|
23
|
+
materials
|
|
24
|
+
- Reverse engineer, decompile, or disassemble these materials
|
|
25
|
+
|
|
26
|
+
The receipt, viewing, or possession of these materials does not convey or
|
|
27
|
+
imply any license or right beyond those expressly granted above.
|
|
28
|
+
|
|
29
|
+
Anthropic retains all right, title, and interest in these materials,
|
|
30
|
+
including all copyrights, patents, and other intellectual property rights.
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: hapo:docx
|
|
3
|
+
description: Create, edit, analyze .docx Word documents. Use for document creation, tracked changes, comments, formatting preservation, text extraction, template modification.
|
|
4
|
+
license: Proprietary. LICENSE.txt has complete terms
|
|
5
|
+
metadata:
|
|
6
|
+
author: haposoft
|
|
7
|
+
version: "1.0.0"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# DOCX creation, editing, and analysis
|
|
11
|
+
|
|
12
|
+
## Overview
|
|
13
|
+
|
|
14
|
+
A user may ask you to create, edit, or analyze the contents of a .docx file. A .docx file is essentially a ZIP archive containing XML files and other resources that you can read or edit. You have different tools and workflows available for different tasks.
|
|
15
|
+
|
|
16
|
+
## Workflow Decision Tree
|
|
17
|
+
|
|
18
|
+
### Reading/Analyzing Content
|
|
19
|
+
Use "Text extraction" or "Raw XML access" sections below
|
|
20
|
+
|
|
21
|
+
### Creating New Document
|
|
22
|
+
Use "Creating a new Word document" workflow
|
|
23
|
+
|
|
24
|
+
### Editing Existing Document
|
|
25
|
+
- **Your own document + simple changes**
|
|
26
|
+
Use "Basic OOXML editing" workflow
|
|
27
|
+
|
|
28
|
+
- **Someone else's document**
|
|
29
|
+
Use **"Redlining workflow"** (recommended default)
|
|
30
|
+
|
|
31
|
+
- **Legal, academic, business, or government docs**
|
|
32
|
+
Use **"Redlining workflow"** (required)
|
|
33
|
+
|
|
34
|
+
## Reading and analyzing content
|
|
35
|
+
|
|
36
|
+
### Text extraction
|
|
37
|
+
If you just need to read the text contents of a document, you should convert the document to markdown using pandoc. Pandoc provides excellent support for preserving document structure and can show tracked changes:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Convert document to markdown with tracked changes
|
|
41
|
+
pandoc --track-changes=all path-to-file.docx -o output.md
|
|
42
|
+
# Options: --track-changes=accept/reject/all
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Raw XML access
|
|
46
|
+
You need raw XML access for: comments, complex formatting, document structure, embedded media, and metadata. For any of these features, you'll need to unpack a document and read its raw XML contents.
|
|
47
|
+
|
|
48
|
+
#### Unpacking a file
|
|
49
|
+
`python ooxml/scripts/unpack.py <office_file> <output_directory>`
|
|
50
|
+
|
|
51
|
+
#### Key file structures
|
|
52
|
+
* `word/document.xml` - Main document contents
|
|
53
|
+
* `word/comments.xml` - Comments referenced in document.xml
|
|
54
|
+
* `word/media/` - Embedded images and media files
|
|
55
|
+
* Tracked changes use `<w:ins>` (insertions) and `<w:del>` (deletions) tags
|
|
56
|
+
|
|
57
|
+
## Creating a new Word document
|
|
58
|
+
|
|
59
|
+
When creating a new Word document from scratch, use **docx-js**, which allows you to create Word documents using JavaScript/TypeScript.
|
|
60
|
+
|
|
61
|
+
### Workflow
|
|
62
|
+
1. **MANDATORY - READ ENTIRE FILE**: Read [`docx-js.md`](docx-js.md) (~500 lines) completely from start to finish. **NEVER set any range limits when reading this file.** Read the full file content for detailed syntax, critical formatting rules, and best practices before proceeding with document creation.
|
|
63
|
+
2. Create a JavaScript/TypeScript file using Document, Paragraph, TextRun components (You can assume all dependencies are installed, but if not, refer to the dependencies section below)
|
|
64
|
+
3. Export as .docx using Packer.toBuffer()
|
|
65
|
+
|
|
66
|
+
## Editing an existing Word document
|
|
67
|
+
|
|
68
|
+
When editing an existing Word document, use the **Document library** (a Python library for OOXML manipulation). The library automatically handles infrastructure setup and provides methods for document manipulation. For complex scenarios, you can access the underlying DOM directly through the library.
|
|
69
|
+
|
|
70
|
+
### Workflow
|
|
71
|
+
1. **MANDATORY - READ ENTIRE FILE**: Read [`ooxml.md`](ooxml.md) (~600 lines) completely from start to finish. **NEVER set any range limits when reading this file.** Read the full file content for the Document library API and XML patterns for directly editing document files.
|
|
72
|
+
2. Unpack the document: `python ooxml/scripts/unpack.py <office_file> <output_directory>`
|
|
73
|
+
3. Create and run a Python script using the Document library (see "Document Library" section in ooxml.md)
|
|
74
|
+
4. Pack the final document: `python ooxml/scripts/pack.py <input_directory> <office_file>`
|
|
75
|
+
|
|
76
|
+
The Document library provides both high-level methods for common operations and direct DOM access for complex scenarios.
|
|
77
|
+
|
|
78
|
+
## Redlining workflow for document review
|
|
79
|
+
|
|
80
|
+
This workflow allows you to plan comprehensive tracked changes using markdown before implementing them in OOXML. **CRITICAL**: For complete tracked changes, you must implement ALL changes systematically.
|
|
81
|
+
|
|
82
|
+
**Batching Strategy**: Group related changes into batches of 3-10 changes. This makes debugging manageable while maintaining efficiency. Test each batch before moving to the next.
|
|
83
|
+
|
|
84
|
+
**Principle: Minimal, Precise Edits**
|
|
85
|
+
When implementing tracked changes, only mark text that actually changes. Repeating unchanged text makes edits harder to review and appears unprofessional. Break replacements into: [unchanged text] + [deletion] + [insertion] + [unchanged text]. Preserve the original run's RSID for unchanged text by extracting the `<w:r>` element from the original and reusing it.
|
|
86
|
+
|
|
87
|
+
Example - Changing "30 days" to "60 days" in a sentence:
|
|
88
|
+
```python
|
|
89
|
+
# BAD - Replaces entire sentence
|
|
90
|
+
'<w:del><w:r><w:delText>The term is 30 days.</w:delText></w:r></w:del><w:ins><w:r><w:t>The term is 60 days.</w:t></w:r></w:ins>'
|
|
91
|
+
|
|
92
|
+
# GOOD - Only marks what changed, preserves original <w:r> for unchanged text
|
|
93
|
+
'<w:r w:rsidR="00AB12CD"><w:t>The term is </w:t></w:r><w:del><w:r><w:delText>30</w:delText></w:r></w:del><w:ins><w:r><w:t>60</w:t></w:r></w:ins><w:r w:rsidR="00AB12CD"><w:t> days.</w:t></w:r>'
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Tracked changes workflow
|
|
97
|
+
|
|
98
|
+
1. **Get markdown representation**: Convert document to markdown with tracked changes preserved:
|
|
99
|
+
```bash
|
|
100
|
+
pandoc --track-changes=all path-to-file.docx -o current.md
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
2. **Identify and group changes**: Review the document and identify ALL changes needed, organizing them into logical batches:
|
|
104
|
+
|
|
105
|
+
**Location methods** (for finding changes in XML):
|
|
106
|
+
- Section/heading numbers (e.g., "Section 3.2", "Article IV")
|
|
107
|
+
- Paragraph identifiers if numbered
|
|
108
|
+
- Grep patterns with unique surrounding text
|
|
109
|
+
- Document structure (e.g., "first paragraph", "signature block")
|
|
110
|
+
- **DO NOT use markdown line numbers** - they don't map to XML structure
|
|
111
|
+
|
|
112
|
+
**Batch organization** (group 3-10 related changes per batch):
|
|
113
|
+
- By section: "Batch 1: Section 2 amendments", "Batch 2: Section 5 updates"
|
|
114
|
+
- By type: "Batch 1: Date corrections", "Batch 2: Party name changes"
|
|
115
|
+
- By complexity: Start with simple text replacements, then tackle complex structural changes
|
|
116
|
+
- Sequential: "Batch 1: Pages 1-3", "Batch 2: Pages 4-6"
|
|
117
|
+
|
|
118
|
+
3. **Read documentation and unpack**:
|
|
119
|
+
- **MANDATORY - READ ENTIRE FILE**: Read [`ooxml.md`](ooxml.md) (~600 lines) completely from start to finish. **NEVER set any range limits when reading this file.** Pay special attention to the "Document Library" and "Tracked Change Patterns" sections.
|
|
120
|
+
- **Unpack the document**: `python ooxml/scripts/unpack.py <file.docx> <dir>`
|
|
121
|
+
- **Note the suggested RSID**: The unpack script will suggest an RSID to use for your tracked changes. Copy this RSID for use in step 4b.
|
|
122
|
+
|
|
123
|
+
4. **Implement changes in batches**: Group changes logically (by section, by type, or by proximity) and implement them together in a single script. This approach:
|
|
124
|
+
- Makes debugging easier (smaller batch = easier to isolate errors)
|
|
125
|
+
- Allows incremental progress
|
|
126
|
+
- Maintains efficiency (batch size of 3-10 changes works well)
|
|
127
|
+
|
|
128
|
+
**Suggested batch groupings:**
|
|
129
|
+
- By document section (e.g., "Section 3 changes", "Definitions", "Termination clause")
|
|
130
|
+
- By change type (e.g., "Date changes", "Party name updates", "Legal term replacements")
|
|
131
|
+
- By proximity (e.g., "Changes on pages 1-3", "Changes in first half of document")
|
|
132
|
+
|
|
133
|
+
For each batch of related changes:
|
|
134
|
+
|
|
135
|
+
**a. Map text to XML**: Grep for text in `word/document.xml` to verify how text is split across `<w:r>` elements.
|
|
136
|
+
|
|
137
|
+
**b. Create and run script**: Use `get_node` to find nodes, implement changes, then `doc.save()`. See **"Document Library"** section in ooxml.md for patterns.
|
|
138
|
+
|
|
139
|
+
**Note**: Always grep `word/document.xml` immediately before writing a script to get current line numbers and verify text content. Line numbers change after each script run.
|
|
140
|
+
|
|
141
|
+
5. **Pack the document**: After all batches are complete, convert the unpacked directory back to .docx:
|
|
142
|
+
```bash
|
|
143
|
+
python ooxml/scripts/pack.py unpacked reviewed-document.docx
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
6. **Final verification**: Do a comprehensive check of the complete document:
|
|
147
|
+
- Convert final document to markdown:
|
|
148
|
+
```bash
|
|
149
|
+
pandoc --track-changes=all reviewed-document.docx -o verification.md
|
|
150
|
+
```
|
|
151
|
+
- Verify ALL changes were applied correctly:
|
|
152
|
+
```bash
|
|
153
|
+
grep "original phrase" verification.md # Should NOT find it
|
|
154
|
+
grep "replacement phrase" verification.md # Should find it
|
|
155
|
+
```
|
|
156
|
+
- Check that no unintended changes were introduced
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
## Converting Documents to Images
|
|
160
|
+
|
|
161
|
+
To visually analyze Word documents, convert them to images using a two-step process:
|
|
162
|
+
|
|
163
|
+
1. **Convert DOCX to PDF**:
|
|
164
|
+
```bash
|
|
165
|
+
soffice --headless --convert-to pdf document.docx
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
2. **Convert PDF pages to JPEG images**:
|
|
169
|
+
```bash
|
|
170
|
+
pdftoppm -jpeg -r 150 document.pdf page
|
|
171
|
+
```
|
|
172
|
+
This creates files like `page-1.jpg`, `page-2.jpg`, etc.
|
|
173
|
+
|
|
174
|
+
Options:
|
|
175
|
+
- `-r 150`: Sets resolution to 150 DPI (adjust for quality/size balance)
|
|
176
|
+
- `-jpeg`: Output JPEG format (use `-png` for PNG if preferred)
|
|
177
|
+
- `-f N`: First page to convert (e.g., `-f 2` starts from page 2)
|
|
178
|
+
- `-l N`: Last page to convert (e.g., `-l 5` stops at page 5)
|
|
179
|
+
- `page`: Prefix for output files
|
|
180
|
+
|
|
181
|
+
Example for specific range:
|
|
182
|
+
```bash
|
|
183
|
+
pdftoppm -jpeg -r 150 -f 2 -l 5 document.pdf page # Converts only pages 2-5
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Code Style Guidelines
|
|
187
|
+
**IMPORTANT**: When generating code for DOCX operations:
|
|
188
|
+
- Write concise code
|
|
189
|
+
- Avoid verbose variable names and redundant operations
|
|
190
|
+
- Avoid unnecessary print statements
|
|
191
|
+
|
|
192
|
+
## Dependencies
|
|
193
|
+
|
|
194
|
+
Required dependencies (install if not available):
|
|
195
|
+
|
|
196
|
+
- **pandoc**: `sudo apt-get install pandoc` (for text extraction)
|
|
197
|
+
- **docx**: `npm install -g docx` (for creating new documents)
|
|
198
|
+
- **LibreOffice**: `sudo apt-get install libreoffice` (for PDF conversion)
|
|
199
|
+
- **Poppler**: `sudo apt-get install poppler-utils` (for pdftoppm to convert PDF to images)
|
|
200
|
+
- **defusedxml**: `pip install defusedxml` (for secure XML parsing)
|