@mrtrinhvn/ag-kit 1.0.0 β 1.0.2
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
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Antigravity Kit Core (`@mrtrinhvn/ag-kit`) π
|
|
2
|
+
|
|
3
|
+
A generic, institutional-grade AI programming framework for automating scaffolding, architecture, and coding directly inside your software projects. Inspired by the principles of `.agent` systems, carefully stripped of domain-specific constraints to adapt to any software development lifecycle.
|
|
4
|
+
|
|
5
|
+
## π¦ Quick Install
|
|
6
|
+
|
|
7
|
+
The best way to initialize the AG-Kit in a new project is using `npx`:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @mrtrinhvn/ag-kit init
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## π Global Usage & Commands
|
|
14
|
+
|
|
15
|
+
You can also install it globally if you frequently create new projects:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g @mrtrinhvn/ag-kit
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Then use the provided CLI anywhere:
|
|
22
|
+
|
|
23
|
+
| Command | Description |
|
|
24
|
+
|---|---|
|
|
25
|
+
| `ag-kit init` | Scaffolds the `.agent` framework (Agents, Skills, Workflows) into your current directory. |
|
|
26
|
+
| `ag-kit update` | Pulls the latest rules and templates and safely overwrites the core `.agent` folders without breaking your custom `knowledge/` base. |
|
|
27
|
+
| `ag-kit status` | Checks exactly which version of the AG-Kit is active in your current working directory. |
|
|
28
|
+
|
|
29
|
+
## π§ What's Inside the Brain?
|
|
30
|
+
|
|
31
|
+
Running `ag-kit init` injects the following core architecture into your project:
|
|
32
|
+
|
|
33
|
+
- **`GEMINI.md`**: The supreme constitution (Tier 0 Rules) ensuring the Agent always thinks systematically, acts safely, and never hallucinates code.
|
|
34
|
+
- **`agents/`**: Core personas taking specialized roles (e.g., `orchestrator`, `frontend-specialist`, `backend-specialist`, `debugger`).
|
|
35
|
+
- **`skills/`**: Tactical operational algorithms spanning from `clean-code` and `tdd-workflow` to `python-patterns` and `nextjs-react-expert`.
|
|
36
|
+
- **`workflows/`**: Pre-defined step-by-step instructions (slash commands) like `/create`, `/plan`, `/brainstorm`, and `/debug`.
|
|
37
|
+
- **`scripts/`**: CI/CD automation checkers like `lint_runner.py` and `security_scan.py`.
|
|
38
|
+
|
|
39
|
+
## βοΈ How It Works
|
|
40
|
+
The AG-Kit is designed to be injected into an AI IDE or a custom Agent workspace.
|
|
41
|
+
1. The AI reads `GEMINI.md` first.
|
|
42
|
+
2. It assumes the persona of the relevant specialist in `agents/`.
|
|
43
|
+
3. It selectively loads specific techniques from `skills/` based on context.
|
|
44
|
+
4. It continuously documents important technical learnings in `knowledge/`.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
*Built with β€οΈ to enforce Institutional-Grade Software Standards.*
|
package/package.json
CHANGED
|
@@ -52,3 +52,15 @@ When modifying a feature or fixing a bug, ask yourself:
|
|
|
52
52
|
2. What UI component relies on this data?
|
|
53
53
|
3. **Does this change make the current Knowledge Base outdated?**
|
|
54
54
|
- If YES, you **MUST** pause and update the relevant `.md` files in `.agent/knowledge/` right then and there. A working codebase with an outdated AI brain is a broken project.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## 3. πΊοΈ HIERARCHICAL CONTEXT ROUTING (Local Memory)
|
|
59
|
+
|
|
60
|
+
**PRINCIPLE:** Context should be scoped locally to reduce token bloat and prevent the AI from hallucinating across unrelated domains. Do not stuff all documentation into a monolithic global file.
|
|
61
|
+
|
|
62
|
+
### Sub-Directory Contexts
|
|
63
|
+
When working within a specific module (e.g., `backend/app/services/` or `frontend/src/components/`), you should:
|
|
64
|
+
1. **Check for Local Context:** Look for a `CONTEXT.md` or `README.md` file *within that specific directory* before starting work.
|
|
65
|
+
2. **Context Routing:** Leave pointers in central documentation (like `.agent/knowledge/architecture.md`) that route the AI to these deep local files. (e.g., `-> For trading engine logic, see backend/app/services/CONTEXT.md`).
|
|
66
|
+
3. **Local Updates:** When making fundamental changes to a localized component, create or update its local `CONTEXT.md` instead of polluting the global knowledge base. Keep local context files under 100 lines.
|
|
@@ -100,6 +100,16 @@ grep -r "errorPattern" --include="*.ts"
|
|
|
100
100
|
pm2 logs app-name --err --lines 100
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
+
## π‘οΈ Tool Use Guardian (Execution Protection)
|
|
104
|
+
|
|
105
|
+
When executing long chains of tool calls (especially when searching, indexing, or scraping), you MUST act as a Guardian of the execution:
|
|
106
|
+
1. **Pre-Call Validation:** Validate file paths and parameters before executing. Don't guess or hallucinate paths.
|
|
107
|
+
2. **Failure Recovery:** If a tool fails (Timeout, Rate Limit, Truncated JSON), **DO NOT panic and restart from scratch**.
|
|
108
|
+
- *Truncated:* Use `view_file` with line ranges to fetch the rest.
|
|
109
|
+
- *Timeout:* Simplify the bash command or narrow the `grep_search` scope.
|
|
110
|
+
- *Error-as-200:* Always check tool output for disguised `{"error": ...}` messages before assuming success.
|
|
111
|
+
3. **Checkpoints:** Maintain logical mental checkpoints. If Step 5 of a 10-step process fails, resume exactly at Step 5.
|
|
112
|
+
|
|
103
113
|
## Anti-Patterns
|
|
104
114
|
|
|
105
115
|
β **Random changes** - "Maybe if I change this..."
|