claudekit-cli 1.4.1 → 1.5.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/bin/ck-darwin-arm64 +0 -0
- package/bin/ck-darwin-x64 +0 -0
- package/bin/ck-linux-x64 +0 -0
- package/bin/ck-win32-x64.exe +0 -0
- package/package.json +8 -2
- package/scripts/postinstall.js +74 -0
- package/.github/workflows/ci.yml +0 -45
- package/.github/workflows/claude-code-review.yml +0 -57
- package/.github/workflows/claude.yml +0 -50
- package/.github/workflows/release.yml +0 -102
- package/.releaserc.json +0 -17
- package/.repomixignore +0 -15
- package/AGENTS.md +0 -217
- package/CHANGELOG.md +0 -95
- package/CLAUDE.md +0 -34
- package/biome.json +0 -28
- package/bun.lock +0 -863
- package/dist/index.js +0 -22511
- package/src/commands/new.ts +0 -185
- package/src/commands/update.ts +0 -174
- package/src/commands/version.ts +0 -135
- package/src/index.ts +0 -102
- package/src/lib/auth.ts +0 -157
- package/src/lib/download.ts +0 -689
- package/src/lib/github.ts +0 -230
- package/src/lib/merge.ts +0 -119
- package/src/lib/prompts.ts +0 -114
- package/src/types.ts +0 -178
- package/src/utils/config.ts +0 -87
- package/src/utils/file-scanner.ts +0 -134
- package/src/utils/logger.ts +0 -124
- package/src/utils/safe-prompts.ts +0 -44
- package/src/utils/safe-spinner.ts +0 -38
- package/src/version.json +0 -3
- package/tests/commands/version.test.ts +0 -297
- package/tests/integration/cli.test.ts +0 -252
- package/tests/lib/auth.test.ts +0 -116
- package/tests/lib/download.test.ts +0 -292
- package/tests/lib/github-download-priority.test.ts +0 -432
- package/tests/lib/github.test.ts +0 -52
- package/tests/lib/merge.test.ts +0 -267
- package/tests/lib/prompts.test.ts +0 -66
- package/tests/types.test.ts +0 -337
- package/tests/utils/config.test.ts +0 -263
- package/tests/utils/file-scanner.test.ts +0 -202
- package/tests/utils/logger.test.ts +0 -239
- package/tsconfig.json +0 -30
|
Binary file
|
|
Binary file
|
package/bin/ck-linux-x64
ADDED
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudekit-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"ck": "./
|
|
7
|
+
"ck": "./bin/ck"
|
|
8
8
|
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin",
|
|
11
|
+
"scripts/postinstall.js"
|
|
12
|
+
],
|
|
9
13
|
"scripts": {
|
|
14
|
+
"postinstall": "node scripts/postinstall.js",
|
|
10
15
|
"dev": "bun run src/index.ts >> logs.txt 2>&1",
|
|
11
16
|
"build": "bun build src/index.ts --outdir dist --target node --external keytar --external @octokit/rest >> logs.txt 2>&1",
|
|
12
17
|
"compile": "bun build src/index.ts --compile --outfile ck >> logs.txt 2>&1",
|
|
18
|
+
"compile:binary": "bun build src/index.ts --compile --outfile bin/ck",
|
|
13
19
|
"test": "bun test >> logs.txt 2>&1",
|
|
14
20
|
"test:watch": "bun test --watch >> logs.txt 2>&1",
|
|
15
21
|
"lint": "biome check . >> logs.txt 2>&1",
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Post-install script to copy the correct platform-specific binary
|
|
5
|
+
* This runs after `npm install` to set up the executable
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { chmodSync, copyFileSync, existsSync } from "node:fs";
|
|
9
|
+
import { dirname, join } from "node:path";
|
|
10
|
+
import { fileURLToPath } from "node:url";
|
|
11
|
+
|
|
12
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const binDir = join(__dirname, "..", "bin");
|
|
14
|
+
|
|
15
|
+
if (!existsSync(binDir)) {
|
|
16
|
+
console.warn(`⚠️ Skipping binary setup: missing directory at ${binDir}`);
|
|
17
|
+
process.exit(0);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Detect platform and architecture
|
|
21
|
+
const platform = process.platform; // darwin, linux, win32
|
|
22
|
+
const arch = process.arch; // arm64, x64
|
|
23
|
+
|
|
24
|
+
// Map to binary filename
|
|
25
|
+
const getBinaryName = () => {
|
|
26
|
+
const ext = platform === "win32" ? ".exe" : "";
|
|
27
|
+
|
|
28
|
+
// Map platform-arch combinations to binary names
|
|
29
|
+
const binaryMap = {
|
|
30
|
+
"darwin-arm64": `ck-darwin-arm64${ext}`,
|
|
31
|
+
"darwin-x64": `ck-darwin-x64${ext}`,
|
|
32
|
+
"linux-x64": `ck-linux-x64${ext}`,
|
|
33
|
+
// 'linux-arm64': `ck-linux-arm64${ext}`, // Not yet supported
|
|
34
|
+
"win32-x64": `ck-win32-x64${ext}`,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const key = `${platform}-${arch}`;
|
|
38
|
+
return binaryMap[key];
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const binaryName = getBinaryName();
|
|
42
|
+
|
|
43
|
+
if (!binaryName) {
|
|
44
|
+
console.error(`❌ Unsupported platform: ${platform}-${arch}`);
|
|
45
|
+
console.error("Supported platforms: macOS (arm64, x64), Linux (x64, arm64), Windows (x64)");
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const sourceBinary = join(binDir, binaryName);
|
|
50
|
+
const targetBinary = join(binDir, platform === "win32" ? "ck.exe" : "ck");
|
|
51
|
+
|
|
52
|
+
// Check if platform-specific binary exists
|
|
53
|
+
if (!existsSync(sourceBinary)) {
|
|
54
|
+
console.warn(`⚠️ Binary not found at ${sourceBinary}. Skipping postinstall step.`);
|
|
55
|
+
console.warn(
|
|
56
|
+
"If you are developing locally, run `bun run compile:binary` to create a platform binary.",
|
|
57
|
+
);
|
|
58
|
+
process.exit(0);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
try {
|
|
62
|
+
// Copy the binary
|
|
63
|
+
copyFileSync(sourceBinary, targetBinary);
|
|
64
|
+
|
|
65
|
+
// Make it executable (Unix-like systems)
|
|
66
|
+
if (platform !== "win32") {
|
|
67
|
+
chmodSync(targetBinary, 0o755);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
console.log(`✅ claudekit-cli installed for ${platform}-${arch}`);
|
|
71
|
+
} catch (error) {
|
|
72
|
+
console.error(`❌ Failed to install binary: ${error.message}`);
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
- master
|
|
8
|
-
- dev
|
|
9
|
-
push:
|
|
10
|
-
branches:
|
|
11
|
-
- main
|
|
12
|
-
- master
|
|
13
|
-
- dev
|
|
14
|
-
|
|
15
|
-
jobs:
|
|
16
|
-
test:
|
|
17
|
-
name: Test
|
|
18
|
-
runs-on: ubuntu-latest
|
|
19
|
-
|
|
20
|
-
steps:
|
|
21
|
-
- name: Checkout repository
|
|
22
|
-
uses: actions/checkout@v4
|
|
23
|
-
|
|
24
|
-
- name: Setup Bun
|
|
25
|
-
uses: oven-sh/setup-bun@v2
|
|
26
|
-
with:
|
|
27
|
-
bun-version: latest
|
|
28
|
-
|
|
29
|
-
- name: Install system dependencies
|
|
30
|
-
run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev
|
|
31
|
-
|
|
32
|
-
- name: Install dependencies
|
|
33
|
-
run: bun install --frozen-lockfile
|
|
34
|
-
|
|
35
|
-
- name: Run type check
|
|
36
|
-
run: bun run typecheck
|
|
37
|
-
|
|
38
|
-
- name: Run linter
|
|
39
|
-
run: bun run lint
|
|
40
|
-
|
|
41
|
-
- name: Build
|
|
42
|
-
run: bun run build
|
|
43
|
-
|
|
44
|
-
- name: Run tests
|
|
45
|
-
run: bun test
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
name: Claude Code Review
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
types: [opened, synchronize]
|
|
6
|
-
# Optional: Only run on specific file changes
|
|
7
|
-
# paths:
|
|
8
|
-
# - "src/**/*.ts"
|
|
9
|
-
# - "src/**/*.tsx"
|
|
10
|
-
# - "src/**/*.js"
|
|
11
|
-
# - "src/**/*.jsx"
|
|
12
|
-
|
|
13
|
-
jobs:
|
|
14
|
-
claude-review:
|
|
15
|
-
# Optional: Filter by PR author
|
|
16
|
-
# if: |
|
|
17
|
-
# github.event.pull_request.user.login == 'external-contributor' ||
|
|
18
|
-
# github.event.pull_request.user.login == 'new-developer' ||
|
|
19
|
-
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
|
|
20
|
-
|
|
21
|
-
runs-on: ubuntu-latest
|
|
22
|
-
permissions:
|
|
23
|
-
contents: read
|
|
24
|
-
pull-requests: read
|
|
25
|
-
issues: read
|
|
26
|
-
id-token: write
|
|
27
|
-
|
|
28
|
-
steps:
|
|
29
|
-
- name: Checkout repository
|
|
30
|
-
uses: actions/checkout@v4
|
|
31
|
-
with:
|
|
32
|
-
fetch-depth: 1
|
|
33
|
-
|
|
34
|
-
- name: Run Claude Code Review
|
|
35
|
-
id: claude-review
|
|
36
|
-
uses: anthropics/claude-code-action@v1
|
|
37
|
-
with:
|
|
38
|
-
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
39
|
-
prompt: |
|
|
40
|
-
REPO: ${{ github.repository }}
|
|
41
|
-
PR NUMBER: ${{ github.event.pull_request.number }}
|
|
42
|
-
|
|
43
|
-
Please review this pull request and provide feedback on:
|
|
44
|
-
- Code quality and best practices
|
|
45
|
-
- Potential bugs or issues
|
|
46
|
-
- Performance considerations
|
|
47
|
-
- Security concerns
|
|
48
|
-
- Test coverage
|
|
49
|
-
|
|
50
|
-
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
|
|
51
|
-
|
|
52
|
-
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
|
|
53
|
-
|
|
54
|
-
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
|
55
|
-
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
|
|
56
|
-
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
|
|
57
|
-
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
name: Claude Code
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
issue_comment:
|
|
5
|
-
types: [created]
|
|
6
|
-
pull_request_review_comment:
|
|
7
|
-
types: [created]
|
|
8
|
-
issues:
|
|
9
|
-
types: [opened, assigned]
|
|
10
|
-
pull_request_review:
|
|
11
|
-
types: [submitted]
|
|
12
|
-
|
|
13
|
-
jobs:
|
|
14
|
-
claude:
|
|
15
|
-
if: |
|
|
16
|
-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
|
|
17
|
-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
|
|
18
|
-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
|
|
19
|
-
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
|
|
20
|
-
runs-on: ubuntu-latest
|
|
21
|
-
permissions:
|
|
22
|
-
contents: read
|
|
23
|
-
pull-requests: read
|
|
24
|
-
issues: read
|
|
25
|
-
id-token: write
|
|
26
|
-
actions: read # Required for Claude to read CI results on PRs
|
|
27
|
-
steps:
|
|
28
|
-
- name: Checkout repository
|
|
29
|
-
uses: actions/checkout@v4
|
|
30
|
-
with:
|
|
31
|
-
fetch-depth: 1
|
|
32
|
-
|
|
33
|
-
- name: Run Claude Code
|
|
34
|
-
id: claude
|
|
35
|
-
uses: anthropics/claude-code-action@v1
|
|
36
|
-
with:
|
|
37
|
-
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
38
|
-
|
|
39
|
-
# This is an optional setting that allows Claude to read CI results on PRs
|
|
40
|
-
additional_permissions: |
|
|
41
|
-
actions: read
|
|
42
|
-
|
|
43
|
-
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
|
|
44
|
-
# prompt: 'Update the pull request description to include a summary of changes.'
|
|
45
|
-
|
|
46
|
-
# Optional: Add claude_args to customize behavior and configuration
|
|
47
|
-
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
|
48
|
-
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
|
|
49
|
-
# claude_args: '--allowed-tools Bash(gh pr:*)'
|
|
50
|
-
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
name: Release
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
|
|
8
|
-
permissions:
|
|
9
|
-
contents: write
|
|
10
|
-
issues: write
|
|
11
|
-
pull-requests: write
|
|
12
|
-
id-token: write
|
|
13
|
-
|
|
14
|
-
jobs:
|
|
15
|
-
release:
|
|
16
|
-
name: Release
|
|
17
|
-
runs-on: ubuntu-latest
|
|
18
|
-
|
|
19
|
-
steps:
|
|
20
|
-
- name: Checkout repository
|
|
21
|
-
uses: actions/checkout@v4
|
|
22
|
-
with:
|
|
23
|
-
fetch-depth: 0
|
|
24
|
-
persist-credentials: false
|
|
25
|
-
|
|
26
|
-
- name: Setup Bun
|
|
27
|
-
uses: oven-sh/setup-bun@v2
|
|
28
|
-
with:
|
|
29
|
-
bun-version: latest
|
|
30
|
-
|
|
31
|
-
- name: Install system dependencies
|
|
32
|
-
run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev
|
|
33
|
-
|
|
34
|
-
- name: Install dependencies
|
|
35
|
-
run: bun install --frozen-lockfile
|
|
36
|
-
|
|
37
|
-
- name: Run type check
|
|
38
|
-
run: bun run typecheck
|
|
39
|
-
|
|
40
|
-
- name: Run linter
|
|
41
|
-
run: bun run lint
|
|
42
|
-
|
|
43
|
-
- name: Run tests
|
|
44
|
-
run: bun test
|
|
45
|
-
|
|
46
|
-
- name: Build
|
|
47
|
-
run: bun run build
|
|
48
|
-
|
|
49
|
-
- name: Setup Node.js
|
|
50
|
-
uses: actions/setup-node@v4
|
|
51
|
-
with:
|
|
52
|
-
node-version: 'lts/*'
|
|
53
|
-
|
|
54
|
-
- name: Release
|
|
55
|
-
env:
|
|
56
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
57
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
58
|
-
run: npx semantic-release
|
|
59
|
-
|
|
60
|
-
- name: Notify Discord
|
|
61
|
-
if: ${{ success() }}
|
|
62
|
-
uses: actions/github-script@v7
|
|
63
|
-
env:
|
|
64
|
-
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
|
65
|
-
with:
|
|
66
|
-
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
67
|
-
script: |
|
|
68
|
-
if (!process.env.DISCORD_WEBHOOK_URL) {
|
|
69
|
-
core.warning('DISCORD_WEBHOOK_URL not set, skipping Discord notification.')
|
|
70
|
-
return
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const { owner, repo } = context.repo
|
|
74
|
-
const { data: releases } = await github.rest.repos.listReleases({
|
|
75
|
-
owner,
|
|
76
|
-
repo,
|
|
77
|
-
per_page: 1,
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
if (!releases.length) {
|
|
81
|
-
core.warning('No releases found, skipping Discord notification.')
|
|
82
|
-
return
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const release = releases[0]
|
|
86
|
-
const description = (release.body || '').slice(0, 4000)
|
|
87
|
-
|
|
88
|
-
await fetch(process.env.DISCORD_WEBHOOK_URL, {
|
|
89
|
-
method: 'POST',
|
|
90
|
-
headers: { 'Content-Type': 'application/json' },
|
|
91
|
-
body: JSON.stringify({
|
|
92
|
-
username: 'ClaudeKit Release Bot',
|
|
93
|
-
embeds: [
|
|
94
|
-
{
|
|
95
|
-
title: `Release ${release.name || release.tag_name}`,
|
|
96
|
-
url: release.html_url,
|
|
97
|
-
description: description || 'No changelog available.',
|
|
98
|
-
timestamp: release.created_at,
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
}),
|
|
102
|
-
})
|
package/.releaserc.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"branches": ["main"],
|
|
3
|
-
"plugins": [
|
|
4
|
-
"@semantic-release/commit-analyzer",
|
|
5
|
-
"@semantic-release/release-notes-generator",
|
|
6
|
-
"@semantic-release/changelog",
|
|
7
|
-
"@semantic-release/npm",
|
|
8
|
-
[
|
|
9
|
-
"@semantic-release/git",
|
|
10
|
-
{
|
|
11
|
-
"assets": ["package.json", "CHANGELOG.md"],
|
|
12
|
-
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
"@semantic-release/github"
|
|
16
|
-
]
|
|
17
|
-
}
|
package/.repomixignore
DELETED
package/AGENTS.md
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
# AGENTS.md
|
|
2
|
-
|
|
3
|
-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
-
|
|
5
|
-
## Project Overview
|
|
6
|
-
|
|
7
|
-
...
|
|
8
|
-
|
|
9
|
-
## Project Structure
|
|
10
|
-
|
|
11
|
-
- `docs/` - Product requirements and wireframes
|
|
12
|
-
- `product-overview-pdr.md` - Complete product requirements document (Vietnamese)
|
|
13
|
-
- `code-standards.md` - Code standards and conventions
|
|
14
|
-
- `codebase-summary.md` - Codebase summary & structure
|
|
15
|
-
- `project-roadmap.md` - Project roadmap
|
|
16
|
-
- `plans/` - Implementation plans
|
|
17
|
-
- `templates/` - Implementation plan templates
|
|
18
|
-
- `reports/` - Implementation reports
|
|
19
|
-
|
|
20
|
-
## Key Features to Implement
|
|
21
|
-
|
|
22
|
-
...
|
|
23
|
-
|
|
24
|
-
## Development Commands
|
|
25
|
-
|
|
26
|
-
...
|
|
27
|
-
|
|
28
|
-
## Architecture Guidelines
|
|
29
|
-
|
|
30
|
-
...
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Role & Responsibilities
|
|
35
|
-
|
|
36
|
-
Your role is to analyze user requirements, delegate tasks to appropriate sub-agents, and ensure cohesive delivery of features that meet specifications and architectural standards.
|
|
37
|
-
|
|
38
|
-
### Orchestration Protocol
|
|
39
|
-
|
|
40
|
-
#### Sequential Chaining
|
|
41
|
-
Chain subagents when tasks have dependencies or require outputs from previous steps:
|
|
42
|
-
- **Planning → Implementation → Testing → Review**: Use for feature development
|
|
43
|
-
- **Research → Design → Code → Documentation**: Use for new system components
|
|
44
|
-
- Each agent completes fully before the next begins
|
|
45
|
-
- Pass context and outputs between agents in the chain
|
|
46
|
-
|
|
47
|
-
#### Parallel Execution
|
|
48
|
-
Spawn multiple subagents simultaneously for independent tasks:
|
|
49
|
-
- **Code + Tests + Docs**: When implementing separate, non-conflicting components
|
|
50
|
-
- **Multiple Feature Branches**: Different agents working on isolated features
|
|
51
|
-
- **Cross-platform Development**: iOS and Android specific implementations
|
|
52
|
-
- **Careful Coordination**: Ensure no file conflicts or shared resource contention
|
|
53
|
-
- **Merge Strategy**: Plan integration points before parallel execution begins
|
|
54
|
-
|
|
55
|
-
### Core Responsibilities
|
|
56
|
-
|
|
57
|
-
#### 1. Code Implementation
|
|
58
|
-
- Before you start, delegate to `planner` agent to create a implementation plan with TODO tasks in `./plans` directory.
|
|
59
|
-
- When in planning phase, use multiple `researcher` agents in parallel to conduct research on different relevant technical topics and report back to `planner` agent to create implementation plan.
|
|
60
|
-
- Write clean, readable, and maintainable code
|
|
61
|
-
- Follow established architectural patterns
|
|
62
|
-
- Implement features according to specifications
|
|
63
|
-
- Handle edge cases and error scenarios
|
|
64
|
-
- **DO NOT** create new enhanced files, update to the existing files directly.
|
|
65
|
-
- **[IMPORTANT]** After creating or modifying code file, run `flutter analyze <path/to/file>` to check for any compile errors.
|
|
66
|
-
|
|
67
|
-
#### 2. Testing
|
|
68
|
-
- Delegate to `tester` agent to run tests and analyze the summary report.
|
|
69
|
-
- Write comprehensive unit tests
|
|
70
|
-
- Ensure high code coverage
|
|
71
|
-
- Test error scenarios
|
|
72
|
-
- Validate performance requirements
|
|
73
|
-
- Tests are critical for ensuring code quality and reliability, **DO NOT** ignore failing tests just to pass the build.
|
|
74
|
-
- **IMPORTANT:** Always fix failing tests follow the recommendations and delegate to `tester` agent to run tests again, only finish your session when all tests pass.
|
|
75
|
-
|
|
76
|
-
#### 3. Code Quality
|
|
77
|
-
- After finish implementation, delegate to `code-reviewer` agent to review code.
|
|
78
|
-
- Follow coding standards and conventions
|
|
79
|
-
- Write self-documenting code
|
|
80
|
-
- Add meaningful comments for complex logic
|
|
81
|
-
- Optimize for performance and maintainability
|
|
82
|
-
|
|
83
|
-
#### 4. Integration
|
|
84
|
-
- Always follow the plan given by `planner` agent
|
|
85
|
-
- Ensure seamless integration with existing code
|
|
86
|
-
- Follow API contracts precisely
|
|
87
|
-
- Maintain backward compatibility
|
|
88
|
-
- Document breaking changes
|
|
89
|
-
- Delegate to `docs-manager` agent to update docs in `./docs` directory if any.
|
|
90
|
-
|
|
91
|
-
#### 5. Debugging
|
|
92
|
-
- When a user report bugs or issues on the server or a CI/CD pipeline, delegate to `debugger` agent to run tests and analyze the summary report.
|
|
93
|
-
- Read the summary report from `debugger` agent and implement the fix.
|
|
94
|
-
- Delegate to `tester` agent to run tests and analyze the summary report.
|
|
95
|
-
- If the `tester` agent reports failed tests, fix them follow the recommendations.
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## Context Management & Anti-Rot Guidelines
|
|
100
|
-
|
|
101
|
-
**REMEMBER: Everything is Context Engineering!**
|
|
102
|
-
Subagents have their own context, delegate tasks to them using file system whenever possible.
|
|
103
|
-
|
|
104
|
-
### Context Refresh Protocol
|
|
105
|
-
To prevent context degradation and maintain performance in long conversations:
|
|
106
|
-
|
|
107
|
-
#### Agent Handoff Refresh Points
|
|
108
|
-
- **Between Agents**: Reset context when switching between specialized agents
|
|
109
|
-
- **Phase Transitions**: Clear context between planning → implementation → testing → review phases
|
|
110
|
-
- **Document Generation**: Use fresh context for creating plans, reports, and documentation
|
|
111
|
-
- **Error Recovery**: Reset context after debugging sessions to avoid confusion
|
|
112
|
-
|
|
113
|
-
#### Information Handoff Structure
|
|
114
|
-
When delegating to agents, provide only essential context:
|
|
115
|
-
```markdown
|
|
116
|
-
## Task Summary
|
|
117
|
-
- **Objective**: [brief description]
|
|
118
|
-
- **Scope**: [specific boundaries]
|
|
119
|
-
- **Critical Context**: [requirements, constraints, current state]
|
|
120
|
-
- **Reference Files**: [relevant file paths and line numbers - don't include full content]
|
|
121
|
-
- **Success Criteria**: [clear acceptance criteria]
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
#### Context Health Guidelines
|
|
125
|
-
- **Prioritize Recent Changes**: Emphasize recent modifications over historical data
|
|
126
|
-
- **Use References Over Content**: Link to files instead of including full content
|
|
127
|
-
- **Summary Over Details**: Provide bullet points instead of verbose explanations
|
|
128
|
-
|
|
129
|
-
### Agent Interaction Best Practices
|
|
130
|
-
- Each agent should complete its task and provide a focused summary report
|
|
131
|
-
- Avoid circular dependencies between agents
|
|
132
|
-
- Use clear "handoff complete" signals when transitioning
|
|
133
|
-
- Include only task-relevant context in agent instructions
|
|
134
|
-
- Pass plan file path across subagents
|
|
135
|
-
|
|
136
|
-
---
|
|
137
|
-
|
|
138
|
-
## Project Documentation Management
|
|
139
|
-
|
|
140
|
-
### Roadmap & Changelog Maintenance
|
|
141
|
-
- **Project Roadmap** (`./docs/development-roadmap.md`): Living document tracking project phases, milestones, and progress
|
|
142
|
-
- **Project Changelog** (`./docs/project-changelog.md`): Detailed record of all significant changes, features, and fixes
|
|
143
|
-
- **System Architecture** (`./docs/system-architecture.md`): Detailed record of all significant changes, features, and fixes
|
|
144
|
-
- **Code Standards** (`./docs/code-standards.md`): Detailed record of all significant changes, features, and fixes
|
|
145
|
-
|
|
146
|
-
### Automatic Updates Required
|
|
147
|
-
- **After Feature Implementation**: Update roadmap progress status and changelog entries
|
|
148
|
-
- **After Major Milestones**: Review and adjust roadmap phases, update success metrics
|
|
149
|
-
- **After Bug Fixes**: Document fixes in changelog with severity and impact
|
|
150
|
-
- **After Security Updates**: Record security improvements and version updates
|
|
151
|
-
- **Weekly Reviews**: Update progress percentages and milestone statuses
|
|
152
|
-
|
|
153
|
-
### Documentation Triggers
|
|
154
|
-
The `project-manager` agent MUST update these documents when:
|
|
155
|
-
- A development phase status changes (e.g., from "In Progress" to "Complete")
|
|
156
|
-
- Major features are implemented or released
|
|
157
|
-
- Significant bugs are resolved or security patches applied
|
|
158
|
-
- Project timeline or scope adjustments are made
|
|
159
|
-
- External dependencies or breaking changes occur
|
|
160
|
-
|
|
161
|
-
### Update Protocol
|
|
162
|
-
1. **Before Updates**: Always read current roadmap and changelog status
|
|
163
|
-
2. **During Updates**: Maintain version consistency and proper formatting
|
|
164
|
-
3. **After Updates**: Verify links, dates, and cross-references are accurate
|
|
165
|
-
4. **Quality Check**: Ensure updates align with actual implementation progress
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## Development Rules
|
|
170
|
-
|
|
171
|
-
### General
|
|
172
|
-
- **File Size Management**: Keep individual code files under 500 lines for optimal context management
|
|
173
|
-
- Split large files into smaller, focused components
|
|
174
|
-
- Use composition over inheritance for complex widgets
|
|
175
|
-
- Extract utility functions into separate modules
|
|
176
|
-
- Create dedicated service classes for business logic
|
|
177
|
-
- You ALWAYS follow these principles: **YANGI (You Aren't Gonna Need It) - KISS (Keep It Simple, Stupid) - DRY (Don't Repeat Yourself)**
|
|
178
|
-
- Use `context7` mcp tools for exploring latest docs of plugins/packages
|
|
179
|
-
- Use `senera` mcp tools for semantic retrieval and editing capabilities
|
|
180
|
-
- Use `psql` bash command to query database for debugging.
|
|
181
|
-
- Use `eyes_vision_analysis` tool of `human` mcp server to read and analyze images.
|
|
182
|
-
- **[IMPORTANT]** Follow the codebase structure and code standards in `./docs` during implementation
|
|
183
|
-
- **[IMPORTANT]** When you finish the implementation, send a full summary report to Discord channel with `./.claude/send-discord.sh 'Your message here'` script (remember to escape the string).
|
|
184
|
-
- **[IMPORTANT]** Do not just simulate the implementation or mocking them, always implement the real code.
|
|
185
|
-
|
|
186
|
-
### Subagents
|
|
187
|
-
Delegate detailed tasks to these subagents according to their roles & expertises:
|
|
188
|
-
- Use file system (in markdown format) to hand over reports in `./plans/reports` directory from agent to agent with this file name format: `YYMMDD-from-agent-name-to-agent-name-task-name-report.md`.
|
|
189
|
-
- Use `planner` agent to plan for the implementation plan using templates in `./plans/templates/` (`planner` agent can spawn multiple `researcher` agents in parallel to explore different approaches with "Query Fan-Out" technique).
|
|
190
|
-
- Use `database-admin` agent to run tests and analyze the summary report.
|
|
191
|
-
- Use `tester` agent to run tests and analyze the summary report.
|
|
192
|
-
- Use `debugger` agent to collect logs in server or github actions to analyze the summary report.
|
|
193
|
-
- Use `code-reviewer` agent to review code according to the implementation plan.
|
|
194
|
-
- Use `docs-manager` agent to update docs in `./docs` directory if any (espcially for `./docs/codebase-summary.md` when significant changes are made).
|
|
195
|
-
- Use `git-manager` agent to commit and push code changes.
|
|
196
|
-
- Use `project-manager` agent for project's progress tracking, completion verification & TODO status management.
|
|
197
|
-
- **[IMPORTANT]** Always delegate to `project-manager` agent after completing significant features, major milestones, or when requested to update project documentation.
|
|
198
|
-
**IMPORTANT:** You can intelligently spawn multiple subagents **in parallel** or **chain them sequentially** to handle the tasks efficiently.
|
|
199
|
-
|
|
200
|
-
### Code Quality Guidelines
|
|
201
|
-
- Read and follow codebase structure and code standards in `./docs`
|
|
202
|
-
- Don't be too harsh on code linting, but make sure there are no syntax errors and code are compilable
|
|
203
|
-
- Prioritize functionality and readability over strict style enforcement and code formatting
|
|
204
|
-
- Use reasonable code quality standards that enhance developer productivity
|
|
205
|
-
- Use try catch error handling & cover security standards
|
|
206
|
-
- Use `code-reviewer` agent to review code after every implementation
|
|
207
|
-
|
|
208
|
-
### Pre-commit/Push Rules
|
|
209
|
-
- Run linting before commit
|
|
210
|
-
- Run tests before push (DO NOT ignore failed tests just to pass the build or github actions)
|
|
211
|
-
- Keep commits focused on the actual code changes
|
|
212
|
-
- **DO NOT** commit and push any confidential information (such as dotenv files, API keys, database credentials, etc.) to git repository!
|
|
213
|
-
- NEVER automatically add AI attribution signatures like:
|
|
214
|
-
"🤖 Generated with [Claude Code]"
|
|
215
|
-
"Co-Authored-By: Claude noreply@anthropic.com"
|
|
216
|
-
Any AI tool attribution or signature
|
|
217
|
-
- Create clean, professional commit messages without AI references. Use conventional commit format.
|