@ngocsangairvds/gc-kit 1.0.1 → 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 +203 -5
- package/package.json +2 -2
- package/src/lib/copyDir.js +11 -0
- package/templates/.github/agents/DocumentApiWriter.agent.md +1 -1
- package/templates/.github/agents/JavaDev.agent.md +4 -3
- package/templates/.github/agents/TesterAPI.agent.md +3 -3
- package/templates/.github/agents/agents-skills/dev/rule-base.md +11 -10
- package/templates/.github/agents/agents-skills/test/API_Testing_Rules.md +0 -1
- package/templates/.github/prompts/create-knowledge.prompt.md +17 -17
- /package/templates/.github/agents/{agents-skills/dev/knowledge/template → template}/guidelines-template.md +0 -0
- /package/templates/.github/agents/{agents-skills/dev/knowledge/template → template}/product-template.md +0 -0
- /package/templates/.github/agents/{agents-skills/dev/knowledge/template → template}/structure-template.md +0 -0
- /package/templates/.github/agents/{agents-skills/dev/knowledge/template → template}/tech-template.md +0 -0
package/README.md
CHANGED
|
@@ -1,11 +1,45 @@
|
|
|
1
1
|
# gc-kit
|
|
2
2
|
|
|
3
|
-
A tiny CLI that copies a shared `.github/` folder into the current repository.
|
|
3
|
+
A tiny CLI that copies a shared `.github/` folder into the current repository, providing a complete AI-assisted development workflow with specialized agents for Java/Spring Boot projects.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Install into your project
|
|
9
|
+
cd your-project
|
|
10
|
+
npx @ngocsangairvds/gc-kit init
|
|
11
|
+
|
|
12
|
+
# Generate knowledge base
|
|
13
|
+
@create-knowledge
|
|
14
|
+
|
|
15
|
+
# Start developing
|
|
16
|
+
@JavaDev <your task>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## What is gc-kit?
|
|
20
|
+
|
|
21
|
+
gc-kit provides a structured workflow for AI-assisted development with 3 specialized agents:
|
|
22
|
+
|
|
23
|
+
1. **DocumentApiWriter** - Design API specifications first
|
|
24
|
+
2. **JavaDev** - Implement features based on specs and project standards
|
|
25
|
+
3. **TesterAPI** - Generate and execute comprehensive tests
|
|
26
|
+
|
|
27
|
+
### The Workflow
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
Design (@DocumentApiWriter) → Develop (@JavaDev) → Test (@TesterAPI)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Key Concept**: Development reads from 2 knowledge sources:
|
|
34
|
+
- **`@project`** - Project-wide standards (HOW to build)
|
|
35
|
+
- Coding conventions, architecture, tech stack, existing features
|
|
36
|
+
- **`@documents`** - Business requirements (WHAT to build)
|
|
37
|
+
- API specs, validation rules, error codes, business logic
|
|
4
38
|
|
|
5
39
|
## Usage
|
|
6
40
|
|
|
7
41
|
```bash
|
|
8
|
-
npx gc-kit init
|
|
42
|
+
npx @ngocsangairvds/gc-kit init
|
|
9
43
|
```
|
|
10
44
|
|
|
11
45
|
### Options
|
|
@@ -15,14 +49,178 @@ npx gc-kit init
|
|
|
15
49
|
- `--source <path>` copy from a custom `.github/` directory instead of the packaged template
|
|
16
50
|
- `--target <path>` copy into a different repo root (defaults to current directory)
|
|
17
51
|
|
|
52
|
+
**Note**: The `init` command copies `agents/` and `prompts/` folders, and creates empty `knowledge/` structure (project/, documents/, test-case/) without overwriting your existing knowledge files.
|
|
53
|
+
|
|
18
54
|
Examples:
|
|
19
55
|
|
|
20
56
|
```bash
|
|
21
|
-
npx gc-kit init --dry-run
|
|
22
|
-
npx gc-kit init --force
|
|
23
|
-
npx gc-kit init --target /tmp/my-repo
|
|
57
|
+
npx @ngocsangairvds/gc-kit init --dry-run
|
|
58
|
+
npx @ngocsangairvds/gc-kit init --force
|
|
59
|
+
npx @ngocsangairvds/gc-kit init --target /tmp/my-repo
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## What's Included
|
|
63
|
+
|
|
64
|
+
This package includes a complete `.github/` folder structure with:
|
|
65
|
+
|
|
66
|
+
### Agents
|
|
67
|
+
- **JavaDev** - Java/Spring Boot development agent
|
|
68
|
+
- **DocumentApiWriter** - API documentation specialist
|
|
69
|
+
- **TesterAPI** - API testing agent
|
|
70
|
+
|
|
71
|
+
### Skills & Rules
|
|
72
|
+
- **Development Rules**: Debugging, feature development, Java best practices
|
|
73
|
+
- **Documentation Rules**: API documentation templates and guidelines
|
|
74
|
+
- **Testing Rules**: API testing strategies and test case templates
|
|
75
|
+
|
|
76
|
+
### Knowledge Templates
|
|
77
|
+
- `guidelines-template.md` - Code quality and conventions
|
|
78
|
+
- `product-template.md` - Product overview and features
|
|
79
|
+
- `structure-template.md` - Architecture and directory structure
|
|
80
|
+
- `tech-template.md` - Technologies and build commands
|
|
81
|
+
|
|
82
|
+
### Prompts
|
|
83
|
+
- `create-knowledge.prompt.md` - Generate knowledge files from templates
|
|
84
|
+
|
|
85
|
+
## How It Works
|
|
86
|
+
|
|
87
|
+
### 1. Initial Setup
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npx @ngocsangairvds/gc-kit init
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
This creates the `.github/` structure in your project:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
.github/
|
|
97
|
+
├── agents/ # Agent definitions and skills
|
|
98
|
+
├── knowledge/
|
|
99
|
+
│ ├── project/ # Project-wide knowledge (@project)
|
|
100
|
+
│ ├── documents/ # API specs & requirements (@documents)
|
|
101
|
+
│ └── test-case/ # Test cases
|
|
102
|
+
└── prompts/ # Reusable prompts
|
|
24
103
|
```
|
|
25
104
|
|
|
105
|
+
### 2. Generate Knowledge Base
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
@create-knowledge
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Generates 4 knowledge files in `.github/knowledge/project/`:
|
|
112
|
+
- `guidelines.md` - Coding conventions from your codebase
|
|
113
|
+
- `structure.md` - Architecture and directory structure
|
|
114
|
+
- `tech.md` - Technologies, dependencies, build commands
|
|
115
|
+
- `product.md` - Product features and business context
|
|
116
|
+
|
|
117
|
+
### 3. Development Workflow
|
|
118
|
+
|
|
119
|
+
#### Phase 0: Design API
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
@DocumentApiWriter design user registration API with email validation
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Output**: `.github/knowledge/documents/api-user-registration-v1.md`
|
|
126
|
+
- Endpoint specifications
|
|
127
|
+
- Request/response schemas
|
|
128
|
+
- Validation rules
|
|
129
|
+
- Error codes
|
|
130
|
+
|
|
131
|
+
#### Phase 1: Implement Feature
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
@JavaDev implement user registration API based on the documentation
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**JavaDev reads**:
|
|
138
|
+
- **From `@project`**: Coding standards, architecture, tech stack
|
|
139
|
+
- **From `@documents`**: API spec for user registration
|
|
140
|
+
|
|
141
|
+
**JavaDev does**:
|
|
142
|
+
1. Search for similar features in codebase
|
|
143
|
+
2. Reuse existing validation/patterns
|
|
144
|
+
3. Implement according to spec
|
|
145
|
+
4. Follow project conventions
|
|
146
|
+
5. Run tests
|
|
147
|
+
6. Update knowledge if needed
|
|
148
|
+
|
|
149
|
+
#### Phase 2: Test
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
@TesterAPI generate test cases for user registration API
|
|
153
|
+
@TesterAPI execute test cases for user registration
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
**Output**: Test cases in `.github/knowledge/test-case/tc-user-registration.md`
|
|
157
|
+
- Happy path, negative, boundary, security tests
|
|
158
|
+
- Execution results with PASS/FAIL
|
|
159
|
+
- Inconsistencies between doc and implementation
|
|
160
|
+
|
|
161
|
+
## Key Features
|
|
162
|
+
|
|
163
|
+
### 📚 Dual Knowledge System
|
|
164
|
+
|
|
165
|
+
**`@project`** (Always read):
|
|
166
|
+
- HOW to build: standards, architecture, tech
|
|
167
|
+
- Updated when project-wide changes occur
|
|
168
|
+
|
|
169
|
+
**`@documents`** (Feature-specific):
|
|
170
|
+
- WHAT to build: API specs, business requirements
|
|
171
|
+
- Updated when new features are added
|
|
172
|
+
|
|
173
|
+
### 🤖 Smart Development
|
|
174
|
+
|
|
175
|
+
- **Read before write**: Always reads project knowledge first
|
|
176
|
+
- **Reuse before create**: Searches for similar code
|
|
177
|
+
- **Spec-driven**: Implements according to API documentation
|
|
178
|
+
- **Auto-update**: Updates knowledge after changes
|
|
179
|
+
|
|
180
|
+
### ✅ Quality Assurance
|
|
181
|
+
|
|
182
|
+
- Design-first approach prevents misalignment
|
|
183
|
+
- Comprehensive test coverage (happy/negative/boundary/security)
|
|
184
|
+
- Automated test execution with curl
|
|
185
|
+
- Reports inconsistencies between docs and implementation
|
|
186
|
+
|
|
187
|
+
## Example: Complete Feature
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# 1. Setup (one-time)
|
|
191
|
+
npx @ngocsangairvds/gc-kit init
|
|
192
|
+
@create-knowledge
|
|
193
|
+
|
|
194
|
+
# 2. Design API
|
|
195
|
+
@DocumentApiWriter design user registration API
|
|
196
|
+
# Creates: .github/knowledge/documents/api-user-registration-v1.md
|
|
197
|
+
|
|
198
|
+
# 3. Implement
|
|
199
|
+
@JavaDev implement user registration based on documentation
|
|
200
|
+
# Reads: @project (standards) + @documents (spec)
|
|
201
|
+
# Creates: Controller, Service, Repository
|
|
202
|
+
# Updates: @project/product.md (new feature)
|
|
203
|
+
|
|
204
|
+
# 4. Test
|
|
205
|
+
@TesterAPI generate test cases for user registration
|
|
206
|
+
@TesterAPI execute test cases
|
|
207
|
+
# Creates: .github/knowledge/test-case/tc-user-registration.md
|
|
208
|
+
# Reports: PASS/FAIL with actual vs expected
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## Why gc-kit?
|
|
212
|
+
|
|
213
|
+
✅ **Consistent**: All code follows project standards
|
|
214
|
+
✅ **Documented**: API specs created before implementation
|
|
215
|
+
✅ **Tested**: Comprehensive test coverage
|
|
216
|
+
✅ **Maintainable**: Knowledge base stays in sync with code
|
|
217
|
+
✅ **Reusable**: Agents search and reuse existing code
|
|
218
|
+
✅ **Traceable**: Clear flow from design → code → tests
|
|
219
|
+
|
|
220
|
+
## Documentation
|
|
221
|
+
|
|
222
|
+
For detailed workflow and advanced usage, see [WORKFLOW.md](./WORKFLOW.md).
|
|
223
|
+
|
|
26
224
|
## Development
|
|
27
225
|
|
|
28
226
|
From this repo:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngocsangairvds/gc-kit",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Refactor folder structure and add README.md for gc-kit",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Your Name <your.email@example.com>",
|
|
7
7
|
"repository": {
|
package/src/lib/copyDir.js
CHANGED
|
@@ -43,6 +43,17 @@ export async function copyDir({ sourceDir, targetDir, force, dryRun, onLog }) {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
if (st.isDirectory()) {
|
|
46
|
+
// Skip knowledge/ directory contents to preserve user's existing knowledge
|
|
47
|
+
if (rel === 'knowledge') {
|
|
48
|
+
onLog(`[dir] ${rel} (creating empty structure)`);
|
|
49
|
+
await ensureDir(dstPath);
|
|
50
|
+
// Create empty subdirectories
|
|
51
|
+
await ensureDir(path.join(dstPath, 'project'));
|
|
52
|
+
await ensureDir(path.join(dstPath, 'documents'));
|
|
53
|
+
await ensureDir(path.join(dstPath, 'test-case'));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
46
57
|
onLog(`[dir] ${rel}`);
|
|
47
58
|
await ensureDir(dstPath);
|
|
48
59
|
const children = await fs.readdir(srcPath);
|
|
@@ -26,7 +26,7 @@ If any of these files can’t be found, you must stop and re-check the repo stru
|
|
|
26
26
|
## Output location (mandatory)
|
|
27
27
|
|
|
28
28
|
- When you create or update API documentation, you MUST place the document as a Markdown file under:
|
|
29
|
-
- `#file:.github/
|
|
29
|
+
- `#file:.github/knowledge/documents/`
|
|
30
30
|
- If the `documents/` folder does not exist, create it.
|
|
31
31
|
- Use clear, kebab-case filenames (e.g., `api-<feature>-v1.md`).
|
|
32
32
|
|
|
@@ -10,9 +10,10 @@ You are a Java/Spring Boot programming agent working in this repository.
|
|
|
10
10
|
## Non-negotiable pre-flight (must happen BEFORE any code changes)
|
|
11
11
|
|
|
12
12
|
Before you modify, create, or delete **any** code/config file, you MUST:
|
|
13
|
-
1) Enumerate and read **all** markdown files under `.github/agents/agents-skills/dev/` (the `dev` folder), including `rule-base.md` and any other rule/prompt markdown files
|
|
14
|
-
2) Read
|
|
15
|
-
3)
|
|
13
|
+
1) Enumerate and read **all** markdown files under `.github/agents/agents-skills/dev/` (the `dev` folder), including `rule-base.md` and any other rule/prompt markdown files.
|
|
14
|
+
2) Read **all** markdown files under `.github/knowledge/project/` (skip anything inside `.github/agents/template`).
|
|
15
|
+
3) Read them **carefully and completely** — do not skip **any** part, even small sections such as notes, subheadings, examples, footnotes, or single bullet points.
|
|
16
|
+
4) Apply those rules when planning, editing, testing, and responding.
|
|
16
17
|
|
|
17
18
|
If you cannot find those files, you MUST stop and re-check the repo structure; do not proceed with edits until they are read.
|
|
18
19
|
|
|
@@ -11,7 +11,7 @@ You are a senior API tester agent for this repository.
|
|
|
11
11
|
|
|
12
12
|
Before you generate a test case document or run any API test, you MUST:
|
|
13
13
|
1) Read the relevant API documentation file(s) referenced by the user under:
|
|
14
|
-
- `#file:.github/
|
|
14
|
+
- `#file:.github/knowledge/documents/`
|
|
15
15
|
Read them carefully and completely; do not skip any section.
|
|
16
16
|
2) Read and follow the testing rules:
|
|
17
17
|
- `#file:.github/agents/agents-skills/test/API_Testing_Rules.md`
|
|
@@ -26,13 +26,13 @@ When asked to create test cases for an API:
|
|
|
26
26
|
- Generate the test case documentation in Markdown **based on** `API_TestCase_Template.md`.
|
|
27
27
|
- Ensure coverage includes (as applicable): happy path, negative, boundary, security, and basic compatibility checks (per `API_Testing_Rules.md`).
|
|
28
28
|
- Save the generated document under:
|
|
29
|
-
- `#file:.github/
|
|
29
|
+
- `#file:.github/knowledge/test-case/`
|
|
30
30
|
- Use clear, kebab-case filenames, e.g. `tc-<api-name>-<endpoint>.md`.
|
|
31
31
|
|
|
32
32
|
## API execution using curl (mandatory when user asks to test an endpoint)
|
|
33
33
|
|
|
34
34
|
When the user asks to test a specific API endpoint:
|
|
35
|
-
1) Locate the corresponding test-case document in `#file:.github/
|
|
35
|
+
1) Locate the corresponding test-case document in `#file:.github/knowledge/test-case/`.
|
|
36
36
|
2) Execute **all** test cases in that document using `curl` in the terminal.
|
|
37
37
|
- Include headers/auth exactly as specified.
|
|
38
38
|
- Capture HTTP status and response body.
|
|
@@ -4,20 +4,21 @@
|
|
|
4
4
|
- If the user only requests code changes/bug fixes/features and doesn’t mention documentation: **do not create any new `.md` files**.
|
|
5
5
|
|
|
6
6
|
## Rule 2 — Automatically update knowledge after code changes (when needed)
|
|
7
|
-
- After you **create or modify code** according to the user
|
|
8
|
-
- If needed, **automatically update the corresponding files** in `#file
|
|
9
|
-
- Architecture/folder/module changes → update
|
|
10
|
-
- Tech stack/dependencies/build/run/config changes → update
|
|
11
|
-
- Product behavior/features/API/business flows changes → update
|
|
12
|
-
- Dev conventions/coding standards/testing/release process changes → update
|
|
7
|
+
- After you **create or modify code** according to the user's request, **self-assess** whether the project documentation/knowledge needs to be updated.
|
|
8
|
+
- If needed, **automatically update the corresponding files** in `#file:.github/knowledge/project` (do not edit `.github/agents/template`), for example:
|
|
9
|
+
- Architecture/folder/module changes → update `.github/knowledge/project/structure.md`
|
|
10
|
+
- Tech stack/dependencies/build/run/config changes → update `.github/knowledge/project/tech.md`
|
|
11
|
+
- Product behavior/features/API/business flows changes → update `.github/knowledge/project/product.md`
|
|
12
|
+
- Dev conventions/coding standards/testing/release process changes → update `.github/knowledge/project/guidelines.md`
|
|
13
13
|
- Knowledge updates must:
|
|
14
14
|
- Be concise and focused, reflecting **what actually changed**.
|
|
15
15
|
- Avoid sensitive information (tokens/keys/credentials).
|
|
16
16
|
- Only update when **truly necessary** (no “documentation for the sake of documentation”).
|
|
17
17
|
|
|
18
18
|
## Rule 3 — Read knowledge before coding
|
|
19
|
-
- **Before writing any code**, always read and thoroughly understand all content in `#file
|
|
20
|
-
- If the knowledge files **do not exist** (i.e.,
|
|
21
|
-
- **Notify the user** immediately: _"The knowledge files in
|
|
22
|
-
- Then **automatically generate** the knowledge files based on the templates found in `#file
|
|
19
|
+
- **Before writing any code**, always read and thoroughly understand all content in `#file:.github/knowledge/project`.
|
|
20
|
+
- If the knowledge files **do not exist** (i.e., `.github/knowledge/project/` is empty or the relevant `.md` files are missing):
|
|
21
|
+
- **Notify the user** immediately: _"The knowledge files in `.github/knowledge/project/` do not exist."_
|
|
22
|
+
- Then **automatically generate** the knowledge files based on the templates found in `#file:.github/agents/template` (e.g., `structure.md`, `tech.md`, `product.md`, `guidelines.md`), filling in the content that reflects the current state of the project.
|
|
23
|
+
- Save the generated files into `.github/knowledge/project/`.
|
|
23
24
|
- Do **not** proceed with coding until the knowledge content is available and has been read.
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: '
|
|
2
|
+
description: 'Generate knowledge files from templates'
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
5
|
+
## Task
|
|
6
|
+
Based on the template files in `#file:.github/agents/template`, **generate the corresponding knowledge files** into the folder `#file:.github/knowledge/project`.
|
|
7
7
|
|
|
8
8
|
## Input
|
|
9
|
-
-
|
|
9
|
+
- Template folder: `#file:.github/agents/template`
|
|
10
10
|
- `guidelines-template.md`
|
|
11
11
|
- `product-template.md`
|
|
12
12
|
- `structure-template.md`
|
|
13
13
|
- `tech-template.md`
|
|
14
14
|
|
|
15
15
|
## Output (Success criteria)
|
|
16
|
-
|
|
17
|
-
- `#file
|
|
18
|
-
- `#file
|
|
19
|
-
- `#file
|
|
20
|
-
- `#file
|
|
16
|
+
The following knowledge files must exist in `#file:.github/knowledge/project`:
|
|
17
|
+
- `#file:.github/knowledge/project/guidelines.md`
|
|
18
|
+
- `#file:.github/knowledge/project/product.md`
|
|
19
|
+
- `#file:.github/knowledge/project/structure.md`
|
|
20
|
+
- `#file:.github/knowledge/project/tech.md`
|
|
21
21
|
|
|
22
|
-
##
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
22
|
+
## Requirements
|
|
23
|
+
- Each knowledge file must be generated **based on its corresponding template** (keep the main structure/headings, fill in content relevant to the current repo).
|
|
24
|
+
- Do **not** modify any files in `#file:.github/agents/template`.
|
|
25
|
+
- If a target file already exists in `#file:.github/knowledge/project`, **update/overwrite** it to sync with the latest template.
|
|
26
|
+
- All content must be written in **English**, clearly and concisely, with short examples where helpful.
|
|
27
27
|
|
|
28
|
-
##
|
|
29
|
-
-
|
|
30
|
-
-
|
|
28
|
+
## Constraints
|
|
29
|
+
- Do not add new templates unless explicitly required.
|
|
30
|
+
- Do not include any sensitive information (tokens, keys, credentials) in the knowledge files.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/.github/agents/{agents-skills/dev/knowledge/template → template}/tech-template.md
RENAMED
|
File without changes
|