@nalvietnam/avatar-cli 1.0.1 → 1.1.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/avatar.js +0 -0
- package/dist/hooks/post-merge.sh.tpl +24 -0
- package/dist/hooks/pre-push.sh.tpl +33 -0
- package/dist/index.js +855 -180
- package/dist/index.js.map +1 -1
- package/dist/templates/CLAUDE.md.tpl +40 -0
- package/dist/templates/gitignore/generic.txt +20 -0
- package/dist/templates/gitignore/go.txt +16 -0
- package/dist/templates/gitignore/java.txt +23 -0
- package/dist/templates/gitignore/node.txt +21 -0
- package/dist/templates/gitignore/python.txt +26 -0
- package/dist/templates/gitignore/ruby.txt +16 -0
- package/dist/templates/gitignore/rust.txt +5 -0
- package/dist/templates/gitignore.tpl +4 -0
- package/dist/templates/project/architecture.md.tpl +27 -0
- package/dist/templates/project/conventions.md.tpl +27 -0
- package/dist/templates/project/domain.md.tpl +23 -0
- package/dist/templates/project/gotchas.md.tpl +28 -0
- package/dist/templates/project/tech-stack.md.tpl +32 -0
- package/dist/templates/settings.json.tpl +32 -0
- package/package.json +1 -1
- package/src/templates/gitignore/generic.txt +20 -0
- package/src/templates/gitignore/go.txt +16 -0
- package/src/templates/gitignore/java.txt +23 -0
- package/src/templates/gitignore/node.txt +21 -0
- package/src/templates/gitignore/python.txt +26 -0
- package/src/templates/gitignore/ruby.txt +16 -0
- package/src/templates/gitignore/rust.txt +5 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# {{projectName}}
|
|
2
|
+
|
|
3
|
+
{{projectDescription}}
|
|
4
|
+
|
|
5
|
+
## Context cho Claude Code
|
|
6
|
+
|
|
7
|
+
File này là entry point. Claude Code đọc file này và resolve các @-imports bên dưới
|
|
8
|
+
để có toàn bộ context dự án. KHÔNG sửa file này thủ công; chạy `avatar scan`
|
|
9
|
+
và `avatar review` để cập nhật.
|
|
10
|
+
|
|
11
|
+
### Knowledge nền tảng (từ team-ai-pack)
|
|
12
|
+
|
|
13
|
+
@.claude/pack/knowledge/org/coding-standards.md
|
|
14
|
+
@.claude/pack/knowledge/org/git-workflow.md
|
|
15
|
+
@.claude/pack/knowledge/org/security-policy.md
|
|
16
|
+
|
|
17
|
+
### Knowledge dự án này (auto-scan)
|
|
18
|
+
|
|
19
|
+
@.claude/project/tech-stack.md
|
|
20
|
+
@.claude/project/conventions.md
|
|
21
|
+
@.claude/project/architecture.md
|
|
22
|
+
@.claude/project/domain.md
|
|
23
|
+
@.claude/project/gotchas.md
|
|
24
|
+
|
|
25
|
+
### Hướng dẫn cho Claude
|
|
26
|
+
|
|
27
|
+
- Tuân thủ convention trong @.claude/project/conventions.md trước, sau đó tới
|
|
28
|
+
@.claude/pack/knowledge/org/coding-standards.md.
|
|
29
|
+
- Khi tạo file mới, đặt theo pattern trong @.claude/project/architecture.md.
|
|
30
|
+
- Khi gặp gotcha mới, đề xuất ghi vào @.claude/project/gotchas.md.
|
|
31
|
+
- Câu hỏi quy trình: đọc @.claude/pack/knowledge/playbooks/
|
|
32
|
+
- Quyết định kiến trúc lớn: tham khảo @.claude/pack/knowledge/decisions/
|
|
33
|
+
|
|
34
|
+
### Project metadata
|
|
35
|
+
|
|
36
|
+
- Team owner: {{teamOwner}}
|
|
37
|
+
- Avatar version: {{avatarVersion}}
|
|
38
|
+
- Pack version: {{packVersion}}
|
|
39
|
+
- Last scan: {{lastScan}}
|
|
40
|
+
- Mode: {{mode}}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Node
|
|
2
|
+
node_modules/
|
|
3
|
+
npm-debug.log*
|
|
4
|
+
yarn-debug.log*
|
|
5
|
+
yarn-error.log*
|
|
6
|
+
pnpm-debug.log*
|
|
7
|
+
.pnpm-store/
|
|
8
|
+
|
|
9
|
+
# Build outputs
|
|
10
|
+
dist/
|
|
11
|
+
build/
|
|
12
|
+
out/
|
|
13
|
+
.next/
|
|
14
|
+
.nuxt/
|
|
15
|
+
.turbo/
|
|
16
|
+
coverage/
|
|
17
|
+
|
|
18
|
+
# Cache
|
|
19
|
+
.cache/
|
|
20
|
+
.parcel-cache/
|
|
21
|
+
.eslintcache
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
|
|
7
|
+
# Virtual envs
|
|
8
|
+
venv/
|
|
9
|
+
.venv/
|
|
10
|
+
env/
|
|
11
|
+
.env/
|
|
12
|
+
ENV/
|
|
13
|
+
|
|
14
|
+
# Build
|
|
15
|
+
build/
|
|
16
|
+
dist/
|
|
17
|
+
*.egg-info/
|
|
18
|
+
.eggs/
|
|
19
|
+
|
|
20
|
+
# Test/coverage
|
|
21
|
+
.pytest_cache/
|
|
22
|
+
.coverage
|
|
23
|
+
htmlcov/
|
|
24
|
+
.tox/
|
|
25
|
+
.mypy_cache/
|
|
26
|
+
.ruff_cache/
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Architecture — {{projectName}}
|
|
2
|
+
|
|
3
|
+
> File này do `avatar scan` cập nhật. KHÔNG sửa thủ công.
|
|
4
|
+
|
|
5
|
+
## Tổng quan kiến trúc
|
|
6
|
+
|
|
7
|
+
{{architectureOverview}}
|
|
8
|
+
|
|
9
|
+
## Layer / Module chính
|
|
10
|
+
|
|
11
|
+
{{moduleLayout}}
|
|
12
|
+
|
|
13
|
+
## Data flow
|
|
14
|
+
|
|
15
|
+
{{dataFlow}}
|
|
16
|
+
|
|
17
|
+
## External integration
|
|
18
|
+
|
|
19
|
+
{{externalIntegrations}}
|
|
20
|
+
|
|
21
|
+
## Deployment topology
|
|
22
|
+
|
|
23
|
+
{{deploymentTopology}}
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
*Generated: {{lastScan}} · Avatar v{{avatarVersion}}*
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Conventions — {{projectName}}
|
|
2
|
+
|
|
3
|
+
> File này do `avatar scan` cập nhật. KHÔNG sửa thủ công.
|
|
4
|
+
|
|
5
|
+
## Code style
|
|
6
|
+
|
|
7
|
+
{{codeStyle}}
|
|
8
|
+
|
|
9
|
+
## Naming convention
|
|
10
|
+
|
|
11
|
+
{{namingConvention}}
|
|
12
|
+
|
|
13
|
+
## Folder structure
|
|
14
|
+
|
|
15
|
+
{{folderStructure}}
|
|
16
|
+
|
|
17
|
+
## Commit message
|
|
18
|
+
|
|
19
|
+
{{commitConvention}}
|
|
20
|
+
|
|
21
|
+
## Linter / Formatter
|
|
22
|
+
|
|
23
|
+
{{linterConfig}}
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
*Generated: {{lastScan}} · Avatar v{{avatarVersion}}*
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Domain — {{projectName}}
|
|
2
|
+
|
|
3
|
+
> File này do `avatar scan` cập nhật. KHÔNG sửa thủ công.
|
|
4
|
+
|
|
5
|
+
## Mô tả domain
|
|
6
|
+
|
|
7
|
+
{{domainDescription}}
|
|
8
|
+
|
|
9
|
+
## Khái niệm chính
|
|
10
|
+
|
|
11
|
+
{{coreEntities}}
|
|
12
|
+
|
|
13
|
+
## Use case chính
|
|
14
|
+
|
|
15
|
+
{{primaryUseCases}}
|
|
16
|
+
|
|
17
|
+
## Glossary
|
|
18
|
+
|
|
19
|
+
{{domainGlossary}}
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
*Generated: {{lastScan}} · Avatar v{{avatarVersion}}*
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Gotchas — {{projectName}}
|
|
2
|
+
|
|
3
|
+
> File tự đầy theo thời gian qua skill `knowledge-capture`. Bẫy quan trọng,
|
|
4
|
+
> bài học kinh nghiệm sẽ tích lũy ở đây.
|
|
5
|
+
|
|
6
|
+
## Cấu trúc một mục gotcha
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
### [Tag] Tên ngắn gọn
|
|
10
|
+
|
|
11
|
+
**Triệu chứng:** Lỗi gì xuất hiện.
|
|
12
|
+
|
|
13
|
+
**Nguyên nhân:** Vì sao xảy ra.
|
|
14
|
+
|
|
15
|
+
**Cách tránh:** Làm thế nào để không lặp lại.
|
|
16
|
+
|
|
17
|
+
**Tham khảo:** Link PR, issue, commit.
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Bẫy đã ghi nhận
|
|
23
|
+
|
|
24
|
+
*(Chưa có gotcha nào — Avatar sẽ tự bổ sung khi gặp pattern lặp lại trong session.)*
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
*Last updated: {{lastScan}} · Avatar v{{avatarVersion}}*
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Tech stack — {{projectName}}
|
|
2
|
+
|
|
3
|
+
> File này do `avatar scan` cập nhật. KHÔNG sửa thủ công. Đề xuất thay đổi
|
|
4
|
+
> qua `avatar review`.
|
|
5
|
+
|
|
6
|
+
## Ngôn ngữ chính
|
|
7
|
+
|
|
8
|
+
{{primaryLanguage}}
|
|
9
|
+
|
|
10
|
+
## Framework / Library
|
|
11
|
+
|
|
12
|
+
{{frameworks}}
|
|
13
|
+
|
|
14
|
+
## Database
|
|
15
|
+
|
|
16
|
+
{{databases}}
|
|
17
|
+
|
|
18
|
+
## Test stack
|
|
19
|
+
|
|
20
|
+
{{testStack}}
|
|
21
|
+
|
|
22
|
+
## Build & deploy
|
|
23
|
+
|
|
24
|
+
{{buildStack}}
|
|
25
|
+
|
|
26
|
+
## Phiên bản công cụ
|
|
27
|
+
|
|
28
|
+
{{toolVersions}}
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
*Generated: {{lastScan}} · Avatar v{{avatarVersion}}*
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"allowedTools": [
|
|
3
|
+
"Bash(npm:*)",
|
|
4
|
+
"Bash(pnpm:*)",
|
|
5
|
+
"Bash(git:*)",
|
|
6
|
+
"Bash(node:*)",
|
|
7
|
+
"Edit",
|
|
8
|
+
"Read",
|
|
9
|
+
"Write",
|
|
10
|
+
"Glob",
|
|
11
|
+
"Grep"
|
|
12
|
+
],
|
|
13
|
+
"hooks": {
|
|
14
|
+
"PostToolUse": [
|
|
15
|
+
{
|
|
16
|
+
"matcher": "Edit|Write",
|
|
17
|
+
"hooks": [
|
|
18
|
+
{
|
|
19
|
+
"type": "command",
|
|
20
|
+
"command": "avatar internal post-edit",
|
|
21
|
+
"timeout": 5
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"env": {
|
|
28
|
+
"AVATAR_PROJECT": "{{projectName}}",
|
|
29
|
+
"AVATAR_OWNER": "{{teamOwner}}",
|
|
30
|
+
"AVATAR_MODE": "{{mode}}"
|
|
31
|
+
}
|
|
32
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Node
|
|
2
|
+
node_modules/
|
|
3
|
+
npm-debug.log*
|
|
4
|
+
yarn-debug.log*
|
|
5
|
+
yarn-error.log*
|
|
6
|
+
pnpm-debug.log*
|
|
7
|
+
.pnpm-store/
|
|
8
|
+
|
|
9
|
+
# Build outputs
|
|
10
|
+
dist/
|
|
11
|
+
build/
|
|
12
|
+
out/
|
|
13
|
+
.next/
|
|
14
|
+
.nuxt/
|
|
15
|
+
.turbo/
|
|
16
|
+
coverage/
|
|
17
|
+
|
|
18
|
+
# Cache
|
|
19
|
+
.cache/
|
|
20
|
+
.parcel-cache/
|
|
21
|
+
.eslintcache
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
|
|
7
|
+
# Virtual envs
|
|
8
|
+
venv/
|
|
9
|
+
.venv/
|
|
10
|
+
env/
|
|
11
|
+
.env/
|
|
12
|
+
ENV/
|
|
13
|
+
|
|
14
|
+
# Build
|
|
15
|
+
build/
|
|
16
|
+
dist/
|
|
17
|
+
*.egg-info/
|
|
18
|
+
.eggs/
|
|
19
|
+
|
|
20
|
+
# Test/coverage
|
|
21
|
+
.pytest_cache/
|
|
22
|
+
.coverage
|
|
23
|
+
htmlcov/
|
|
24
|
+
.tox/
|
|
25
|
+
.mypy_cache/
|
|
26
|
+
.ruff_cache/
|