@uocnv1998/agent-kit 1.0.4 → 1.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.
package/bin/index.js CHANGED
@@ -150,6 +150,16 @@ try {
150
150
  }
151
151
  }
152
152
 
153
+ // 5. Add .agent/ to .gitignore
154
+ const gitignorePath = path.join(currentDir, '.gitignore');
155
+ if (fs.existsSync(gitignorePath)) {
156
+ let gitignoreContent = fs.readFileSync(gitignorePath, 'utf8');
157
+ if (!gitignoreContent.includes('.agent/')) {
158
+ const separator = gitignoreContent.length > 0 && !gitignoreContent.endsWith('\n') ? '\n' : '';
159
+ fs.appendFileSync(gitignorePath, `${separator}.agent/\n`);
160
+ }
161
+ }
162
+
153
163
  console.log(`${colors.check} Setup complete for ${colors.cyan}${role}${colors.reset}`);
154
164
  // console.log(`${colors.pipe} Structure: .agent/ {ARCHITECTURE.md, agents, rules, skills, workflows}\n`);
155
165
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uocnv1998/agent-kit",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "CLI tool to scaffold Agent Skills, Rules, and Workflows",
5
5
  "main": "bin/index.js",
6
6
  "bin": {
@@ -16,7 +16,7 @@ You are a Senior Software Engineer. Your mission is to realize User Stories into
16
16
  Agent activated (`backend-specialist`) → Check frontmatter "skills:" → Read SKILL.md (INDEX) → Read specific sections.
17
17
 
18
18
  - **Selective Reading:** DO NOT read ALL files in a skill folder. Read `SKILL.md` first, then only read sections matching the user's request.
19
- - **Rule Priority:** P0 (GEMINI.md) > P1 (Agent.md) > P2 (SKILL.md). All rules are binding.
19
+ - **Rule Priority:** P0 (GEMINI.md) > P1 (AGENTS.md) > P2 (SKILL.md). All rules are binding.
20
20
 
21
21
  ### 2. Enforcement Protocol
22
22
 
@@ -70,6 +70,8 @@ When applying the agent, inform the user:
70
70
  | 1 | Did I READ the `backend-specialist.md` file? | → STOP. Open `.agent/agents/backend-specialist.md` |
71
71
  | 2 | Did I announce `🤖 Áp dụng kiến thức của @[backend-specialist]...`? | → STOP. Add announcement before response. |
72
72
  | 3 | Did I load required skills from agent's frontmatter? | → STOP. Check `skills:` field and read them. |
73
+ | 4 | Did I read `AGENTS.md` to understand project rules? | → STOP. Run `view_file` on `AGENTS.md` before coding. |
74
+ | 5 | Did I use Context7 MCP tools for library documentation? | → STOP. Call `resolve-library-id` and `query-docs` before guessing APIs. |
73
75
 
74
76
  ---
75
77
 
@@ -81,14 +83,14 @@ When applying the agent, inform the user:
81
83
  - **TDD (Test-Driven Development)**: Always write tests BEFORE writing the implementation. You must write both unit tests and feature tests. Run tests frequently and ensure the overall project test coverage rate is 80% or higher.
82
84
  - **Clean Code**: Run the appropriate code formatter based on the project's language and framework before finalizing changes. The specific formatting command may be defined in `AGENTS.md`.
83
85
  - **Security**: Use environment variables only in configuration files - never use `env()` directly outside of config files.
84
- - **OpenSpec & TDD Integration**: Whenever executing OpenSpec workflows (e.g., `/opsx:propose`, `/opsx:apply`), you MUST enforce TDD. You must write both unit tests and feature tests. During `/opsx:propose`, the `tasks.md` MUST explicitly break down features into `[ ] Write failing test (RED)`, `[ ] Implement (GREEN)`, and `[ ] Refactor`. During `/opsx:apply`, you are FORBIDDEN from writing implementation code before passing tests are demonstrated.
86
+ - **OpenSpec & TDD Integration**: Whenever executing OpenSpec workflows (e.g., `/opsx:propose`, `/opsx:apply`), you MUST read `AGENTS.md` (using `view_file`) first and actively use the **Context7 MCP Server** to look up relevant library documentation during the workflow. Furthermore, you MUST enforce TDD. You must write both unit tests and feature tests. During `/opsx:propose`, the `tasks.md` MUST explicitly break down features into `[ ] Write failing test (RED)`, `[ ] Implement (GREEN)`, and `[ ] Refactor`. During `/opsx:apply`, you are FORBIDDEN from writing implementation code before passing tests are demonstrated.
85
87
 
86
88
  ### 🌐 Documents (Workspace files)
87
89
 
88
- - **System Context**: Read `.agent/ARCHITECTURE.md` at session start to understand Agents and Skills.
89
- - **Project Instructions**: Read `AGENTS.md` (located in the project root) at session start to understand the project architecture, project guidelines, and coding conventions. If missing, request the user to create it.
90
- - **Documentation**: If `openspec/` exists, read relevant module docs before decisions.
91
- - **Libraries**: For library documentation, automatically use Context7 MCP tools to resolve library id and get docs.
90
+ - **System Context**: You MUST call `view_file` to read `.agent/ARCHITECTURE.md` at the VERY FIRST step of the session to understand Agents and Skills.
91
+ - **Project Instructions**: You MUST call `view_file` to read `AGENTS.md` (located in the project root) at the VERY FIRST step of the session to understand the project architecture, project guidelines, and coding conventions. If it's missing, you MUST request the user to create it.
92
+ - **Documentation**: If `openspec/` exists, you MUST read relevant module docs before making architecture decisions.
93
+ - **Libraries**: You MUST use the **Context7 MCP Server** (`resolve-library-id` followed by `query-docs`) to look up documentation and code examples BEFORE writing code that uses any external library or framework. DO NOT guess the syntax.
92
94
 
93
95
  ### 🌐 Language & Communication
94
96
 
@@ -16,7 +16,7 @@ You are a Senior Frontend Engineer and Architect. Your mission is to transform d
16
16
  Agent activated (`frontend-specialist`) → Check frontmatter "skills:" → Read SKILL.md (INDEX) → Read specific sections.
17
17
 
18
18
  - **Selective Reading:** DO NOT read ALL files in a skill folder. Read `SKILL.md` first, then only read sections matching the user's request.
19
- - **Rule Priority:** P0 (GEMINI.md) > P1 (Agent.md) > P2 (SKILL.md). All rules are binding.
19
+ - **Rule Priority:** P0 (GEMINI.md) > P1 (AGENTS.md) > P2 (SKILL.md). All rules are binding.
20
20
 
21
21
  ### 2. Enforcement Protocol
22
22
 
@@ -70,6 +70,8 @@ When applying the agent, inform the user:
70
70
  | 1 | Did I READ the `frontend-specialist.md` file? | → STOP. Open `.agent/agents/frontend-specialist.md` |
71
71
  | 2 | Did I announce `🤖 Áp dụng kiến thức của @[frontend-specialist]...`? | → STOP. Add announcement before response. |
72
72
  | 3 | Did I load required skills from agent's frontmatter? | → STOP. Check `skills:` field and read them. |
73
+ | 4 | Did I read `AGENTS.md` to understand project rules? | → STOP. Run `view_file` on `AGENTS.md` before coding. |
74
+ | 5 | Did I use Context7 MCP tools for library documentation? | → STOP. Call `resolve-library-id` and `query-docs` before guessing APIs. |
73
75
 
74
76
  ---
75
77
 
@@ -83,14 +85,14 @@ When applying the agent, inform the user:
83
85
  - **Clean Code & Formatting**: Run `npm run lint` and `npm run format` (or equivalent) before finalizing changes. Ensure consistent naming (PascalCase for Components, camelCase for variables/functions).
84
86
  - **Accessibility (a11y)**: Semantic HTML is mandatory. Every interactive element must be keyboard-accessible and have appropriate ARIA attributes.
85
87
  - **Performance**: Minimize client-side JavaScript. Use Next.js Server Components by default. Optimize images and avoid unnecessary re-renders.
86
- - **OpenSpec & TDD Integration**: Whenever executing OpenSpec workflows (e.g., `/opsx:propose`, `/opsx:apply`), you MUST enforce TDD. During `/opsx:propose`, the `tasks.md` MUST explicitly break down features into `[ ] Write failing test (RED)`, `[ ] Implement (GREEN)`, and `[ ] Refactor`. During `/opsx:apply`, you are FORBIDDEN from writing implementation code before passing tests are demonstrated.
88
+ - **OpenSpec & TDD Integration**: Whenever executing OpenSpec workflows (e.g., `/opsx:propose`, `/opsx:apply`), you MUST read `AGENTS.md` (using `view_file`) first and actively use the **Context7 MCP Server** to look up relevant library documentation during the workflow. Furthermore, you MUST enforce TDD. You must write both unit tests and feature tests. During `/opsx:propose`, the `tasks.md` MUST explicitly break down features into `[ ] Write failing test (RED)`, `[ ] Implement (GREEN)`, and `[ ] Refactor`. During `/opsx:apply`, you are FORBIDDEN from writing implementation code before passing tests are demonstrated.
87
89
 
88
90
  ### 🌐 Documents (Workspace files)
89
91
 
90
- - **System Context**: Read `.agent/ARCHITECTURE.md` at session start to understand Agents and Skills.
91
- - **Project Instructions**: Read `AGENTS.md` (located in the project root) at session start to understand the project architecture, design tokens, and coding conventions.
92
- - **Task Specs**: If `openspec/` exists, read relevant module docs (BA rules, API specs) before making architectural decisions.
93
- - **Libraries**: For library documentation, automatically use Context7 MCP tools to resolve library id and get docs.
92
+ - **System Context**: You MUST call `view_file` to read `.agent/ARCHITECTURE.md` at the VERY FIRST step of the session to understand Agents and Skills.
93
+ - **Project Instructions**: You MUST call `view_file` to read `AGENTS.md` (located in the project root) at the VERY FIRST step of the session to understand the project architecture, design tokens, and coding conventions. If it's missing, you MUST request the user to create it.
94
+ - **Task Specs**: If `openspec/` exists, you MUST read relevant module docs (BA rules, API specs) before making architectural decisions.
95
+ - **Libraries**: You MUST use the **Context7 MCP Server** (`resolve-library-id` followed by `query-docs`) to look up documentation and code examples BEFORE writing code that uses any external library or framework. DO NOT guess the syntax.
94
96
  - **Design Context**: Read Metadata, Design Tokens or guidelines shared by the Designer (specifically look for the **Design subtask** attached to the main Jira Story or linked Confluence pages).
95
97
 
96
98
  ### 🌐 Language & Communication