@slahon/lazykit 1.0.2 → 1.0.5
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/claude-md.js +4 -7
- package/init.js +7 -7
- package/package.json +1 -1
- package/workflow.js +3 -11
package/claude-md.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
function generateClaudeMd({ stack
|
|
4
|
-
const hasLint = lintCommand && lintCommand !== 'skip';
|
|
5
|
-
const hasTest = testCommand && testCommand !== 'skip';
|
|
6
|
-
|
|
3
|
+
function generateClaudeMd({ stack }) {
|
|
7
4
|
return `# LazyKit — Project Guide for Claude
|
|
8
5
|
|
|
9
6
|
## Stack
|
|
@@ -15,9 +12,9 @@ ${stack || 'Describe your tech stack here (e.g. TypeScript + Next.js, Postgres v
|
|
|
15
12
|
- Keep changes scoped to what the issue asks for — do not refactor unrelated code.
|
|
16
13
|
|
|
17
14
|
## Before opening a PR, always:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
3. If you
|
|
15
|
+
1. Check your code for obvious errors.
|
|
16
|
+
2. Make sure existing functionality is not broken.
|
|
17
|
+
3. If you encounter errors you cannot fix, comment on the issue explaining why instead of pushing broken code.
|
|
21
18
|
|
|
22
19
|
## Never
|
|
23
20
|
- Touch \`.github/workflows/\`, secrets, or CI configuration.
|
package/init.js
CHANGED
|
@@ -18,7 +18,11 @@ async function init() {
|
|
|
18
18
|
|
|
19
19
|
// ─── Step 1: Verify git repo ─────────────────────────────────────────────
|
|
20
20
|
if (!isGitRepo()) {
|
|
21
|
-
log.error('Not inside a git repository.
|
|
21
|
+
log.error('Not inside a git repository.');
|
|
22
|
+
console.log(chalk.gray('\n LazyKit needs a git repo with a GitHub remote. To set one up:\n'));
|
|
23
|
+
console.log(chalk.cyan(' git init'));
|
|
24
|
+
console.log(chalk.cyan(' git remote add origin https://github.com/<you>/<repo>'));
|
|
25
|
+
console.log(chalk.gray('\n Then re-run: ') + chalk.cyan('npx @slahon/lazykit init\n'));
|
|
22
26
|
process.exit(1);
|
|
23
27
|
}
|
|
24
28
|
|
|
@@ -46,10 +50,6 @@ async function init() {
|
|
|
46
50
|
|
|
47
51
|
const stack = await ask('What is your stack?', 'e.g. TypeScript + Next.js, Postgres');
|
|
48
52
|
|
|
49
|
-
const lintCommand = await ask('Lint command', 'npm run lint');
|
|
50
|
-
|
|
51
|
-
const testCommand = await ask('Test command', 'npm test');
|
|
52
|
-
|
|
53
53
|
const wantClaudeMd = await confirm('Generate CLAUDE.md project guide?', true);
|
|
54
54
|
|
|
55
55
|
log.blank();
|
|
@@ -61,7 +61,7 @@ async function init() {
|
|
|
61
61
|
fs.mkdirSync(workflowDir, { recursive: true });
|
|
62
62
|
|
|
63
63
|
const workflowPath = path.join(workflowDir, 'lazykit.yml');
|
|
64
|
-
const workflowContent = generateWorkflow({ label
|
|
64
|
+
const workflowContent = generateWorkflow({ label });
|
|
65
65
|
fs.writeFileSync(workflowPath, workflowContent);
|
|
66
66
|
|
|
67
67
|
spinner.succeed(chalk.green('Created .github/workflows/lazykit.yml'));
|
|
@@ -69,7 +69,7 @@ async function init() {
|
|
|
69
69
|
// ─── Step 4: Create CLAUDE.md ────────────────────────────────────────────
|
|
70
70
|
if (wantClaudeMd) {
|
|
71
71
|
const claudeMdPath = path.join(process.cwd(), 'CLAUDE.md');
|
|
72
|
-
const claudeMdContent = generateClaudeMd({ stack
|
|
72
|
+
const claudeMdContent = generateClaudeMd({ stack });
|
|
73
73
|
|
|
74
74
|
if (fs.existsSync(claudeMdPath)) {
|
|
75
75
|
const overwrite = await confirm('CLAUDE.md already exists. Overwrite?', false);
|
package/package.json
CHANGED
package/workflow.js
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
function generateWorkflow({ label
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const checks = [
|
|
8
|
-
hasLint ? `Run \`${lintCommand}\` and fix any issues before committing.` : null,
|
|
9
|
-
hasTest ? `Run \`${testCommand}\` and make sure all tests pass before committing.` : null,
|
|
10
|
-
'If lint or tests fail and you cannot fix them, do NOT commit — instead post a comment on the issue explaining what went wrong.',
|
|
11
|
-
].filter(Boolean);
|
|
12
|
-
|
|
13
|
-
const checkList = checks.map((c, i) => ` ${i + 1}. ${c}`).join('\n');
|
|
3
|
+
function generateWorkflow({ label }) {
|
|
4
|
+
const checkList = ` 1. Review your changes and make sure no existing functionality is broken.
|
|
5
|
+
2. If you encounter errors you cannot fix, post a comment on the issue explaining what went wrong instead of committing broken code.`;
|
|
14
6
|
|
|
15
7
|
return `name: LazyKit
|
|
16
8
|
|