thachvd-kit 1.0.10 → 1.0.11
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/README.md +3 -2
- package/bin/cli.js +53 -7
- package/kit/README.md +9 -8
- package/package.json +1 -1
- package/rules/GEMINI.md +5 -5
- package/scripts/init.py +65 -16
package/README.md
CHANGED
|
@@ -40,6 +40,7 @@ Generated files:
|
|
|
40
40
|
- `.agent/workflows`
|
|
41
41
|
- `PROJECT_CONTEXT.md`
|
|
42
42
|
- `CLAUDE.md`
|
|
43
|
+
- `AGENTS.md`
|
|
43
44
|
- `AI_CONTEXT_REFINEMENT.md` when first-session AI refinement is enabled
|
|
44
45
|
|
|
45
46
|
## Scan Behavior
|
|
@@ -73,7 +74,7 @@ If you enable first-session AI refinement, the generated context is marked with:
|
|
|
73
74
|
- `context.status: baseline`
|
|
74
75
|
- `context.needs_ai_refinement: true`
|
|
75
76
|
|
|
76
|
-
Then, when your agent opens the project, `GEMINI.md` / `CLAUDE.md` instruct it to:
|
|
77
|
+
Then, when your agent opens the project, `GEMINI.md` / `CLAUDE.md` / `AGENTS.md` instruct it to:
|
|
77
78
|
|
|
78
79
|
1. Read `PROJECT_CONTEXT.md`
|
|
79
80
|
2. Refine the context once if `needs_ai_refinement` is `true`
|
|
@@ -107,5 +108,5 @@ Generic quality skills such as `clean-code` and `systematic-debugging` are alway
|
|
|
107
108
|
|
|
108
109
|
## Notes
|
|
109
110
|
|
|
110
|
-
- `thachvd-kit`
|
|
111
|
+
- `thachvd-kit` generates both `CLAUDE.md` for Claude Code and `AGENTS.md` for Codex/AGENTS-compatible editors.
|
|
111
112
|
- The npm package page updates only after a new `npm publish`, not just after pushing to GitHub.
|
package/bin/cli.js
CHANGED
|
@@ -953,11 +953,11 @@ ${autoSkillsList}
|
|
|
953
953
|
function generateClaudeMd(data) {
|
|
954
954
|
return `# CLAUDE.md — ${data.project_name}
|
|
955
955
|
# Generated by thachvd-kit. See PROJECT_CONTEXT.md for full stack info.
|
|
956
|
-
#
|
|
957
|
-
|
|
958
|
-
## Project
|
|
959
|
-
${data.description}
|
|
960
|
-
Stack: ${data.primary_language} | ${(data.frameworks || []).join(', ')}
|
|
956
|
+
# Platform: Claude Code
|
|
957
|
+
|
|
958
|
+
## Project
|
|
959
|
+
${data.description}
|
|
960
|
+
Stack: ${data.primary_language} | ${(data.frameworks || []).join(', ')}
|
|
961
961
|
|
|
962
962
|
## Rules
|
|
963
963
|
- Read PROJECT_CONTEXT.md first for stack details and agent routing.
|
|
@@ -977,11 +977,52 @@ Stack: ${data.primary_language} | ${(data.frameworks || []).join(', ')}
|
|
|
977
977
|
- \`/debug\` — Systematic debugging
|
|
978
978
|
- \`/test\` — Run test suite
|
|
979
979
|
- \`/deploy\` — Deploy checklist
|
|
980
|
-
|
|
980
|
+
|
|
981
981
|
See PROJECT_CONTEXT.md for full agent routing table.
|
|
982
982
|
`;
|
|
983
983
|
}
|
|
984
984
|
|
|
985
|
+
function generateAgentsMd(data) {
|
|
986
|
+
return `# AGENTS.md — ${data.project_name}
|
|
987
|
+
# Generated by thachvd-kit. See PROJECT_CONTEXT.md for full stack info.
|
|
988
|
+
# Platform: Codex / AGENTS-compatible editors
|
|
989
|
+
|
|
990
|
+
## Project
|
|
991
|
+
${data.description}
|
|
992
|
+
Stack: ${data.primary_language} | ${(data.frameworks || []).join(', ') || 'no framework'}
|
|
993
|
+
|
|
994
|
+
## Mandatory First Action
|
|
995
|
+
- Read \`PROJECT_CONTEXT.md\` before making plans or code changes.
|
|
996
|
+
- If \`PROJECT_CONTEXT.md\` is missing or stale, create/update it before major work.
|
|
997
|
+
- If \`context.needs_ai_refinement: true\`, refine \`PROJECT_CONTEXT.md\` first, then set:
|
|
998
|
+
- \`context.status: refined\`
|
|
999
|
+
- \`context.needs_ai_refinement: false\`
|
|
1000
|
+
- \`context.last_refined_at: <today>\`
|
|
1001
|
+
|
|
1002
|
+
## Working Rules
|
|
1003
|
+
- Use \`.agent/agents\`, \`.agent/skills\`, \`.agent/rules\`, and \`.agent/workflows\` as the local project kit.
|
|
1004
|
+
- Match the task against the Agent Routing table in \`PROJECT_CONTEXT.md\`.
|
|
1005
|
+
- Load relevant skills before editing code.
|
|
1006
|
+
- Tests are mandatory. Verify before claiming done.
|
|
1007
|
+
- Keep files under ${data.max_file_lines || '300'} lines when practical, then split into modules.
|
|
1008
|
+
- Update dependent files together when a change crosses boundaries.
|
|
1009
|
+
|
|
1010
|
+
## Preferred Workflow
|
|
1011
|
+
- Plan work from \`PROJECT_CONTEXT.md\` first.
|
|
1012
|
+
- For feature work, use: \`plan-writing\` -> \`executing-plans\` -> \`verification-before-completion\`.
|
|
1013
|
+
- For reviews, use: \`requesting-code-review\` / \`receiving-code-review\`.
|
|
1014
|
+
- For debugging, use: \`systematic-debugging\`.
|
|
1015
|
+
|
|
1016
|
+
## Key Paths
|
|
1017
|
+
- Project context: \`PROJECT_CONTEXT.md\`
|
|
1018
|
+
- Agent kit: \`.agent/\`
|
|
1019
|
+
- Skills: \`.agent/skills/\`
|
|
1020
|
+
- Workflows: \`.agent/workflows/\`
|
|
1021
|
+
|
|
1022
|
+
See \`PROJECT_CONTEXT.md\` for stack details, routing, and auto-resolved skills.
|
|
1023
|
+
`;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
985
1026
|
function generateAiContextRefinementPrompt(data) {
|
|
986
1027
|
const evidence = (data.scan_evidence || []).length > 0
|
|
987
1028
|
? (data.scan_evidence || []).map(line => `- ${line}`).join('\n')
|
|
@@ -1272,6 +1313,10 @@ async function main() {
|
|
|
1272
1313
|
fs.writeFileSync(claudeMdPath, generateClaudeMd(data), 'utf8');
|
|
1273
1314
|
console.log(` ${pc.green('✓')} Generated ${pc.bold('CLAUDE.md')}`);
|
|
1274
1315
|
|
|
1316
|
+
const agentsMdPath = path.join(targetDir, 'AGENTS.md');
|
|
1317
|
+
fs.writeFileSync(agentsMdPath, generateAgentsMd(data), 'utf8');
|
|
1318
|
+
console.log(` ${pc.green('✓')} Generated ${pc.bold('AGENTS.md')}`);
|
|
1319
|
+
|
|
1275
1320
|
let aiRefinementPath = null;
|
|
1276
1321
|
if (requestAiRefinement) {
|
|
1277
1322
|
aiRefinementPath = path.join(targetDir, 'AI_CONTEXT_REFINEMENT.md');
|
|
@@ -1293,13 +1338,14 @@ ${autoSkills.map(s => ' · ' + s).join('\n')}
|
|
|
1293
1338
|
${pc.bold('Generated files:')}
|
|
1294
1339
|
· ${pc.bold(projectContextPath)}
|
|
1295
1340
|
· ${pc.bold(claudeMdPath)}
|
|
1341
|
+
· ${pc.bold(agentsMdPath)}
|
|
1296
1342
|
${aiRefinementPath ? ` · ${pc.bold(aiRefinementPath)}` : ''}
|
|
1297
1343
|
|
|
1298
1344
|
${pc.bold('Next steps:')}
|
|
1299
1345
|
1. Your kit is installed in ${pc.bold('./.agent')}
|
|
1300
1346
|
2. Review ${pc.bold('PROJECT_CONTEXT.md')} first and add architecture notes
|
|
1301
1347
|
3. ${aiRefinementPath ? `Open ${pc.bold('AI_CONTEXT_REFINEMENT.md')} in your AI editor to refine project context` : `Instruct the agent to read/update ${pc.bold('PROJECT_CONTEXT.md')} before major tasks`}
|
|
1302
|
-
4. Open project in
|
|
1348
|
+
4. Open project in Claude Code or Codex — the agent will read context on start
|
|
1303
1349
|
`);
|
|
1304
1350
|
}
|
|
1305
1351
|
|
package/kit/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# 🛡️
|
|
2
|
-
|
|
3
|
-
This toolkit helps you build high-quality, modular, and performance-optimized applications by leveraging
|
|
1
|
+
# 🛡️ Cross-Platform Project Kit
|
|
2
|
+
|
|
3
|
+
This toolkit helps you build high-quality, modular, and performance-optimized applications by leveraging AI agents with a context-first approach across Antigravity, Claude Code, and Codex-compatible editors.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -11,10 +11,11 @@ This toolkit helps you build high-quality, modular, and performance-optimized ap
|
|
|
11
11
|
- Update project metadata (e.g., `package.json`).
|
|
12
12
|
- Rename and fill out `PROJECT_CONTEXT.template.md` as `PROJECT_CONTEXT.md` in the root directory.
|
|
13
13
|
|
|
14
|
-
### 2. Working with AI Agents
|
|
15
|
-
- Always use the templates provided in `kit/PROMPT_RECIPE.md`.
|
|
16
|
-
- Ensure the Agent reads and updates `PROJECT_CONTEXT.md`.
|
|
17
|
-
-
|
|
14
|
+
### 2. Working with AI Agents
|
|
15
|
+
- Always use the templates provided in `kit/PROMPT_RECIPE.md`.
|
|
16
|
+
- Ensure the Agent reads and updates `PROJECT_CONTEXT.md`.
|
|
17
|
+
- Use `CLAUDE.md` for Claude Code and `AGENTS.md` for Codex when generating project-specific entry files.
|
|
18
|
+
- Enforce file splitting rules (e.g., Max 250 lines) to maintain a clean codebase.
|
|
18
19
|
|
|
19
20
|
### 3. Proposed Structure
|
|
20
21
|
- `.agent/rules/GEMINI.md`: Core behavioral rules and protocols.
|
|
@@ -29,4 +30,4 @@ This toolkit helps you build high-quality, modular, and performance-optimized ap
|
|
|
29
30
|
|
|
30
31
|
---
|
|
31
32
|
|
|
32
|
-
*Powered by
|
|
33
|
+
*Powered by thachvd-kit.*
|
package/package.json
CHANGED
package/rules/GEMINI.md
CHANGED
|
@@ -21,7 +21,7 @@ trigger: always_on
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
> All routing decisions below depend on PROJECT_CONTEXT.md.
|
|
24
|
-
> Without it, ask user to run: `
|
|
24
|
+
> Without it, ask user to run: `thachvd-kit init`
|
|
25
25
|
> Baseline context must be refined once when `context.needs_ai_refinement = true`.
|
|
26
26
|
|
|
27
27
|
---
|
|
@@ -203,7 +203,7 @@ scripts/ → scripts/init.py, checklist.py, verify_all.py
|
|
|
203
203
|
| Platform | Rules File | Skills Dir | Workflows |
|
|
204
204
|
|----------|-----------|-----------|-----------|
|
|
205
205
|
| **Antigravity** | `rules/GEMINI.md` (this file) | `skills/` | `workflows/` |
|
|
206
|
-
| **Claude Code** | `CLAUDE.md` at project root | `.
|
|
207
|
-
| **Codex / OpenCode** | `
|
|
208
|
-
|
|
209
|
-
> Run `
|
|
206
|
+
| **Claude Code** | `CLAUDE.md` at project root | `.agent/skills/` | `.agent/workflows/` |
|
|
207
|
+
| **Codex / OpenCode** | `AGENTS.md` at project root | `.agent/skills/` | `.agent/workflows/` |
|
|
208
|
+
|
|
209
|
+
> Run `thachvd-kit init` to generate project context and platform entry files automatically.
|
package/scripts/init.py
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
thachvd-kit — Project Init Wizard
|
|
4
4
|
Generates PROJECT_CONTEXT.md and optional platform config files.
|
|
5
5
|
|
|
6
|
-
Usage:
|
|
7
|
-
python scripts/init.py # Interactive wizard
|
|
8
|
-
python scripts/init.py --platform all # Also generate CLAUDE.md
|
|
9
|
-
python scripts/init.py --platform claude # Only CLAUDE.md
|
|
6
|
+
Usage:
|
|
7
|
+
python scripts/init.py # Interactive wizard
|
|
8
|
+
python scripts/init.py --platform all # Also generate CLAUDE.md + AGENTS.md
|
|
9
|
+
python scripts/init.py --platform claude # Only CLAUDE.md
|
|
10
|
+
python scripts/init.py --platform codex # Only AGENTS.md
|
|
10
11
|
"""
|
|
11
12
|
|
|
12
13
|
import sys
|
|
@@ -695,14 +696,14 @@ Based on your stack, these skills will be loaded automatically:
|
|
|
695
696
|
"""
|
|
696
697
|
|
|
697
698
|
def generate_claude_md(data):
|
|
698
|
-
"""Generate CLAUDE.md for Claude Code
|
|
699
|
-
return f"""# CLAUDE.md — {data['project_name']}
|
|
700
|
-
# Generated by thachvd-kit. See PROJECT_CONTEXT.md for full stack info.
|
|
701
|
-
#
|
|
702
|
-
|
|
703
|
-
## Project
|
|
704
|
-
{data['description']}
|
|
705
|
-
Stack: {data['primary_language']} | {', '.join(data.get('frameworks', []))}
|
|
699
|
+
"""Generate CLAUDE.md for Claude Code."""
|
|
700
|
+
return f"""# CLAUDE.md — {data['project_name']}
|
|
701
|
+
# Generated by thachvd-kit. See PROJECT_CONTEXT.md for full stack info.
|
|
702
|
+
# Platform: Claude Code
|
|
703
|
+
|
|
704
|
+
## Project
|
|
705
|
+
{data['description']}
|
|
706
|
+
Stack: {data['primary_language']} | {', '.join(data.get('frameworks', []))}
|
|
706
707
|
|
|
707
708
|
## Rules
|
|
708
709
|
- Read PROJECT_CONTEXT.md first for stack details and agent routing.
|
|
@@ -726,6 +727,47 @@ Stack: {data['primary_language']} | {', '.join(data.get('frameworks', []))}
|
|
|
726
727
|
See PROJECT_CONTEXT.md for full agent routing table.
|
|
727
728
|
"""
|
|
728
729
|
|
|
730
|
+
def generate_agents_md(data):
|
|
731
|
+
"""Generate AGENTS.md for Codex and AGENTS-compatible editors."""
|
|
732
|
+
return f"""# AGENTS.md — {data['project_name']}
|
|
733
|
+
# Generated by thachvd-kit. See PROJECT_CONTEXT.md for full stack info.
|
|
734
|
+
# Platform: Codex / AGENTS-compatible editors
|
|
735
|
+
|
|
736
|
+
## Project
|
|
737
|
+
{data['description']}
|
|
738
|
+
Stack: {data['primary_language']} | {', '.join(data.get('frameworks', [])) or 'no framework'}
|
|
739
|
+
|
|
740
|
+
## Mandatory First Action
|
|
741
|
+
- Read `PROJECT_CONTEXT.md` before making plans or code changes.
|
|
742
|
+
- If `PROJECT_CONTEXT.md` is missing or stale, create/update it before major work.
|
|
743
|
+
- If `context.needs_ai_refinement: true`, refine `PROJECT_CONTEXT.md` first, then set:
|
|
744
|
+
- `context.status: refined`
|
|
745
|
+
- `context.needs_ai_refinement: false`
|
|
746
|
+
- `context.last_refined_at: <today>`
|
|
747
|
+
|
|
748
|
+
## Working Rules
|
|
749
|
+
- Use `.agent/agents`, `.agent/skills`, `.agent/rules`, and `.agent/workflows` as the local project kit.
|
|
750
|
+
- Match the task against the Agent Routing table in `PROJECT_CONTEXT.md`.
|
|
751
|
+
- Load relevant skills before editing code.
|
|
752
|
+
- Tests are mandatory. Verify before claiming done.
|
|
753
|
+
- Keep files under {data.get('max_file_lines', '300')} lines when practical, then split into modules.
|
|
754
|
+
- Update dependent files together when a change crosses boundaries.
|
|
755
|
+
|
|
756
|
+
## Preferred Workflow
|
|
757
|
+
- Plan work from `PROJECT_CONTEXT.md` first.
|
|
758
|
+
- For feature work, use: `plan-writing` -> `executing-plans` -> `verification-before-completion`.
|
|
759
|
+
- For reviews, use: `requesting-code-review` / `receiving-code-review`.
|
|
760
|
+
- For debugging, use: `systematic-debugging`.
|
|
761
|
+
|
|
762
|
+
## Key Paths
|
|
763
|
+
- Project context: `PROJECT_CONTEXT.md`
|
|
764
|
+
- Agent kit: `.agent/`
|
|
765
|
+
- Skills: `.agent/skills/`
|
|
766
|
+
- Workflows: `.agent/workflows/`
|
|
767
|
+
|
|
768
|
+
See `PROJECT_CONTEXT.md` for stack details, routing, and auto-resolved skills.
|
|
769
|
+
"""
|
|
770
|
+
|
|
729
771
|
def generate_ai_context_refinement_prompt(data):
|
|
730
772
|
scan_evidence = data.get("scan_evidence", [])
|
|
731
773
|
evidence_block = "\n".join("- " + line for line in scan_evidence) if scan_evidence else "- No scan evidence was captured during init."
|
|
@@ -805,7 +847,7 @@ def format_scan_preview_lines(scanned):
|
|
|
805
847
|
|
|
806
848
|
def main():
|
|
807
849
|
parser = argparse.ArgumentParser(description="thachvd-kit project init wizard")
|
|
808
|
-
parser.add_argument("--platform", choices=["antigravity", "claude", "all"], default="antigravity",
|
|
850
|
+
parser.add_argument("--platform", choices=["antigravity", "claude", "codex", "all"], default="antigravity",
|
|
809
851
|
help="Which platform config to generate (default: antigravity)")
|
|
810
852
|
parser.add_argument("--yes", "-y", action="store_true", help="Use defaults without prompting")
|
|
811
853
|
parser.add_argument("--scan", action="store_true", help="Scan the current project to prefill or auto-generate PROJECT_CONTEXT.md")
|
|
@@ -956,11 +998,17 @@ def main():
|
|
|
956
998
|
output_path.write_text(context_content, encoding="utf-8")
|
|
957
999
|
print(f" {green('✓')} {bold('PROJECT_CONTEXT.md')} generated")
|
|
958
1000
|
|
|
959
|
-
# CLAUDE.md (for Claude Code
|
|
1001
|
+
# CLAUDE.md (for Claude Code)
|
|
960
1002
|
if args.platform in ("claude", "all"):
|
|
961
1003
|
claude_path = Path("CLAUDE.md")
|
|
962
1004
|
claude_path.write_text(generate_claude_md(data), encoding="utf-8")
|
|
963
|
-
print(f" {green('✓')} {bold('CLAUDE.md')} generated (Claude Code
|
|
1005
|
+
print(f" {green('✓')} {bold('CLAUDE.md')} generated (Claude Code)")
|
|
1006
|
+
|
|
1007
|
+
# AGENTS.md (for Codex / AGENTS-compatible editors)
|
|
1008
|
+
if args.platform in ("codex", "all"):
|
|
1009
|
+
agents_path = Path("AGENTS.md")
|
|
1010
|
+
agents_path.write_text(generate_agents_md(data), encoding="utf-8")
|
|
1011
|
+
print(f" {green('✓')} {bold('AGENTS.md')} generated (Codex)")
|
|
964
1012
|
|
|
965
1013
|
ai_refine_path = None
|
|
966
1014
|
if data.get("needs_ai_refinement"):
|
|
@@ -983,6 +1031,7 @@ def main():
|
|
|
983
1031
|
{bold('Generated files:')}
|
|
984
1032
|
· {bold(str(output_path.resolve()))}
|
|
985
1033
|
· {bold(str(Path("CLAUDE.md").resolve())) if args.platform in ("claude", "all") else 'CLAUDE.md not generated for this platform'}
|
|
1034
|
+
· {bold(str(Path("AGENTS.md").resolve())) if args.platform in ("codex", "all") else 'AGENTS.md not generated for this platform'}
|
|
986
1035
|
· {bold(str(ai_refine_path.resolve())) if ai_refine_path else 'AI_CONTEXT_REFINEMENT.md not generated'}
|
|
987
1036
|
|
|
988
1037
|
{bold('Next steps:')}
|
|
@@ -991,7 +1040,7 @@ def main():
|
|
|
991
1040
|
3. Open project in your AI editor (Antigravity / Claude Code / Codex)
|
|
992
1041
|
4. The agent will read PROJECT_CONTEXT.md on session start
|
|
993
1042
|
|
|
994
|
-
{dim(' Tip: Run with --platform all to also generate CLAUDE.md')}
|
|
1043
|
+
{dim(' Tip: Run with --platform all to also generate CLAUDE.md and AGENTS.md')}
|
|
995
1044
|
""")
|
|
996
1045
|
|
|
997
1046
|
if __name__ == "__main__":
|