takomi 2.0.5 → 2.0.6

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.
@@ -1,81 +1,34 @@
1
- ---
2
- name: code-review
3
- description: Run J-Star code review on staged changes. Analyze, fix P0/P1 issues, and iterate until clean.
4
- ---
5
-
6
- # Code Review Skill
7
-
8
- Run the J-Star Reviewer on staged changes, allowing iterative fixing of issues.
9
-
10
- ## When to Use
11
- - Before committing code changes
12
- - When code quality issues are mentioned
13
- - As a quality gate before merging
14
- - When user asks to "review this code"
15
-
16
- ## Quick Start
17
-
18
- ### 1. Build the Brain (First Time Only)
19
- ```bash
20
- jstar init
21
- ```
22
-
23
- ### 2. Stage Changes
24
- ```bash
25
- git add .
26
- ```
27
-
28
- ### 3. Run Review
29
- ```bash
30
- # Standard review (staged changes)
31
- jstar review
32
-
33
- # Retroactive (already committed)
34
- jstar review --last
35
-
36
- # Branch/PR review (against main)
37
- jstar review --pr
38
- ```
39
-
40
- ## Fix Loop Protocol
41
-
42
- 1. **Read Output**: Check `.jstar/last-review.md` or console
43
- 2. **Prioritize**: Focus on **P0_CRITICAL** and **P1_HIGH** only
44
- 3. **Loop Strategy**:
45
- - If P0/P1 found → Fix → Stage → Re-review
46
- - If only P2_MEDIUM → Consider "Good Enough"
47
- - **MAX LOOPS: 3** — If issues persist, stop and ask user
48
-
49
- ## Handling False Positives (Headless Mode)
50
-
51
- ```bash
52
- # Start headless session
53
- jstar chat --headless
54
-
55
- # List issues
56
- echo '{"action": "list"}' | jstar chat --headless
57
-
58
- # Debate an issue
59
- echo '{"action": "debate", "issueId": 0, "argument": "This is correct because..."}' | jstar chat --headless
60
-
61
- # Exit
62
- echo '{"action": "exit"}' | jstar chat --headless
63
- ```
64
-
65
- ## AI Fix Cycle
66
- ```
67
- 1. jstar review --json → Parse findings
68
- 2. Apply code fixes
69
- 3. git add . → Stage changes
70
- 4. jstar init → Update brain (if new files added)
71
- 5. jstar review --json → Verify fixes
72
- 6. Repeat until P0/P1 = 0
73
- ```
74
-
75
- ## Headless Commands
76
- | Action | Parameters | Description |
77
- |--------|------------|-------------|
78
- | `list` | — | List all current issues |
79
- | `debate` | `issueId`, `argument` | Challenge an issue |
80
- | `ignore` | `issueId` | Mark issue as ignored |
81
- | `exit` | — | End session, get final report |
1
+ ---
2
+ name: code-review
3
+ description: Deprecated compatibility alias for J-Star Reviewer. Use `jstar-reviewer` for the canonical install, review, audit, and automation flows.
4
+ ---
5
+
6
+ # Code Review (Deprecated)
7
+
8
+ This skill is kept only for backward compatibility with older Takomi prompts and habits.
9
+
10
+ Use `jstar-reviewer` as the canonical skill for:
11
+ - installing the `jstar-reviewer` npm package
12
+ - setting up `.jstar/`, `.env.local`, and `.gitignore`
13
+ - running `review` and `audit`
14
+ - using `--json` and `chat --headless` automation flows
15
+
16
+ ## Redirect Rule
17
+
18
+ If this skill is invoked, treat it as a redirect to `jstar-reviewer`.
19
+
20
+ Do not use this file as the authoritative J-Star workflow documentation.
21
+
22
+ ## Operational Rule
23
+
24
+ `review` and `audit` are separate steps.
25
+
26
+ If the user wants a serious verification pass, run both:
27
+ 1. `review` for code review findings and fix prompts
28
+ 2. `audit` for deterministic security audit findings
29
+
30
+ ## Canonical References
31
+
32
+ - `assets/.agent/skills/jstar-reviewer/SKILL.md`
33
+ - `assets/.agent/workflows/spawn-jstar-code-review.md`
34
+ - `assets/.agent/workflows/review_code.md`
@@ -0,0 +1,229 @@
1
+ ---
2
+ name: jstar-reviewer
3
+ description: Install, configure, and use the J-Star Reviewer npm package. Use when a user wants to set up J-Star in a repository, publish or consume the npm package, initialize the local index, run the project review flow, run the separate security audit flow, or operate J-Star through JSON/headless commands.
4
+ ---
5
+
6
+ # J-Star Reviewer
7
+
8
+ ## When to Use
9
+
10
+ Use this skill when the user wants to:
11
+ - install J-Star from npm in any repository
12
+ - set up `.env.local`, `.jstar/`, and `.gitignore`
13
+ - initialize or refresh the local code index
14
+ - run `review` and `audit` as separate required steps
15
+ - use J-Star in automation with `--json` or `--headless`
16
+ - validate the package repo before publishing to npm
17
+
18
+ ## Core Rule
19
+
20
+ `review` and `audit` are separate steps.
21
+
22
+ If the user is serious about a change set, run both:
23
+ 1. `review` for hybrid deterministic + LLM code review
24
+ 2. `audit` for deterministic security audit
25
+
26
+ Do not present one as a substitute for the other.
27
+
28
+ ## Command Prefix
29
+
30
+ Pick one command prefix and use it consistently for the rest of the session:
31
+
32
+ - Global install: `jstar`
33
+ - One-off npm usage: `npx jstar-reviewer`
34
+ - Package repo development: `pnpm run`
35
+
36
+ Examples below use `<cmd>` for the global or `npx` forms.
37
+
38
+ ## Consumer Install Flow
39
+
40
+ Use this in a repository that wants to consume the published npm package.
41
+
42
+ ### 1. Prerequisites
43
+
44
+ - Node.js 18+
45
+ - Git repository
46
+ - Gemini API key
47
+ - Groq API key
48
+
49
+ ### 2. Install
50
+
51
+ Preferred:
52
+
53
+ ```bash
54
+ pnpm add -g jstar-reviewer
55
+ ```
56
+
57
+ Fallback:
58
+
59
+ ```bash
60
+ npm install -g jstar-reviewer
61
+ ```
62
+
63
+ No global install:
64
+
65
+ ```bash
66
+ npx jstar-reviewer --help
67
+ ```
68
+
69
+ ### 3. Set up the repo
70
+
71
+ ```bash
72
+ <cmd> setup
73
+ ```
74
+
75
+ This should create or update:
76
+ - `.jstar/`
77
+ - `.env.example`
78
+ - `.gitignore`
79
+
80
+ ### 4. Create `.env.local`
81
+
82
+ PowerShell:
83
+
84
+ ```powershell
85
+ Copy-Item .env.example .env.local
86
+ ```
87
+
88
+ POSIX shell:
89
+
90
+ ```bash
91
+ cp .env.example .env.local
92
+ ```
93
+
94
+ Required variables:
95
+
96
+ ```env
97
+ GEMINI_API_KEY=your_gemini_key
98
+ GROQ_API_KEY=your_groq_key
99
+ ```
100
+
101
+ Optional but useful:
102
+
103
+ ```env
104
+ GEMINI_EMBEDDING_MODEL=gemini-embedding-001
105
+ REVIEW_MODEL_NAME=moonshotai/kimi-k2-instruct-0905
106
+ ```
107
+
108
+ ### 5. Build the local index
109
+
110
+ ```bash
111
+ <cmd> init
112
+ ```
113
+
114
+ If indexing fails with a Google 404 for an embedding model, use:
115
+
116
+ ```env
117
+ GEMINI_EMBEDDING_MODEL=gemini-embedding-001
118
+ ```
119
+
120
+ ## Maintainer Flow
121
+
122
+ Use this inside the `jstar-reviewer` package repo itself before publishing.
123
+
124
+ ```bash
125
+ pnpm install
126
+ pnpm build
127
+ pnpm test
128
+ pnpm run index:init
129
+ pnpm run audit --json
130
+ ```
131
+
132
+ If you need to test the interactive review path inside the package repo:
133
+
134
+ ```bash
135
+ git add .
136
+ pnpm run review
137
+ ```
138
+
139
+ ## Required Usage Flow
140
+
141
+ ### Before commit or push
142
+
143
+ ```bash
144
+ git add .
145
+ <cmd> review
146
+ <cmd> audit
147
+ ```
148
+
149
+ ### After the commit already exists
150
+
151
+ ```bash
152
+ <cmd> review --last
153
+ <cmd> audit --last
154
+ ```
155
+
156
+ ### Branch or PR scope
157
+
158
+ ```bash
159
+ <cmd> review --pr
160
+ <cmd> audit --pr
161
+ ```
162
+
163
+ ## Review Commands
164
+
165
+ Main review targets:
166
+
167
+ ```bash
168
+ <cmd> review
169
+ <cmd> review --last
170
+ <cmd> review --commit <hash>
171
+ <cmd> review --range <start> <end>
172
+ <cmd> review --pr
173
+ <cmd> review --pr --base <branch>
174
+ ```
175
+
176
+ Review outputs:
177
+ - `.jstar/last-review.md`
178
+ - `.jstar/session.json`
179
+
180
+ ## Audit Commands
181
+
182
+ Main audit targets:
183
+
184
+ ```bash
185
+ <cmd> audit
186
+ <cmd> audit --path src
187
+ <cmd> audit --last
188
+ <cmd> audit --commit <hash>
189
+ <cmd> audit --range <start> <end>
190
+ <cmd> audit --pr
191
+ <cmd> audit --pr --base <branch>
192
+ ```
193
+
194
+ Audit outputs:
195
+ - `.jstar/audit_report.md`
196
+ - `.jstar/audit_report.json`
197
+
198
+ False positives are handled with:
199
+ - `.jstar/audit-ignore.json`
200
+
201
+ ## Automation Mode
202
+
203
+ For machine-readable review output:
204
+
205
+ ```bash
206
+ <cmd> review --json
207
+ <cmd> audit --json
208
+ ```
209
+
210
+ For issue debate:
211
+
212
+ ```bash
213
+ <cmd> chat --headless
214
+ ```
215
+
216
+ Headless commands:
217
+ - `{"action":"list"}`
218
+ - `{"action":"debate","issueId":0,"argument":"..."}`
219
+ - `{"action":"ignore","issueId":0}`
220
+ - `{"action":"accept","issueId":0}`
221
+ - `{"action":"exit"}`
222
+
223
+ ## Decision Rules for the AI
224
+
225
+ - If the repo is missing `.jstar/storage`, run `init` before `review`.
226
+ - If the user asks for a serious verification pass, run both `review` and `audit`.
227
+ - If the user only wants deterministic security checks, run `audit`.
228
+ - If the user only wants code-review findings and fix prompts on a diff, run `review`.
229
+ - If `review` says there are no staged changes, either stage files or switch to `--last`, `--range`, or `--pr`.
@@ -0,0 +1,7 @@
1
+ interface:
2
+ display_name: "J-Star Reviewer"
3
+ short_description: "Install and run J-Star review and audit"
4
+ default_prompt: "Use $jstar-reviewer to install J-Star in this repository and run both the review and audit flows."
5
+
6
+ policy:
7
+ allow_implicit_invocation: true
@@ -1,133 +1,96 @@
1
- ---
2
- description: Run the J-Star Code Reviewer loop to analyze and fix code quality issues.
3
- ---
4
-
5
- # J-Star Code Review Workflow
6
-
7
- This workflow executes the J-Star Reviewer on staged changes, allowing the agent to iteratively fix issues.
8
-
9
- ## 1. Build the Brain (Required once)
10
- If you haven't indexed the project yet, or if major files have changed, run:
11
- // turbo
12
- ```bash
13
- jstar init
14
- ```
15
-
16
- ## 2. Stage Current Changes
17
- Ensure all recent changes are staged so the reviewer can see them.
18
- // turbo
19
- ```bash
20
- git add .
21
- ```
22
-
23
- ## 3. Run Reviewer
24
- Execute the review pipeline.
25
-
26
- ### Standard Review (Staged Changes)
27
- ```bash
28
- jstar review
29
- ```
30
- *Use this when changes are staged but not yet committed.*
31
-
32
- ### Retroactive Review (Oops Mode)
33
- If you already committed changes but forgot to review:
34
- ```bash
35
- jstar review --last
36
- ```
37
- *Equivalent to checking the last commit `HEAD~1..HEAD`.*
38
-
39
- ### Branch/PR Review
40
- If working on a feature branch, check against main:
41
- ```bash
42
- jstar review --pr
43
- ```
44
- *Equivalent to `git diff main...HEAD`. Use this for full feature verification.*
45
-
46
- ## 4. Analyze and Fix
47
- **Agent Instructions:**
48
- 1. **Read the Output**: Check `.jstar/last-review.md` or the console summary.
49
- 2. **Prioritize**: Focus *only* on **P0_CRITICAL** and **P1_HIGH** issues first.
50
- 3. **Looping Strategy**:
51
- - **IF** P0/P1 issues are found:
52
- - Apply fixes to the code.
53
- - Stage changes: `git add .`
54
- - (Optional) Re-index if you added new files: `jstar init`
55
- - Restart this workflow (Stage -> Review).
56
- - **IF** only P2_MEDIUM issues remain:
57
- - You may fix them if they are quick/obvious.
58
- - Otherwise, consider the code "Good Enough" and stop.
59
- - **MAX LOOPS**: 3. Do not run this cycle more than 3 times. If issues persist, stop and ask the user.
60
-
61
- ## 5. Handling False Positives (Debate Mode)
62
-
63
- If the reviewer flags correct code as an issue (e.g., security false positives), use **Headless Chat** to resolve it.
64
-
65
- **Protocol:**
66
- 1. **Start Session:**
67
- Use the `run_command` tool to start the background process:
68
- ```bash
69
- jstar chat --headless
70
- ```
71
- *Note: Capture the `CommandId` returned by this tool.*
72
-
73
- 2. **List Issues (Get IDs):**
74
- Use `send_command_input` with the `CommandId`:
75
- ```json
76
- {"action": "list"}
77
- ```
78
- *Wait for output. Identify the numeric `id` of the issue you want to challenge.*
79
-
80
- 3. **Debate:**
81
- Use `send_command_input` to explain why it's a false positive:
82
- ```json
83
- {"action": "debate", "issueId": 0, "argument": "This is correct because..."}
84
- ```
85
- *Use the integer `id` from step 2.*
86
-
87
- 4. **Verify Result:**
88
- Check the output for `"status": "resolved"` and `"verdict": "LGTM"`.
89
-
90
- 5. **Exit:**
91
- Terminate the session cleanly:
92
- ```json
93
- {"action": "exit"}
94
- ```
95
-
96
- ---
97
-
98
- ## AI Agent Mode (Headless)
99
-
100
- For programmatic interaction without TUI navigation, use headless mode.
101
-
102
- ### JSON Review (One-Shot)
103
- Get findings as JSON for parsing:
104
- // turbo
105
- ```bash
106
- jstar review --json > .jstar/report.json
107
- ```
108
-
109
- ### Headless Chat (Interactive Protocol)
110
- For debating specific issues via stdin/stdout:
111
- ```bash
112
- echo '{"action": "list"}' | jstar chat --headless
113
- ```
114
-
115
- **Commands:**
116
- | Action | Parameters | Description |
117
- |--------|------------|-------------|
118
- | `list` | — | List all current issues |
119
- | `debate` | `issueId`, `argument` | Challenge an issue |
120
- | `ignore` | `issueId` | Mark issue as ignored |
121
- | `exit` | — | End session, get final report |
122
-
123
- See [Headless Mode Docs](../docs/features/headless-mode.md) for full protocol.
124
-
125
- ### AI Fix Cycle
126
- ```
127
- 1. jstar review --json → Parse findings
128
- 2. Apply code fixes
129
- 3. git add . → Stage changes
130
- 4. jstar init → Update brain (if new files added)
131
- 5. jstar review --json → Verify fixes
132
- 6. Repeat until P0/P1 = 0
133
- ```
1
+ ---
2
+ description: Run the up-to-date J-Star review and audit loop for a change set.
3
+ ---
4
+
5
+ # J-Star Review Workflow
6
+
7
+ Use this workflow when the repository already has J-Star installed and you need to verify a change set.
8
+
9
+ ## Core Rule
10
+
11
+ `review` and `audit` are separate steps.
12
+
13
+ For a serious verification pass, run both.
14
+
15
+ ## 1. Build the Local Index
16
+
17
+ If the repository is missing `.jstar/storage`, or if major files were added, run:
18
+
19
+ ```bash
20
+ jstar init
21
+ ```
22
+
23
+ ## 2. Choose the Scope
24
+
25
+ ### Staged changes
26
+
27
+ ```bash
28
+ git add .
29
+ jstar review
30
+ jstar audit
31
+ ```
32
+
33
+ ### Last commit
34
+
35
+ ```bash
36
+ jstar review --last
37
+ jstar audit --last
38
+ ```
39
+
40
+ ### Branch or PR scope
41
+
42
+ ```bash
43
+ jstar review --pr
44
+ jstar audit --pr
45
+ ```
46
+
47
+ ## 3. Read the Outputs
48
+
49
+ Review outputs:
50
+ - `.jstar/last-review.md`
51
+ - `.jstar/session.json`
52
+
53
+ Audit outputs:
54
+ - `.jstar/audit_report.md`
55
+ - `.jstar/audit_report.json`
56
+
57
+ ## 4. Fix Loop
58
+
59
+ Agent instructions:
60
+ 1. Read both the review and audit outputs.
61
+ 2. Prioritize review `P0_CRITICAL` and `P1_HIGH` issues first.
62
+ 3. Prioritize audit `CRITICAL` and `HIGH` findings first.
63
+ 4. Apply fixes.
64
+ 5. Stage changes with `git add .`.
65
+ 6. Re-run both `review` and `audit` for the same scope.
66
+ 7. If only lower-priority review issues remain, stop when the remaining work is not worth another loop.
67
+ 8. Maximum loops: 3. If issues persist, stop and ask the user.
68
+
69
+ ## 5. False Positives and Debate
70
+
71
+ For review findings that need challenge or adjudication:
72
+
73
+ ```bash
74
+ jstar chat --headless
75
+ ```
76
+
77
+ Headless commands:
78
+ - `{"action":"list"}`
79
+ - `{"action":"debate","issueId":0,"argument":"..."}`
80
+ - `{"action":"ignore","issueId":0}`
81
+ - `{"action":"accept","issueId":0}`
82
+ - `{"action":"exit"}`
83
+
84
+ For known deterministic audit false positives, use:
85
+ - `.jstar/audit-ignore.json`
86
+
87
+ ## 6. Automation Mode
88
+
89
+ Machine-readable review output:
90
+
91
+ ```bash
92
+ jstar review --json > .jstar/last-review.json
93
+ jstar audit --json > .jstar/audit_report.json
94
+ ```
95
+
96
+ Use `review --json` and `audit --json` for automation. Do not rely on `review --headless`.