thachvd-kit 1.0.21 → 1.0.23
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/.agent/docs/architecture.md +15 -23
- package/.agent/docs/conventions.md +15 -21
- package/.agent/docs/project.md +47 -40
- package/.agent/docs/tooling.md +4 -2
- package/.agent/docs/workflow.md +28 -28
- package/bin/cli.js +7 -40
- package/package.json +1 -1
|
@@ -1,23 +1,15 @@
|
|
|
1
|
-
# Architecture Notes
|
|
2
|
-
|
|
3
|
-
## Current Map
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
- `CLAUDE.md`: imports `AGENTS.md` for Claude Code.
|
|
17
|
-
- `GEMINI.md`: points to `AGENTS.md` for Antigravity.
|
|
18
|
-
- `.cursorrules`: points to `AGENTS.md` for Cursor.
|
|
19
|
-
- `.agent/docs/*.md`: stack, architecture, conventions, and workflow.
|
|
20
|
-
|
|
21
|
-
## Maintenance Rule
|
|
22
|
-
|
|
23
|
-
Keep root entry files short. Add project-specific details to `.agent/docs/*` and reusable behavior to `.agent/skills/*` or `.agent/workflows/*`.
|
|
1
|
+
# Architecture Notes
|
|
2
|
+
|
|
3
|
+
## Current Map
|
|
4
|
+
|
|
5
|
+
- App root is the repository root unless refined below.
|
|
6
|
+
- TODO: refine major directories and responsibilities.
|
|
7
|
+
- TODO: refine main entry points, routing, state boundaries, and integration boundaries.
|
|
8
|
+
|
|
9
|
+
## Detected Evidence
|
|
10
|
+
|
|
11
|
+
- language:javascript => found package.json; package.json -> JavaScript dependency graph
|
|
12
|
+
|
|
13
|
+
## AI Maintenance Rule
|
|
14
|
+
|
|
15
|
+
Before non-trivial implementation work, inspect this file. If it is stale or still contains TODO items relevant to the task, update it from the code before editing product code.
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
# Coding Conventions
|
|
2
|
-
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
- Keep
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
## Verification
|
|
18
|
-
|
|
19
|
-
- Syntax-check `bin/cli.js` after edits.
|
|
20
|
-
- Run `npm test`.
|
|
21
|
-
- Run `npm pack --dry-run` for package output changes.
|
|
1
|
+
# Coding Conventions
|
|
2
|
+
|
|
3
|
+
## Current Standards
|
|
4
|
+
|
|
5
|
+
- Maximum file length: 300 lines unless the existing project standard is stricter.
|
|
6
|
+
- Code comments and identifiers should be written in English.
|
|
7
|
+
- Keep changes scoped to the user request.
|
|
8
|
+
- Prefer existing local patterns over introducing new abstractions.
|
|
9
|
+
- TODO: refine naming, formatting, folder, API, state, styling, and testing conventions from the real codebase.
|
|
10
|
+
|
|
11
|
+
## Verification
|
|
12
|
+
|
|
13
|
+
- Run the focused test or lint command that matches the touched area.
|
|
14
|
+
- If no automated check exists, document the manual verification performed.
|
|
15
|
+
- Do not claim completion without verification evidence.
|
package/.agent/docs/project.md
CHANGED
|
@@ -1,40 +1,47 @@
|
|
|
1
|
-
# Project Rules
|
|
2
|
-
|
|
3
|
-
Generated by thachvd-kit.
|
|
4
|
-
|
|
5
|
-
## Summary
|
|
6
|
-
|
|
7
|
-
- Name: thachvd-kit
|
|
8
|
-
- Description:
|
|
9
|
-
- Type:
|
|
10
|
-
- App root:
|
|
11
|
-
|
|
12
|
-
## Stack
|
|
13
|
-
|
|
14
|
-
- Language:
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
|
32
|
-
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
-
|
|
1
|
+
# Project Rules
|
|
2
|
+
|
|
3
|
+
Generated by thachvd-kit on 2026-06-16.
|
|
4
|
+
|
|
5
|
+
## Summary
|
|
6
|
+
|
|
7
|
+
- Name: thachvd-kit
|
|
8
|
+
- Description: Cross-agent project rules bootstrap kit for Codex, Antigravity, and Claude Code
|
|
9
|
+
- Type: cli
|
|
10
|
+
- App root: .
|
|
11
|
+
|
|
12
|
+
## Stack
|
|
13
|
+
|
|
14
|
+
- Language: javascript
|
|
15
|
+
- Frameworks: none
|
|
16
|
+
- Database: none
|
|
17
|
+
- Infrastructure: none
|
|
18
|
+
- Package manager: npm
|
|
19
|
+
- Test framework: auto-detect
|
|
20
|
+
|
|
21
|
+
## Commands
|
|
22
|
+
|
|
23
|
+
- Install: `npm install`
|
|
24
|
+
- Dev: `npm run dev`
|
|
25
|
+
- Build: `npm run build`
|
|
26
|
+
- Test: `npm test`
|
|
27
|
+
- Lint: `npm run lint`
|
|
28
|
+
|
|
29
|
+
## Agent Routing
|
|
30
|
+
|
|
31
|
+
| Task Type | Agent | Primary Skills |
|
|
32
|
+
|-----------|-------|----------------|
|
|
33
|
+
| Backend API | `backend-specialist` | nodejs-best-practices, api-design |
|
|
34
|
+
| Debug | `debugger` | systematic-debugging |
|
|
35
|
+
| Security | `security-auditor` | vulnerability-scanner |
|
|
36
|
+
| Planning | `project-planner` | brainstorming, plan-writing |
|
|
37
|
+
|
|
38
|
+
## Auto-Resolved Skills
|
|
39
|
+
|
|
40
|
+
- api-design
|
|
41
|
+
- clean-code
|
|
42
|
+
- nodejs-best-practices
|
|
43
|
+
- systematic-debugging
|
|
44
|
+
|
|
45
|
+
## Scan Evidence
|
|
46
|
+
|
|
47
|
+
- language:javascript => found package.json; package.json -> JavaScript dependency graph
|
package/.agent/docs/tooling.md
CHANGED
|
@@ -9,7 +9,7 @@ Use Playwright for browser and UI verification when a task touches web behavior.
|
|
|
9
9
|
- Check availability: `npx playwright --version`
|
|
10
10
|
- Install browsers: `npx playwright install`
|
|
11
11
|
- Codex MCP CLI setup: `codex mcp add playwright -- npx -y @playwright/mcp`
|
|
12
|
-
- Auto setup: `thachvd-kit
|
|
12
|
+
- Auto setup: `thachvd-kit`
|
|
13
13
|
- Kit helper: `python .agent/skills/webapp-testing/scripts/playwright_runner.py <url> --screenshot`
|
|
14
14
|
|
|
15
15
|
If the project already has Playwright configured, prefer the project's existing scripts.
|
|
@@ -44,7 +44,7 @@ Use codegraph for codebase exploration when the environment exposes it. The inde
|
|
|
44
44
|
- Check CLI availability: `codegraph --help`
|
|
45
45
|
- Install CLI if needed: `npm install -g @colbymchenry/codegraph`
|
|
46
46
|
- Codex MCP CLI setup: `codex mcp add codegraph -- codegraph serve --mcp`
|
|
47
|
-
- Auto setup: `thachvd-kit
|
|
47
|
+
- Auto setup: `thachvd-kit`
|
|
48
48
|
- If your Codex environment provides the codegraph CLI, run its project indexing step from the repository root.
|
|
49
49
|
- Keep `.codegraph/` ignored in git.
|
|
50
50
|
|
|
@@ -124,6 +124,8 @@ Common local path:
|
|
|
124
124
|
|
|
125
125
|
- Claude Code: `~/.claude.json` or `~/.claude/settings.json`
|
|
126
126
|
|
|
127
|
+
## Native Skill Folders
|
|
128
|
+
|
|
127
129
|
The shared kit skills live in `.agent/skills/`. Antigravity reads that folder directly. Codex shows skills from `~/.codex/skills/` in the `$` menu. Claude Code reads project skills from `.claude/skills/`.
|
|
128
130
|
|
|
129
131
|
- Codex global skills: `~/.codex/skills/` — installed by `thachvd-kit init`, visible in Codex `$` menu
|
package/.agent/docs/workflow.md
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
# Agent Workflow
|
|
2
|
-
|
|
3
|
-
## Before Every Task
|
|
4
|
-
|
|
5
|
-
1. Read
|
|
6
|
-
2. Read
|
|
7
|
-
3. Classify the request.
|
|
8
|
-
4.
|
|
1
|
+
# Agent Workflow
|
|
2
|
+
|
|
3
|
+
## Before Every Task
|
|
4
|
+
|
|
5
|
+
1. Read AGENTS.md.
|
|
6
|
+
2. Read .agent/docs/project.md.
|
|
7
|
+
3. Classify the request: question, survey, simple fix, feature, refactor, debug, UI, security, or deploy.
|
|
8
|
+
4. Read only the relevant docs under .agent/agents, .agent/skills, .claude/skills, and .agent/workflows.
|
|
9
9
|
|
|
10
10
|
## Skill Selection
|
|
11
11
|
|
|
12
12
|
- Prefer native skill discovery when the client exposes it.
|
|
13
|
-
- Codex
|
|
14
|
-
- Claude Code project skills live in
|
|
15
|
-
- Shared fallback skills live in
|
|
13
|
+
- Codex global skills live in ~/.codex/skills/ and are visible via the $ menu; thachvd-kit copies selected skills there on init.
|
|
14
|
+
- Claude Code project skills live in .claude/skills.
|
|
15
|
+
- Shared fallback skills live in .agent/skills.
|
|
16
16
|
- Do not load skill bodies by default.
|
|
17
|
-
- Load a skill when the user mentions it, the task clearly matches its
|
|
18
|
-
- Use explicit skill names in prompts for predictable behavior, for example
|
|
19
|
-
- Run
|
|
17
|
+
- Load a skill when the user mentions it, the task clearly matches its SKILL.md description, or .agent/docs/project.md routes the task to it.
|
|
18
|
+
- Use explicit skill names in prompts for predictable behavior, for example $webapp-testing or $clean-code.
|
|
19
|
+
- Run thachvd-kit --help to see common workflow and skill recommendations.
|
|
20
20
|
|
|
21
21
|
## Implementation Flow
|
|
22
|
-
|
|
23
|
-
1. State assumptions and success criteria when the task is not trivial.
|
|
24
|
-
2. Inspect dependent files before editing.
|
|
25
|
-
3. Make the smallest coherent change.
|
|
26
|
-
4. Add or update focused tests when behavior changes.
|
|
27
|
-
5. Run verification.
|
|
28
|
-
6. Summarize changed files and verification evidence.
|
|
29
|
-
|
|
30
|
-
##
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
|
|
23
|
+
1. State assumptions and success criteria when the task is not trivial.
|
|
24
|
+
2. Inspect dependent files before editing.
|
|
25
|
+
3. Make the smallest coherent change.
|
|
26
|
+
4. Add or update focused tests when behavior changes.
|
|
27
|
+
5. Run verification.
|
|
28
|
+
6. Summarize changed files and verification evidence.
|
|
29
|
+
|
|
30
|
+
## When To Update Docs
|
|
31
|
+
|
|
32
|
+
- Update .agent/docs/architecture.md when structure, boundaries, or entry points change.
|
|
33
|
+
- Update .agent/docs/conventions.md when repeated project patterns become clear.
|
|
34
|
+
- Update .agent/docs/project.md when stack, scripts, app root, test tooling, or routing changes.
|
|
35
|
+
- Keep AGENTS.md concise. Put project-specific detail in .agent/docs.
|
package/bin/cli.js
CHANGED
|
@@ -1472,21 +1472,14 @@ function mergeMcpJson(filePath, withType = false) {
|
|
|
1472
1472
|
return { ok: false, message: `${filePath} is not valid JSON; skipped` };
|
|
1473
1473
|
}
|
|
1474
1474
|
data.mcpServers = data.mcpServers || {};
|
|
1475
|
+
const npxCmd = process.platform === 'win32' ? 'npx.cmd' : 'npx';
|
|
1475
1476
|
const baseServers = {
|
|
1476
1477
|
codegraph: { command: 'codegraph', args: ['serve', '--mcp'] },
|
|
1477
|
-
playwright: { command:
|
|
1478
|
-
context7: { command:
|
|
1479
|
-
filesystem: { command: 'npx', args: ['-y', '@modelcontextprotocol/server-filesystem', targetDir.replace(/\\/g, '/')] }
|
|
1478
|
+
playwright: { command: npxCmd, args: ['-y', '@playwright/mcp'] },
|
|
1479
|
+
context7: { command: npxCmd, args: ['-y', '@upstash/context7-mcp'] }
|
|
1480
1480
|
};
|
|
1481
1481
|
if (data.permissions && Array.isArray(data.permissions.allow)) {
|
|
1482
1482
|
const requiredPermissions = [
|
|
1483
|
-
"mcp__filesystem__read_file",
|
|
1484
|
-
"mcp__filesystem__read_multiple_files",
|
|
1485
|
-
"mcp__filesystem__list_directory",
|
|
1486
|
-
"mcp__filesystem__directory_tree",
|
|
1487
|
-
"mcp__filesystem__search_files",
|
|
1488
|
-
"mcp__filesystem__get_file_info",
|
|
1489
|
-
"mcp__filesystem__write_file",
|
|
1490
1483
|
"mcp__context7__resolve-library-id",
|
|
1491
1484
|
"mcp__context7__query-docs"
|
|
1492
1485
|
];
|
|
@@ -1499,24 +1492,6 @@ function mergeMcpJson(filePath, withType = false) {
|
|
|
1499
1492
|
for (const [name, server] of Object.entries(baseServers)) {
|
|
1500
1493
|
if (!data.mcpServers[name]) {
|
|
1501
1494
|
data.mcpServers[name] = withType ? { type: 'stdio', ...server } : server;
|
|
1502
|
-
} else if (name === 'filesystem') {
|
|
1503
|
-
const fsServer = data.mcpServers[name];
|
|
1504
|
-
if (fsServer && Array.isArray(fsServer.args)) {
|
|
1505
|
-
// If it points to non-existent AppData roaming file, fix it to use npx
|
|
1506
|
-
const isLegacyNode = fsServer.command === 'node' && fsServer.args[0] && fsServer.args[0].includes('server-filesystem');
|
|
1507
|
-
if (isLegacyNode) {
|
|
1508
|
-
fsServer.command = 'npx';
|
|
1509
|
-
fsServer.args[0] = '-y';
|
|
1510
|
-
fsServer.args.splice(1, 0, '@modelcontextprotocol/server-filesystem');
|
|
1511
|
-
}
|
|
1512
|
-
const normalizedTarget = targetDir.replace(/\\/g, '/');
|
|
1513
|
-
const hasTarget = fsServer.args.some(arg => {
|
|
1514
|
-
return typeof arg === 'string' && (arg.replace(/\\/g, '/').toLowerCase() === normalizedTarget.toLowerCase());
|
|
1515
|
-
});
|
|
1516
|
-
if (!hasTarget) {
|
|
1517
|
-
fsServer.args.push(normalizedTarget);
|
|
1518
|
-
}
|
|
1519
|
-
}
|
|
1520
1495
|
}
|
|
1521
1496
|
}
|
|
1522
1497
|
writeJsonFile(filePath, data);
|
|
@@ -1528,21 +1503,13 @@ function appendMcpTomlIfMissing(filePath) {
|
|
|
1528
1503
|
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
1529
1504
|
const existing = fs.existsSync(filePath) ? fs.readFileSync(filePath, 'utf8') : '';
|
|
1530
1505
|
const blocks = [];
|
|
1531
|
-
const
|
|
1506
|
+
const npxCmd = process.platform === 'win32' ? 'npx.cmd' : 'npx';
|
|
1532
1507
|
if (!/\[mcp_servers\.context7\]/.test(existing)) {
|
|
1533
1508
|
blocks.push(`[mcp_servers.context7]
|
|
1534
|
-
command = "
|
|
1509
|
+
command = "${npxCmd}"
|
|
1535
1510
|
args = ["-y", "@upstash/context7-mcp"]
|
|
1536
1511
|
startup_timeout_sec = 20
|
|
1537
1512
|
tool_timeout_sec = 120
|
|
1538
|
-
`);
|
|
1539
|
-
}
|
|
1540
|
-
if (!/\[mcp_servers\.filesystem\]/.test(existing)) {
|
|
1541
|
-
blocks.push(`[mcp_servers.filesystem]
|
|
1542
|
-
command = "npx"
|
|
1543
|
-
args = ["-y", "@modelcontextprotocol/server-filesystem", "${normalizedTarget}"]
|
|
1544
|
-
startup_timeout_sec = 20
|
|
1545
|
-
tool_timeout_sec = 120
|
|
1546
1513
|
`);
|
|
1547
1514
|
}
|
|
1548
1515
|
if (!/\[mcp_servers\.codegraph\]/.test(existing)) {
|
|
@@ -1555,7 +1522,7 @@ tool_timeout_sec = 120
|
|
|
1555
1522
|
}
|
|
1556
1523
|
if (!/\[mcp_servers\.playwright\]/.test(existing)) {
|
|
1557
1524
|
blocks.push(`[mcp_servers.playwright]
|
|
1558
|
-
command = "
|
|
1525
|
+
command = "${npxCmd}"
|
|
1559
1526
|
args = ["-y", "@playwright/mcp"]
|
|
1560
1527
|
startup_timeout_sec = 20
|
|
1561
1528
|
tool_timeout_sec = 120
|
|
@@ -1566,7 +1533,7 @@ tool_timeout_sec = 120
|
|
|
1566
1533
|
}
|
|
1567
1534
|
const separator = existing && !existing.endsWith('\n') ? '\n\n' : existing ? '\n' : '';
|
|
1568
1535
|
fs.writeFileSync(filePath, existing + separator + blocks.join('\n'), 'utf8');
|
|
1569
|
-
return { ok: true, message: `configured context7,
|
|
1536
|
+
return { ok: true, message: `configured context7, codegraph, playwright MCP in ${filePath}` };
|
|
1570
1537
|
}
|
|
1571
1538
|
|
|
1572
1539
|
function setupMcpServers() {
|