vibe-coder-kit 6.0.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/.vibe/behaviors/assumption.md +43 -0
- package/.vibe/behaviors/honesty.md +49 -0
- package/.vibe/behaviors/reflection.md +56 -0
- package/.vibe/config.json +25 -0
- package/.vibe/core/circuit-breaker.ts +113 -0
- package/.vibe/core/cli.ts +280 -0
- package/.vibe/core/cost-tracker.ts +157 -0
- package/.vibe/core/dag.ts +320 -0
- package/.vibe/core/event-store.ts +318 -0
- package/.vibe/core/health-check.ts +113 -0
- package/.vibe/core/idempotency.ts +92 -0
- package/.vibe/core/index.ts +16 -0
- package/.vibe/core/knowledge-store.ts +199 -0
- package/.vibe/core/plugin-registry.ts +174 -0
- package/.vibe/core/saga.ts +141 -0
- package/.vibe/core/team-config.ts +232 -0
- package/.vibe/core/telemetry.ts +154 -0
- package/.vibe/core/validator.ts +168 -0
- package/.vibe/flows/00-init.md +34 -0
- package/.vibe/flows/01-clarify.md +45 -0
- package/.vibe/flows/02-brainstorm.md +42 -0
- package/.vibe/flows/03-plan.md +36 -0
- package/.vibe/flows/05-code.md +49 -0
- package/.vibe/flows/06-review.md +41 -0
- package/.vibe/flows/08-learn.md +40 -0
- package/.vibe/phase-graph.json +111 -0
- package/.vibe/plugins/core/quality/rules.yaml +49 -0
- package/.vibe/plugins/core/security/rules.yaml +57 -0
- package/.vibe/templates/github-actions.yml +121 -0
- package/AGENTS.md +88 -0
- package/README.md +129 -0
- package/bin/vibe.js +351 -0
- package/package.json +62 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# 05-code — Implementation
|
|
2
|
+
|
|
3
|
+
## Entry Criteria
|
|
4
|
+
- 04-approve completed
|
|
5
|
+
- Plan approved
|
|
6
|
+
- Tasks defined
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
|
|
10
|
+
### For Each Task:
|
|
11
|
+
|
|
12
|
+
#### 1. RED — Write Failing Test
|
|
13
|
+
- Write test that describes expected behavior
|
|
14
|
+
- Run test (should fail)
|
|
15
|
+
- Commit: `test(name): add failing test`
|
|
16
|
+
|
|
17
|
+
#### 2. GREEN — Make Test Pass
|
|
18
|
+
- Write minimal code to pass test
|
|
19
|
+
- Run test (should pass)
|
|
20
|
+
- Commit: `feat(name): implement feature`
|
|
21
|
+
|
|
22
|
+
#### 3. REFACTOR — Improve Code
|
|
23
|
+
- Remove code smells
|
|
24
|
+
- Improve naming
|
|
25
|
+
- Extract functions if needed
|
|
26
|
+
- Run tests (should still pass)
|
|
27
|
+
- Commit: `refactor(name): improve code`
|
|
28
|
+
|
|
29
|
+
#### 4. QUALITY — Verify
|
|
30
|
+
- Run all tests
|
|
31
|
+
- Check lint
|
|
32
|
+
- Check type safety
|
|
33
|
+
- Check coverage (>80%)
|
|
34
|
+
- Update STATE.md
|
|
35
|
+
|
|
36
|
+
### After All Tasks:
|
|
37
|
+
- Run full test suite
|
|
38
|
+
- Verify all tests pass
|
|
39
|
+
- Update state to COMPLETED
|
|
40
|
+
|
|
41
|
+
## Exit Criteria
|
|
42
|
+
- [ ] All tasks completed
|
|
43
|
+
- [ ] All tests passing
|
|
44
|
+
- [ ] Coverage > 80%
|
|
45
|
+
- [ ] Lint clean
|
|
46
|
+
- [ ] Type safe
|
|
47
|
+
|
|
48
|
+
## Duration
|
|
49
|
+
Expected: Variable (depends on task count)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# 06-review — Code Review & QA
|
|
2
|
+
|
|
3
|
+
## Entry Criteria
|
|
4
|
+
- 05-code completed
|
|
5
|
+
- All tests passing
|
|
6
|
+
|
|
7
|
+
## Steps
|
|
8
|
+
|
|
9
|
+
### 1. Self Review
|
|
10
|
+
- Review own code against rules
|
|
11
|
+
- Check for: security, quality, performance
|
|
12
|
+
- Document findings
|
|
13
|
+
|
|
14
|
+
### 2. Functional Verification
|
|
15
|
+
- Test edge cases manually
|
|
16
|
+
- Verify user requirements met
|
|
17
|
+
- Check error handling
|
|
18
|
+
|
|
19
|
+
### 3. Security Scan
|
|
20
|
+
- Run security rules plugin
|
|
21
|
+
- Check for vulnerabilities
|
|
22
|
+
- Verify input validation
|
|
23
|
+
|
|
24
|
+
### 4. User Approval
|
|
25
|
+
- Present findings to user
|
|
26
|
+
- Get approval or feedback
|
|
27
|
+
- Address any issues
|
|
28
|
+
|
|
29
|
+
### 5. Self-Reflection
|
|
30
|
+
- Confidence level: [1-10]
|
|
31
|
+
- Review thoroughness
|
|
32
|
+
- Issues found and resolved
|
|
33
|
+
|
|
34
|
+
## Exit Criteria
|
|
35
|
+
- [ ] Review completed
|
|
36
|
+
- [ ] No critical issues
|
|
37
|
+
- [ ] User approved
|
|
38
|
+
- [ ] Ready for next phase
|
|
39
|
+
|
|
40
|
+
## Duration
|
|
41
|
+
Expected: 15-30 minutes
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# 08-learn — Knowledge Capture
|
|
2
|
+
|
|
3
|
+
## Entry Criteria
|
|
4
|
+
- 06-review completed
|
|
5
|
+
- Work done
|
|
6
|
+
|
|
7
|
+
## Steps
|
|
8
|
+
|
|
9
|
+
### 1. Capture Knowledge
|
|
10
|
+
- Document decisions made
|
|
11
|
+
- Record lessons learned
|
|
12
|
+
- Note gotchas encountered
|
|
13
|
+
- Save conventions followed
|
|
14
|
+
|
|
15
|
+
### 2. Update Knowledge Base
|
|
16
|
+
- Create knowledge entries in memory/knowledge/
|
|
17
|
+
- Update INDEX.md
|
|
18
|
+
- Add to relevant categories
|
|
19
|
+
|
|
20
|
+
### 3. Update Changelog
|
|
21
|
+
- Add entry to CHANGELOG.md
|
|
22
|
+
- Include: what changed, why, impact
|
|
23
|
+
|
|
24
|
+
### 4. Archive Session
|
|
25
|
+
- Move SESSION.md to archive/
|
|
26
|
+
- Create new SESSION.md for next session
|
|
27
|
+
|
|
28
|
+
### 5. Self-Reflection
|
|
29
|
+
- Confidence level: [1-10]
|
|
30
|
+
- Knowledge quality
|
|
31
|
+
- Session总结
|
|
32
|
+
|
|
33
|
+
## Exit Criteria
|
|
34
|
+
- [ ] Knowledge recorded
|
|
35
|
+
- [ ] INDEX.md updated
|
|
36
|
+
- [ ] Changelog updated
|
|
37
|
+
- [ ] Session archived
|
|
38
|
+
|
|
39
|
+
## Duration
|
|
40
|
+
Expected: 5-10 minutes
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"phases": {
|
|
3
|
+
"init": {
|
|
4
|
+
"id": "init",
|
|
5
|
+
"name": "Project Initialization",
|
|
6
|
+
"depends": [],
|
|
7
|
+
"next": ["clarify"],
|
|
8
|
+
"entryCriteria": [],
|
|
9
|
+
"exitCriteria": ["config created", "state initialized"],
|
|
10
|
+
"optional": false
|
|
11
|
+
},
|
|
12
|
+
"clarify": {
|
|
13
|
+
"id": "clarify",
|
|
14
|
+
"name": "Requirements Clarification",
|
|
15
|
+
"depends": ["init"],
|
|
16
|
+
"next": ["brainstorm", "plan"],
|
|
17
|
+
"entryCriteria": ["task defined"],
|
|
18
|
+
"exitCriteria": ["no open questions", "scope defined"],
|
|
19
|
+
"optional": false
|
|
20
|
+
},
|
|
21
|
+
"brainstorm": {
|
|
22
|
+
"id": "brainstorm",
|
|
23
|
+
"name": "Research & Alternatives",
|
|
24
|
+
"depends": ["clarify"],
|
|
25
|
+
"next": ["plan"],
|
|
26
|
+
"entryCriteria": ["ambiguity exists"],
|
|
27
|
+
"exitCriteria": ["alternatives evaluated"],
|
|
28
|
+
"optional": true,
|
|
29
|
+
"parallelGroup": "planning"
|
|
30
|
+
},
|
|
31
|
+
"plan": {
|
|
32
|
+
"id": "plan",
|
|
33
|
+
"name": "Planning",
|
|
34
|
+
"depends": ["clarify"],
|
|
35
|
+
"next": ["approve"],
|
|
36
|
+
"entryCriteria": ["scope clear"],
|
|
37
|
+
"exitCriteria": ["task list created"],
|
|
38
|
+
"optional": false,
|
|
39
|
+
"parallelGroup": "planning"
|
|
40
|
+
},
|
|
41
|
+
"approve": {
|
|
42
|
+
"id": "approve",
|
|
43
|
+
"name": "Architecture Review",
|
|
44
|
+
"depends": ["plan"],
|
|
45
|
+
"next": ["code"],
|
|
46
|
+
"entryCriteria": ["plan ready"],
|
|
47
|
+
"exitCriteria": ["approved"],
|
|
48
|
+
"optional": false
|
|
49
|
+
},
|
|
50
|
+
"code": {
|
|
51
|
+
"id": "code",
|
|
52
|
+
"name": "Implementation",
|
|
53
|
+
"depends": ["approve"],
|
|
54
|
+
"next": ["review"],
|
|
55
|
+
"entryCriteria": ["approval received"],
|
|
56
|
+
"exitCriteria": ["all tasks done", "tests passing"],
|
|
57
|
+
"optional": false,
|
|
58
|
+
"parallelGroup": "development"
|
|
59
|
+
},
|
|
60
|
+
"review": {
|
|
61
|
+
"id": "review",
|
|
62
|
+
"name": "Code Review",
|
|
63
|
+
"depends": ["code"],
|
|
64
|
+
"next": ["learn", "deploy"],
|
|
65
|
+
"entryCriteria": ["code complete"],
|
|
66
|
+
"exitCriteria": ["review approved"],
|
|
67
|
+
"optional": false
|
|
68
|
+
},
|
|
69
|
+
"fix": {
|
|
70
|
+
"id": "fix",
|
|
71
|
+
"name": "Bug Fixes",
|
|
72
|
+
"depends": ["review"],
|
|
73
|
+
"next": ["code"],
|
|
74
|
+
"entryCriteria": ["bugs found"],
|
|
75
|
+
"exitCriteria": ["bugs fixed"],
|
|
76
|
+
"optional": true,
|
|
77
|
+
"parallelGroup": "development"
|
|
78
|
+
},
|
|
79
|
+
"learn": {
|
|
80
|
+
"id": "learn",
|
|
81
|
+
"name": "Knowledge Capture",
|
|
82
|
+
"depends": ["review"],
|
|
83
|
+
"next": ["done"],
|
|
84
|
+
"entryCriteria": ["review complete"],
|
|
85
|
+
"exitCriteria": ["knowledge recorded"],
|
|
86
|
+
"optional": false
|
|
87
|
+
},
|
|
88
|
+
"deploy": {
|
|
89
|
+
"id": "deploy",
|
|
90
|
+
"name": "Deployment",
|
|
91
|
+
"depends": ["review"],
|
|
92
|
+
"next": ["learn"],
|
|
93
|
+
"entryCriteria": ["review approved"],
|
|
94
|
+
"exitCriteria": ["deploy successful"],
|
|
95
|
+
"optional": true
|
|
96
|
+
},
|
|
97
|
+
"done": {
|
|
98
|
+
"id": "done",
|
|
99
|
+
"name": "Workflow Complete",
|
|
100
|
+
"depends": ["learn"],
|
|
101
|
+
"next": [],
|
|
102
|
+
"entryCriteria": ["knowledge captured"],
|
|
103
|
+
"exitCriteria": ["state reset"],
|
|
104
|
+
"optional": false
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"parallelGroups": [
|
|
108
|
+
["brainstorm", "plan"],
|
|
109
|
+
["code", "fix"]
|
|
110
|
+
]
|
|
111
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Quality Rules Plugin
|
|
2
|
+
name: quality-rules
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: Core quality rules for Vibe Coder Kit
|
|
5
|
+
author: vibe-core
|
|
6
|
+
|
|
7
|
+
rules:
|
|
8
|
+
- id: QLT-001
|
|
9
|
+
name: require-tests
|
|
10
|
+
pattern: ""
|
|
11
|
+
action: warn
|
|
12
|
+
message: "Her görev için test yazılması gerekiyor"
|
|
13
|
+
severity: high
|
|
14
|
+
category: quality
|
|
15
|
+
|
|
16
|
+
- id: QLT-002
|
|
17
|
+
name: no-any-type
|
|
18
|
+
pattern: ":\\s*any\\b"
|
|
19
|
+
action: warn
|
|
20
|
+
message: "any tipi kullanımı kaçınılmalı"
|
|
21
|
+
severity: medium
|
|
22
|
+
category: quality
|
|
23
|
+
|
|
24
|
+
- id: QLT-003
|
|
25
|
+
name: require-error-handling
|
|
26
|
+
pattern: "catch\\s*\\([^)]*\\)\\s*\\{\\s*\\}"
|
|
27
|
+
action: warn
|
|
28
|
+
message: "Boş catch bloğu tespit edildi"
|
|
29
|
+
severity: high
|
|
30
|
+
category: quality
|
|
31
|
+
|
|
32
|
+
- id: QLT-004
|
|
33
|
+
name: no-hardcoded-urls
|
|
34
|
+
pattern: "https?://[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}"
|
|
35
|
+
action: info
|
|
36
|
+
message: "Hardcoded URL kullanımı tespit edildi"
|
|
37
|
+
severity: low
|
|
38
|
+
category: quality
|
|
39
|
+
|
|
40
|
+
hooks:
|
|
41
|
+
- phase: code
|
|
42
|
+
action: run_quality_check
|
|
43
|
+
priority: 2
|
|
44
|
+
timing: post
|
|
45
|
+
|
|
46
|
+
- phase: review
|
|
47
|
+
action: generate_quality_report
|
|
48
|
+
priority: 1
|
|
49
|
+
timing: post
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Security Rules Plugin
|
|
2
|
+
name: security-rules
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: Core security rules for Vibe Coder Kit
|
|
5
|
+
author: vibe-core
|
|
6
|
+
|
|
7
|
+
rules:
|
|
8
|
+
- id: SEC-001
|
|
9
|
+
name: no-secrets-in-code
|
|
10
|
+
pattern: "(API_KEY|SECRET|PASSWORD|PRIVATE_KEY)\\s*[:=]\\s*['\"]"
|
|
11
|
+
action: block
|
|
12
|
+
message: "Kodda secret tespit edildi"
|
|
13
|
+
severity: critical
|
|
14
|
+
category: security
|
|
15
|
+
|
|
16
|
+
- id: SEC-002
|
|
17
|
+
name: no-eval
|
|
18
|
+
pattern: "eval\\("
|
|
19
|
+
action: warn
|
|
20
|
+
message: "eval() kullanımı tespit edildi"
|
|
21
|
+
severity: high
|
|
22
|
+
category: security
|
|
23
|
+
|
|
24
|
+
- id: SEC-003
|
|
25
|
+
name: no-inner-html
|
|
26
|
+
pattern: "innerHTML\\s*="
|
|
27
|
+
action: warn
|
|
28
|
+
message: "innerHTML kullanımı XSS riski taşıyor"
|
|
29
|
+
severity: high
|
|
30
|
+
category: security
|
|
31
|
+
|
|
32
|
+
- id: SEC-004
|
|
33
|
+
name: no-http-in-prod
|
|
34
|
+
pattern: "http://(?!localhost|127\\.0\\.0\\.1)"
|
|
35
|
+
action: warn
|
|
36
|
+
message: "Production'da HTTP kullanımı tespit edildi"
|
|
37
|
+
severity: medium
|
|
38
|
+
category: security
|
|
39
|
+
|
|
40
|
+
- id: SEC-005
|
|
41
|
+
name: no-console-log
|
|
42
|
+
pattern: "console\\.log\\("
|
|
43
|
+
action: info
|
|
44
|
+
message: "console.log kullanımı tespit edildi"
|
|
45
|
+
severity: low
|
|
46
|
+
category: hygiene
|
|
47
|
+
|
|
48
|
+
hooks:
|
|
49
|
+
- phase: code
|
|
50
|
+
action: run_security_scan
|
|
51
|
+
priority: 1
|
|
52
|
+
timing: post
|
|
53
|
+
|
|
54
|
+
- phase: review
|
|
55
|
+
action: generate_security_report
|
|
56
|
+
priority: 2
|
|
57
|
+
timing: post
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Vibe Coder Kit — GitHub Actions CI/CD Integration
|
|
2
|
+
name: VCK Workflow
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
branches: [main, feat/*, fix/*]
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [main]
|
|
9
|
+
|
|
10
|
+
env:
|
|
11
|
+
NODE_VERSION: '20'
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
# Phase: Code — Triggered on feat/* and fix/* branches
|
|
15
|
+
phase-code:
|
|
16
|
+
if: startsWith(github.ref, 'refs/heads/feat/') || startsWith(github.ref, 'refs/heads/fix/')
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Setup Node.js
|
|
22
|
+
uses: actions/setup-node@v4
|
|
23
|
+
with:
|
|
24
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
25
|
+
cache: 'npm'
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: npm ci
|
|
29
|
+
|
|
30
|
+
- name: Run tests
|
|
31
|
+
run: npm test
|
|
32
|
+
|
|
33
|
+
- name: Run linter
|
|
34
|
+
run: npm run lint
|
|
35
|
+
|
|
36
|
+
- name: Check test coverage
|
|
37
|
+
run: npm run test:coverage -- --threshold=80
|
|
38
|
+
|
|
39
|
+
- name: Security audit
|
|
40
|
+
run: npm audit --audit-level=moderate
|
|
41
|
+
|
|
42
|
+
- name: Update VCK state
|
|
43
|
+
if: success()
|
|
44
|
+
run: |
|
|
45
|
+
echo '{"phase":"code","type":"COMPLETED","timestamp":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}' >> .vibe/state/events.jsonl
|
|
46
|
+
|
|
47
|
+
# Phase: Review — Triggered on PRs
|
|
48
|
+
phase-review:
|
|
49
|
+
if: github.event_name == 'pull_request'
|
|
50
|
+
runs-on: ubuntu-latest
|
|
51
|
+
needs: phase-code
|
|
52
|
+
steps:
|
|
53
|
+
- uses: actions/checkout@v4
|
|
54
|
+
|
|
55
|
+
- name: Code Quality Gate
|
|
56
|
+
run: |
|
|
57
|
+
echo "Running code quality checks..."
|
|
58
|
+
npm run lint
|
|
59
|
+
npm run test:coverage
|
|
60
|
+
|
|
61
|
+
- name: Security Scan
|
|
62
|
+
run: |
|
|
63
|
+
npm audit --audit-level=critical
|
|
64
|
+
|
|
65
|
+
- name: Size Limit Check
|
|
66
|
+
run: npx size-limit
|
|
67
|
+
continue-on-error: true
|
|
68
|
+
|
|
69
|
+
# Phase: Deploy — Triggered on main branch
|
|
70
|
+
phase-deploy:
|
|
71
|
+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
72
|
+
needs: phase-review
|
|
73
|
+
runs-on: ubuntu-latest
|
|
74
|
+
environment: production
|
|
75
|
+
steps:
|
|
76
|
+
- uses: actions/checkout@v4
|
|
77
|
+
|
|
78
|
+
- name: Setup Node.js
|
|
79
|
+
uses: actions/setup-node@v4
|
|
80
|
+
with:
|
|
81
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
82
|
+
|
|
83
|
+
- name: Install & Build
|
|
84
|
+
run: |
|
|
85
|
+
npm ci
|
|
86
|
+
npm run build
|
|
87
|
+
|
|
88
|
+
- name: Run smoke tests
|
|
89
|
+
run: npm run test:smoke || true
|
|
90
|
+
|
|
91
|
+
- name: Deploy to production
|
|
92
|
+
run: |
|
|
93
|
+
echo "Deploying to production..."
|
|
94
|
+
# Add your deploy command here
|
|
95
|
+
# npm run deploy
|
|
96
|
+
|
|
97
|
+
- name: Post-deploy health check
|
|
98
|
+
run: |
|
|
99
|
+
echo "Running health check..."
|
|
100
|
+
# Add health check here
|
|
101
|
+
# curl -f https://your-app.com/health
|
|
102
|
+
|
|
103
|
+
- name: Update VCK state
|
|
104
|
+
if: success()
|
|
105
|
+
run: |
|
|
106
|
+
echo '{"phase":"deploy","type":"COMPLETED","timestamp":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}' >> .vibe/state/events.jsonl
|
|
107
|
+
|
|
108
|
+
# Rollback job
|
|
109
|
+
rollback:
|
|
110
|
+
if: failure() && needs.phase-deploy.result == 'failure'
|
|
111
|
+
runs-on: ubuntu-latest
|
|
112
|
+
needs: phase-deploy
|
|
113
|
+
steps:
|
|
114
|
+
- uses: actions/checkout@v4
|
|
115
|
+
|
|
116
|
+
- name: Automatic Rollback
|
|
117
|
+
run: |
|
|
118
|
+
echo "Initiating rollback..."
|
|
119
|
+
# Add your rollback command here
|
|
120
|
+
# git revert HEAD --no-edit
|
|
121
|
+
# npm run deploy:rollback
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Vibe Coder Kit — Agent Instructions
|
|
2
|
+
|
|
3
|
+
## Quick Start
|
|
4
|
+
|
|
5
|
+
1. Read `.vibe/config.json` for project configuration
|
|
6
|
+
2. Read `.vibe/state/derived-state.json` for current state
|
|
7
|
+
3. Read the relevant flow file from `.vibe/flows/`
|
|
8
|
+
4. Follow the steps in the flow file
|
|
9
|
+
5. Update state after completing each step
|
|
10
|
+
|
|
11
|
+
## Core Rules
|
|
12
|
+
|
|
13
|
+
### Rule 1: Safety First
|
|
14
|
+
- Never expose secrets in code
|
|
15
|
+
- Never run destructive commands without approval
|
|
16
|
+
- Always validate user input
|
|
17
|
+
|
|
18
|
+
### Rule 2: State Management
|
|
19
|
+
- Use EventStore for all state changes
|
|
20
|
+
- Never edit derived-state.json directly
|
|
21
|
+
- Append events, don't modify
|
|
22
|
+
|
|
23
|
+
### Rule 3: Workflow
|
|
24
|
+
- Follow the DAG in phase-graph.json
|
|
25
|
+
- Validate transitions before executing
|
|
26
|
+
- Respect entry/exit criteria
|
|
27
|
+
|
|
28
|
+
### Rule 4: Quality
|
|
29
|
+
- Write tests before code (TDD)
|
|
30
|
+
- Maintain > 80% coverage
|
|
31
|
+
- Run lint and type checks
|
|
32
|
+
|
|
33
|
+
### Rule 5: Knowledge
|
|
34
|
+
- Document decisions in knowledge base
|
|
35
|
+
- Update INDEX.md after adding entries
|
|
36
|
+
- Capture lessons learned
|
|
37
|
+
|
|
38
|
+
### Rule 6: Honesty
|
|
39
|
+
- Say "I don't know" when uncertain
|
|
40
|
+
- Present pros and cons
|
|
41
|
+
- State assumptions clearly
|
|
42
|
+
|
|
43
|
+
### Rule 7: Security
|
|
44
|
+
- Use security rules plugin
|
|
45
|
+
- Scan code before committing
|
|
46
|
+
- Never commit secrets
|
|
47
|
+
|
|
48
|
+
### Rule 8: Team
|
|
49
|
+
- Respect role-based access
|
|
50
|
+
- Follow governance rules
|
|
51
|
+
- Document for others
|
|
52
|
+
|
|
53
|
+
## File Structure
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
.vibe/
|
|
57
|
+
├── config.json # Project configuration
|
|
58
|
+
├── phase-graph.json # Workflow DAG
|
|
59
|
+
├── core/ # Core modules
|
|
60
|
+
│ ├── index.ts # Main exports
|
|
61
|
+
│ ├── event-store.ts # State management
|
|
62
|
+
│ ├── dag.ts # Workflow engine
|
|
63
|
+
│ ├── plugin-registry.ts
|
|
64
|
+
│ ├── circuit-breaker.ts
|
|
65
|
+
│ ├── saga.ts
|
|
66
|
+
│ ├── idempotency.ts
|
|
67
|
+
│ ├── validator.ts
|
|
68
|
+
│ ├── cli.ts
|
|
69
|
+
│ ├── telemetry.ts
|
|
70
|
+
│ ├── health-check.ts
|
|
71
|
+
│ ├── cost-tracker.ts
|
|
72
|
+
│ ├── knowledge-store.ts
|
|
73
|
+
│ └── team-config.ts
|
|
74
|
+
├── flows/ # Workflow definitions
|
|
75
|
+
├── plugins/ # Rule plugins
|
|
76
|
+
├── behaviors/ # Behavior protocols
|
|
77
|
+
├── state/ # Event store
|
|
78
|
+
├── memory/ # Knowledge base
|
|
79
|
+
├── workspace/ # Working files
|
|
80
|
+
└── templates/ # CI/CD templates
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Commands
|
|
84
|
+
|
|
85
|
+
- `vibe init` — Initialize project
|
|
86
|
+
- `vibe status` — Show current status
|
|
87
|
+
- `vibe doctor` — Health check
|
|
88
|
+
- `vibe rollback` — Rollback last action
|
package/README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Vibe Coder Kit
|
|
2
|
+
|
|
3
|
+
Production-ready AI agent workflow template with TypeScript enforcement.
|
|
4
|
+
|
|
5
|
+
## What is it?
|
|
6
|
+
|
|
7
|
+
Vibe Coder Kit (VCK) is a framework that makes AI agents work safely, traceably, and with quality. It replaces mutable STATE.md with immutable event logs, linear phase numbering with DAG-based workflows, and natural language rules with TypeScript enforcement.
|
|
8
|
+
|
|
9
|
+
## Quick Start
|
|
10
|
+
|
|
11
|
+
### Install globally
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install -g vibe-coder-kit
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Add to any project
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
cd your-project
|
|
21
|
+
vibe init
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Or use with npx (no install)
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx vibe-coder-kit init
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Install VCK to current project
|
|
34
|
+
vibe init
|
|
35
|
+
|
|
36
|
+
# Show current status
|
|
37
|
+
vibe status
|
|
38
|
+
|
|
39
|
+
# Health check
|
|
40
|
+
vibe doctor
|
|
41
|
+
|
|
42
|
+
# Show version
|
|
43
|
+
vibe version
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## What it does
|
|
47
|
+
|
|
48
|
+
### Workflow Management
|
|
49
|
+
Manages the entire software development lifecycle:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
init → clarify → brainstorm → plan → approve → code → review → learn → done
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Agent Control
|
|
56
|
+
Prevents AI agents from working carelessly:
|
|
57
|
+
|
|
58
|
+
- **Secret detection**: Catches API keys, passwords in code
|
|
59
|
+
- **Test enforcement**: Can't skip tests
|
|
60
|
+
- **RBAC**: Role-based access control
|
|
61
|
+
- **Budget limits**: Stops when token limit exceeded
|
|
62
|
+
|
|
63
|
+
### Reliability
|
|
64
|
+
Prevents system crashes:
|
|
65
|
+
|
|
66
|
+
- **Circuit Breaker**: Stops on too many failures
|
|
67
|
+
- **Saga**: Automatic rollback on step failure
|
|
68
|
+
- **Retry**: Auto-retry with exponential backoff
|
|
69
|
+
|
|
70
|
+
### Observability
|
|
71
|
+
Everything is logged:
|
|
72
|
+
|
|
73
|
+
- **Event Store**: All operations recorded (append-only)
|
|
74
|
+
- **Telemetry**: Performance metrics
|
|
75
|
+
- **Knowledge Store**: Lessons learned
|
|
76
|
+
|
|
77
|
+
## Project Structure
|
|
78
|
+
|
|
79
|
+
After installation, your project will have:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
your-project/
|
|
83
|
+
├── .vibe/
|
|
84
|
+
│ ├── core/ # TypeScript modules
|
|
85
|
+
│ ├── flows/ # Workflow definitions
|
|
86
|
+
│ ├── plugins/ # Rule plugins
|
|
87
|
+
│ ├── behaviors/ # Behavior protocols
|
|
88
|
+
│ ├── config.json # Configuration
|
|
89
|
+
│ ├── phase-graph.json # DAG workflow
|
|
90
|
+
│ └── state/ # Event store
|
|
91
|
+
└── AGENTS.md # Agent instructions
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Configuration
|
|
95
|
+
|
|
96
|
+
Edit `.vibe/config.json` to customize:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"projectType": "web",
|
|
101
|
+
"teamSize": "small",
|
|
102
|
+
"painPoint": "review",
|
|
103
|
+
"costTracking": {
|
|
104
|
+
"budgetPerSession": 50000
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## How to use with AI agents
|
|
110
|
+
|
|
111
|
+
Just tell your agent:
|
|
112
|
+
|
|
113
|
+
> "Follow the rules in .vibe/"
|
|
114
|
+
|
|
115
|
+
The agent will:
|
|
116
|
+
1. Read `AGENTS.md`
|
|
117
|
+
2. Follow the workflow in `phase-graph.json`
|
|
118
|
+
3. Execute flows from `.vibe/flows/`
|
|
119
|
+
4. Log events to `.vibe/state/events.jsonl`
|
|
120
|
+
5. Enforce rules from `.vibe/plugins/`
|
|
121
|
+
|
|
122
|
+
## Requirements
|
|
123
|
+
|
|
124
|
+
- Node.js >= 18.0.0
|
|
125
|
+
- npm >= 9.0.0
|
|
126
|
+
|
|
127
|
+
## License
|
|
128
|
+
|
|
129
|
+
MIT
|