@kood/claude-code 0.5.3 → 0.5.4
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/dist/index.js +548 -340
- package/package.json +1 -1
- package/templates/.claude/agents/document-writer.md +71 -304
- package/templates/.claude/instructions/agent-patterns/index.md +7 -7
- package/templates/.claude/instructions/document-templates/ralph-templates.md +71 -0
- package/templates/.claude/instructions/index.md +14 -14
- package/templates/.claude/instructions/multi-agent/agent-roster.md +14 -14
- package/templates/.claude/instructions/multi-agent/index.md +4 -4
- package/templates/.claude/skills/docs-creator/AGENTS.md +54 -176
- package/templates/.claude/skills/docs-creator/SKILL.md +97 -463
- package/templates/.claude/skills/docs-refactor/AGENTS.md +61 -190
- package/templates/.claude/skills/docs-refactor/SKILL.md +66 -442
- package/templates/.claude/skills/execute/SKILL.md +540 -13
- package/templates/.claude/skills/plan/SKILL.md +83 -17
- package/templates/.claude/skills/ralph/SKILL.md +17 -14
- package/templates/.claude/skills/refactor/AGENTS.md +269 -0
- package/templates/.claude/skills/refactor/SKILL.md +424 -66
- package/templates/.claude/skills/stitch-design/README.md +34 -0
- package/templates/.claude/skills/stitch-design/SKILL.md +213 -0
- package/templates/.claude/skills/stitch-design/examples/DESIGN.md +154 -0
- package/templates/.claude/skills/stitch-loop/README.md +54 -0
- package/templates/.claude/skills/stitch-loop/SKILL.md +316 -0
- package/templates/.claude/skills/stitch-loop/examples/SITE.md +73 -0
- package/templates/.claude/skills/stitch-loop/examples/next-prompt.md +25 -0
- package/templates/.claude/skills/stitch-loop/resources/baton-schema.md +61 -0
- package/templates/.claude/skills/stitch-loop/resources/site-template.md +104 -0
- package/templates/.claude/skills/stitch-react/README.md +36 -0
- package/templates/.claude/skills/stitch-react/SKILL.md +323 -0
- package/templates/.claude/skills/stitch-react/examples/gold-standard-card.tsx +88 -0
- package/templates/.claude/skills/stitch-react/package-lock.json +231 -0
- package/templates/.claude/skills/stitch-react/package.json +16 -0
- package/templates/.claude/skills/stitch-react/resources/architecture-checklist.md +15 -0
- package/templates/.claude/skills/stitch-react/resources/component-template.tsx +37 -0
- package/templates/.claude/skills/stitch-react/resources/stitch-api-reference.md +14 -0
- package/templates/.claude/skills/stitch-react/resources/style-guide.json +24 -0
- package/templates/.claude/skills/stitch-react/scripts/fetch-stitch.sh +30 -0
- package/templates/.claude/skills/stitch-react/scripts/validate.js +77 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 Google LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import React from 'react';
|
|
18
|
+
|
|
19
|
+
// Use a valid identifier like 'StitchComponent' as the placeholder
|
|
20
|
+
interface StitchComponentProps {
|
|
21
|
+
readonly children?: React.ReactNode;
|
|
22
|
+
readonly className?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const StitchComponent: React.FC<StitchComponentProps> = ({
|
|
26
|
+
children,
|
|
27
|
+
className = '',
|
|
28
|
+
...props
|
|
29
|
+
}) => {
|
|
30
|
+
return (
|
|
31
|
+
<div className={`relative ${className}`} {...props}>
|
|
32
|
+
{children}
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default StitchComponent;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Stitch API reference
|
|
2
|
+
|
|
3
|
+
This document describes the data structures returned by the Stitch MCP server to ensure accurate component mapping.
|
|
4
|
+
|
|
5
|
+
### Metadata schema
|
|
6
|
+
When calling `get_screen`, the server returns a JSON object with these key properties:
|
|
7
|
+
* **htmlCode**: Contains a `downloadUrl`. This is a signed URL that requires a system-level fetch (curl) to handle redirects and security handshakes.
|
|
8
|
+
* **screenshot**: Includes a `downloadUrl` for the visual design. Use this to verify layout intent that might not be obvious in the raw HTML.
|
|
9
|
+
* **deviceType**: Usually set to `DESKTOP`. All generated components should prioritize the corresponding viewport (2560px width) as the base layout.
|
|
10
|
+
|
|
11
|
+
### Technical mapping rules
|
|
12
|
+
1. **Element tracking**: Preserve `data-stitch-id` attributes as comments in the TSX to allow for future design synchronization.
|
|
13
|
+
2. **Asset handling**: Treat background images in the HTML as dynamic data. Extract the URLs into `mockData.ts` rather than hardcoding them into the component styles.
|
|
14
|
+
3. **Style extraction**: The HTML `<head>` contains a localized `tailwind.config`. This config must be merged with the local project theme to ensure colors like `primary` and `background-dark` render correctly.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"theme": {
|
|
3
|
+
"colors": {
|
|
4
|
+
"primary": "#19e66f",
|
|
5
|
+
"background": {
|
|
6
|
+
"light": "#f6f8f7",
|
|
7
|
+
"dark": "#112118",
|
|
8
|
+
"elevated": "#1A1A1A"
|
|
9
|
+
},
|
|
10
|
+
"accent": {
|
|
11
|
+
"purple": "#8A2BE2",
|
|
12
|
+
"lavender": "#D0A9F5"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"typography": {
|
|
16
|
+
"display": ["Space Grotesk", "sans-serif"],
|
|
17
|
+
"icons": "Material Symbols Outlined"
|
|
18
|
+
},
|
|
19
|
+
"spacing": {
|
|
20
|
+
"header-h": "72px",
|
|
21
|
+
"container-max": "960px"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Copyright 2026 Google LLC
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
|
|
16
|
+
URL=$1
|
|
17
|
+
OUTPUT=$2
|
|
18
|
+
if [ -z "$URL" ] || [ -z "$OUTPUT" ]; then
|
|
19
|
+
echo "Usage: $0 <url> <output_path>"
|
|
20
|
+
exit 1
|
|
21
|
+
fi
|
|
22
|
+
echo "Initiating high-reliability fetch for Stitch HTML..."
|
|
23
|
+
curl -L -f -sS --connect-timeout 10 --compressed "$URL" -o "$OUTPUT"
|
|
24
|
+
if [ $? -eq 0 ]; then
|
|
25
|
+
echo "✅ Successfully retrieved HTML at: $OUTPUT"
|
|
26
|
+
exit 0
|
|
27
|
+
else
|
|
28
|
+
echo "❌ Error: Failed to retrieve content. Check TLS/SNI or URL expiration."
|
|
29
|
+
exit 1
|
|
30
|
+
fi
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 Google LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import swc from '@swc/core';
|
|
18
|
+
import fs from 'node:fs';
|
|
19
|
+
import path from 'node:path';
|
|
20
|
+
|
|
21
|
+
async function validateComponent(filePath) {
|
|
22
|
+
const code = fs.readFileSync(filePath, 'utf-8');
|
|
23
|
+
const filename = path.basename(filePath);
|
|
24
|
+
try {
|
|
25
|
+
const ast = await swc.parse(code, { syntax: 'typescript', tsx: true });
|
|
26
|
+
let hasInterface = false;
|
|
27
|
+
let tailwindIssues = [];
|
|
28
|
+
|
|
29
|
+
console.log('🔍 Scanning AST...');
|
|
30
|
+
|
|
31
|
+
const walk = (node) => {
|
|
32
|
+
if (!node) return;
|
|
33
|
+
if (
|
|
34
|
+
node.type === 'TsInterfaceDeclaration' &&
|
|
35
|
+
node.id.value.endsWith('Props')
|
|
36
|
+
)
|
|
37
|
+
hasInterface = true;
|
|
38
|
+
if (node.type === 'JSXAttribute' && node.name.name === 'className') {
|
|
39
|
+
if (node.value?.value && /#[0-9A-Fa-f]{6}/.test(node.value.value))
|
|
40
|
+
tailwindIssues.push(node.value.value);
|
|
41
|
+
}
|
|
42
|
+
for (const key in node) {
|
|
43
|
+
if (node[key] && typeof node[key] === 'object') walk(node[key]);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
walk(ast);
|
|
47
|
+
|
|
48
|
+
console.log(`--- Validation for: ${filename} ---`);
|
|
49
|
+
if (hasInterface) {
|
|
50
|
+
console.log('✅ Props declaration found.');
|
|
51
|
+
} else {
|
|
52
|
+
console.error("❌ MISSING: Props interface (must end in 'Props').");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (tailwindIssues.length === 0) {
|
|
56
|
+
console.log('✅ No hardcoded hex values found.');
|
|
57
|
+
} else {
|
|
58
|
+
console.error(
|
|
59
|
+
`❌ STYLE: Found ${tailwindIssues.length} hardcoded hex codes.`,
|
|
60
|
+
);
|
|
61
|
+
tailwindIssues.forEach((hex) => console.error(` - ${hex}`));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (hasInterface && tailwindIssues.length === 0) {
|
|
65
|
+
console.log('\n✨ COMPONENT VALID.');
|
|
66
|
+
process.exit(0);
|
|
67
|
+
} else {
|
|
68
|
+
console.error('\n🚫 VALIDATION FAILED.');
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
} catch (err) {
|
|
72
|
+
console.error('❌ PARSE ERROR:', err.message);
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
validateComponent(process.argv[2]);
|