apt-mcp-agent-setup 2.0.1 → 3.0.0

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.
Files changed (48) hide show
  1. package/bin/cli.js +1 -1
  2. package/bundle/NOTICES.md +0 -0
  3. package/bundle/core.enc +0 -0
  4. package/bundle/mcp-rules.enc +0 -0
  5. package/bundle/skills-aso.enc +0 -0
  6. package/bundle/skills-ba.enc +0 -0
  7. package/bundle/skills-base.enc +0 -0
  8. package/bundle/skills-be.enc +0 -0
  9. package/bundle/skills-design.enc +0 -0
  10. package/bundle/skills-fe.enc +0 -0
  11. package/bundle/skills-mobile.enc +0 -0
  12. package/bundle/skills-pm.enc +0 -0
  13. package/integrity-manifest.json +28 -17
  14. package/package.json +1 -1
  15. package/src/core/catalog.js +1 -0
  16. package/src/core/doctor.js +1 -0
  17. package/src/core/execution.js +1 -0
  18. package/src/core/hook-bridge.js +1 -0
  19. package/src/core/host-adapters.js +1 -0
  20. package/src/core/memory-store.js +1 -0
  21. package/src/core/session.js +1 -0
  22. package/src/core/skill-names.js +1 -0
  23. package/src/installer/global-setup.js +1 -1
  24. package/src/installer/host-hooks.js +1 -0
  25. package/src/installer/managed-config.js +1 -0
  26. package/src/installer/platform-config.js +1 -1
  27. package/src/installer/prerequisites.js +1 -1
  28. package/src/installer/project-setup.js +1 -1
  29. package/src/installer/setup-wizard.js +1 -1
  30. package/src/license/crypto.js +1 -1
  31. package/src/license/fingerprint.js +1 -1
  32. package/src/license/terms.js +1 -1
  33. package/src/license/verify.js +1 -1
  34. package/src/presets/index.js +1 -1
  35. package/src/proxy/backends.js +1 -1
  36. package/src/proxy/core-tools.js +1 -0
  37. package/src/proxy/pipeline.js +1 -1
  38. package/src/proxy/router.config.js +1 -1
  39. package/src/proxy/router.js +1 -1
  40. package/src/proxy/server.js +1 -1
  41. package/src/templates/AGENTS.md +15 -64
  42. package/src/templates/CLAUDE.md +180 -254
  43. package/src/templates/GEMINI.md +17 -115
  44. package/src/templates/apt-runtime.md +16 -0
  45. package/src/templates/copilot-instructions.md +141 -214
  46. package/src/templates/cursorrules.mdc +166 -232
  47. package/src/templates/mcp-tools.md +176 -175
  48. package/src/templates/windsurfrules.md +141 -214
@@ -1,232 +1,166 @@
1
- ---
2
- description: AG Kit agent behavioral rules — tool selection, auto-trigger skills, session protocol
3
- globs: **/*
4
- alwaysApply: true
5
- ---
6
-
7
- # AG Kit — Agent Rules
8
-
9
- > This file defines how the AI behaves in this workspace.
10
-
11
- ## Agent skills
12
-
13
- ### Support & issues
14
-
15
- For bug reports, feature requests, or licensing questions, contact: `info.alphatechs.ai@gmail.com`
16
-
17
- ### Issue tracker
18
-
19
- Issues are tracked in GitLab Issues. See `docs/agents/issue-tracker.md`.
20
-
21
- ### Triage labels
22
-
23
- Default label vocabulary (needs-triage, needs-info, ready-for-agent, ready-for-human, wontfix). See `docs/agents/triage-labels.md`.
24
-
25
- ### Domain docs
26
-
27
- Single-context layout — one `CONTEXT.md` + `docs/adr/` at the repo root. See `docs/agents/domain.md`.
28
-
29
- ---
30
-
31
- ## ⛔ CRITICAL: apt-mcp-agent TOOL USAGE (P0 — READ FIRST)
32
-
33
- **You have `apt-mcp-agent` MCP tools available. You MUST use them:**
34
- - **Before ANY code search**: use `explore_code` or `code_search` — NOT grep_search for code symbols
35
- - **Before executable changes**: call `pipeline_status`, then `pipeline_start` or `pipeline_use`
36
- - **After each pipeline step**: call `pipeline_checkpoint` with required `task` and `runId`
37
- - **Session start**: call `read_knowledge` + `pipeline_status`
38
-
39
- Ignoring these tools and using only built-in IDE tools is a **P0 protocol violation**.
40
-
41
- ## 🗺️ Session Start Protocol (MANDATORY)
42
-
43
- At the start of every session:
44
- 1. Read `.agents/ARCHITECTURE.md` to understand Agents, Skills, and Scripts.
45
- 2. Read `.agents/memory/MEMORY.md` to load persistent project conventions, user preferences, and tech decisions.
46
- 3. Read `docs/agents/mcp-tools.md` to load MCP tool selection rules & memory conventions.
47
- 4. Call `read_knowledge` to load dynamic knowledge graph from memory.
48
- 5. **Read `.agents/skill-triggers.json` to load auto-routing rules for all skills/workflows/tools.**
49
-
50
- ### ⚠️ MCP TOOL ACCESSIBILITY & FALLBACK WARNING (CRITICAL)
51
- If the specialized MCP tool `code_search` or other core MCP tools (e.g., `recall`, `remember`, `impact_analysis`) are not in your available tools list:
52
- - **DO NOT silently fall back to basic text search or skip debugging workflows.**
53
- - **STOP immediately, warn the user** that the `apt-mcp-agent` server did not start successfully or has been disabled in the IDE settings, and recommend they run `npx apt-mcp-agent-setup status` to check their setup.
54
- - Only proceed with fallback tools (e.g. `grep_search`) if the user explicitly approves it.
55
-
56
- ### 🛠️ ENFORCED DEVELOPER PIPELINES (MANDATORY — MCP TOOL GATE)
57
-
58
- Before writing any code or implementing features, you MUST follow one of the three enforced pipelines below.
59
- **Start or bind a run with `pipeline_start(pipeline, task, workspace)` or `pipeline_use(task, runId)`.**
60
- **After each step call `pipeline_checkpoint(task, runId, step, status="completed", summary)`.**
61
-
62
- Content-only documentation changes that do not affect executable behavior are exempt from PRD, issue, and TDD pipeline steps. Agent contracts such as `AGENTS.md`, `SKILL.md`, trigger maps, pipeline definitions, and runtime configuration are operational and are not exempt.
63
- Skipping steps or executing out-of-order is a **P0 protocol violation** — the tool will REJECT invalid transitions.
64
-
65
- #### 🚀 Feature Development Pipeline (5 steps — NO EXCEPTIONS, NO SKIP)
66
- ```
67
- /grill-me → /to-prd → /to-issues → /tdd → /improve-codebase-architecture
68
- ```
69
- 1. **`/grill-me`** → Stress-test the plan/design with relentless Socratic questions. Challenge edge cases, security, performance.
70
- 2. **`/to-prd`** → Synthesize the grill-me session and conversation context into a formal PRD document (routes to `prd-gen`).
71
- 3. **`/to-issues`** → Break PRD into vertical-slice issues on the issue tracker. Create `{task-slug}.md` for tracking.
72
- 4. **`/tdd`** → Implement code test-first using RED-GREEN-REFACTOR cycle.
73
- 5. **`/improve-codebase-architecture`** → Review and deepen architecture. Generate HTML report + grill-me session on codebase quality.
74
-
75
- #### 🐛 Bug Fix Pipeline (5 steps — NO EXCEPTIONS, NO SKIP)
76
- ```
77
- /diagnose → /grill-me → /to-prd → /to-issues → /tdd
78
- ```
79
- 1. **`/diagnose`** → Build feedback loop: reproduce → minimize → hypothesize → fix.
80
- 2. **`/grill-me`** → Challenge the fix design. Stress-test the proposed solution.
81
- 3. **`/to-prd`** → Document the fix as a formal PRD with root cause analysis.
82
- 4. **`/to-issues`** → Create tracking issues for the fix and any follow-up work.
83
- 5. **`/tdd`** → Write regression tests first, then implement the fix.
84
-
85
- #### 🔧 Hotfix Pipeline (2 steps — for small, isolated changes ≤3 files)
86
- ```
87
- /verify-scope → /fix-and-test
88
- ```
89
- 1. **`/verify-scope`** → Confirm change is small (≤3 files, no new API, no dependency changes). Provide scope justification in summary.
90
- 2. **`/fix-and-test`** → Apply fix + write regression test if applicable.
91
-
92
- **When to use hotfix:** typos, config values, minor CSS, off-by-one errors, missing imports, small bug fixes with obvious root cause. If the change grows beyond scope, reset and escalate to `bugfix` or `feature` pipeline.
93
-
94
- **ENFORCEMENT PROTOCOL:**
95
- - After each step completion → call `pipeline_checkpoint(task, runId, step, "completed", summary)`
96
- - Before each step start → call `pipeline_status(task, runId)`
97
- - To cancel a run → call `pipeline_reset(task, runId, confirm=true)`; history is preserved
98
- - The MCP tool enforces ordering at runtime — out-of-order calls are **rejected with error**
99
-
100
- ---
101
-
102
- ## 🔍 MCP Tool Selection
103
-
104
- | Situation | Use Tool | NOT | Why |
105
- |---|---|---|---|
106
- | Find symbol definition, function, class | `code_search` | `grep_search` | Semantic search, understands code structure |
107
- | Find all callers of a function | `find_callers` | `grep_search` | Follows call graph, not just text match |
108
- | Find all functions called by a function | `find_callees` | — | Call graph traversal |
109
- | Explore file structure & dependencies | `explore_code` | `list_dir` | Understands imports, exports, relationships |
110
- | Search in config/docs (YAML, JSON, .env, markdown) | `grep_search` | `code_search` | Non-code files, literal string match |
111
- | "What breaks if I change this?" | `impact_analysis` | — | Blast radius — always update index first |
112
- | Save a decision/bug-fix/convention | `remember` | — | Cross-session persistence |
113
- | Recall what was decided about X | `recall` | — | Search by keyword |
114
- | Load full knowledge graph | `read_knowledge` | — | Session start, get full context |
115
-
116
- **Rule: DEFAULT to `code_search` for code. Fall back to `grep_search` ONLY for non-code files or literal strings.**
117
-
118
- ---
119
-
120
- ## 🎯 Auto-Trigger Skills (MANDATORY)
121
-
122
- ### Workflow Skills
123
-
124
- | Skill | Trigger Conditions | Agent Action |
125
- |---|---|---|
126
- | `spec-clarification` | Design decision, architecture choice, plan review | Load SKILL.md → Start alignment session |
127
- | `bug-diagnostics` | Bug report, error log, "fails", "crashes" | Load SKILL.md → Reproduce → minimise → hypothesise → fix |
128
- | `task-breakdown` | Plan/PRD completed, "break down", "create tickets" | Load SKILL.md → Convert plan to vertical-slice issues |
129
- | `prd-gen` | New feature/product description with enough context | Load SKILL.md → Extract PRD from conversation context |
130
- | `prototype` | "mockup", "explore options", unclear UI/logic | Load SKILL.md → Build throwaway prototype |
131
- | `tdd-loop` | Feature implementation, bug fix, "write tests" | Load SKILL.md → Apply RED-GREEN-REFACTOR loop |
132
-
133
- ### UI/UX Design Skills
134
-
135
- | Skill | Trigger Conditions | Agent Action |
136
- |---|---|---|
137
- | `ui-style-rules` | Any web UI task: page layout, component styling | Load SKILL.md → Apply anti-slop design rules |
138
- | `web-mockup-gen` | Web UI concept needed before coding | Load SKILL.md → Generate web design reference images |
139
- | `mobile-mockup-gen` | Mobile UI concept needed before coding | Load SKILL.md → Generate mobile screen mockups |
140
- | `mobile-rules` | Any mobile UI implementation: Flutter, touch interaction | Load SKILL.md → Apply platform conventions |
141
- | `stitch-design-flow` | "stitch", "tạo trên stitch", "/stitch-flow", design UI (khi stitch preset active) | Load SKILL.md → Collaborative 8-step Stitch design flow |
142
- | `figma-handoff` | Figma URL detected (`figma.com/...`), "figma", "/figma", "code theo Figma" (khi figma preset active) | Load SKILL.md → Extract design → generate code |
143
- | `design-to-code` | "code theo design", "pull code", "/design-to-code", design-to-code conversion | Load SKILL.md → Auto-detect input → route to correct design tool |
144
- | `flutter-fix-layout-issues` | "overflow", "unbounded height", `RenderFlex`, layout error | Load SKILL.md → Fix overflow/constraint issues |
145
- | `flutter-build-responsive-layout` | "responsive", "tablet", "media query", adaptive layout | Load SKILL.md → Build adaptive layout |
146
- | `flutter-setup-declarative-routing` | "routing", "deep link", "go_router", URL navigation | Load SKILL.md → Configure declarative routing |
147
- | `flutter-add-widget-test` | "widget test", "test component", "verify UI rendering" | Load SKILL.md → Write widget test |
148
- | `flutter-add-integration-test` | "integration test", "e2e", "Flutter Driver" | Load SKILL.md → Add integration test |
149
- | `flutter-implement-json-serialization` | "fromJson", "toJson", "model class", API mapping | Load SKILL.md → Create JSON serialization |
150
- | `flutter-setup-localization` | "localization", "i18n", "intl", ".arb" | Load SKILL.md → Setup l10n |
151
- | `flutter-apply-architecture-best-practices` | "architecture", "layer", project structure | Load SKILL.md → Apply layered architecture |
152
- | `flutter-add-widget-preview` | "preview", "widget catalog", "golden test" | Load SKILL.md → Add widget preview |
153
- | `flutter-use-http-package` | "http request", "REST API", "fetch data" | Load SKILL.md → Use http package |
154
-
155
- ### BA/QC Skills — auto-trigger for requirements and testing:
156
-
157
- | Skill | Trigger Conditions | Agent Action |
158
- |---|---|---|
159
- | `ba-urd-decomposer` | "URD", "phân rã URD", "feature list", .pdf (BA context) | Load SKILL.md → Parse URD → feature list |
160
- | `ba-clarification-session` | "làm rõ yêu cầu", "clarify", "hỏi PO" | Load SKILL.md → Generate Q&A questions |
161
- | `ba-specs-writer` | "viết specs", "đặc tả", "tạo specs", "PTTK" | Load SKILL.md → Generate Specs document |
162
- | `ba-feature-tracker` | "tiến độ BA", "feature tracker", "BA progress" | Load SKILL.md → Show BA dashboard |
163
- | `ba-requirements-generator` | "BRD", "user story", "sinh BRD", "tạo BRD" | Load SKILL.md → Generate BRD/User Story |
164
- | `pdf-specs-parser` | "parse PDF specs", "đọc PTTK", .pdf (specs context) | Load SKILL.md → Extract API/UI definitions |
165
- | `qc-template-parser` | "mẫu QC", "import QC template", .xlsx (QC context) | Load SKILL.md → Learn Excel template |
166
- | `qc-bidv-workflow` | "tạo testcase BIDV", "QC workflow" | Load SKILL.md → Run BIDV QC pipeline |
167
- | `testcase-generator` | "sinh test case", "generate TCs", "tạo testcase" | Load SKILL.md → Generate Excel testcase |
168
- | `mindmap-reader` | "mindmap", "xmind", .xmind/.mm file | Load SKILL.md → Parse mindmap → JSON |
169
- | `specs-to-mindmap` | "specs sang mindmap", "tạo outline từ specs" | Load SKILL.md → Specs → outline |
170
- | `requirement-coverage` | "bao phủ yêu cầu", "traceability", "coverage" | Load SKILL.md → Requirements vs test cases |
171
- | `webapp-testing` | "E2E test", "Playwright", "test trình duyệt" | Load SKILL.md → E2E/Playwright audit |
172
-
173
- ### Failure Conditions
174
- - ❌ Writing UI code without loading design skill = **SLOP RISK**
175
- - ❌ Creating mobile screen without `mobile-rules` = **PLATFORM VIOLATION**
176
-
177
- ### ⚠️ DOMAIN SKILL LOADING (CRITICAL — DO NOT SKIP)
178
-
179
- Before writing ANY UI, design, or visual code:
180
- 1. **Web UI** → READ `.agents/skills/ui-style-rules/SKILL.md` — MANDATORY
181
- 2. **Mobile UI** → READ `.agents/skills/mobile-rules/SKILL.md` — MANDATORY
182
- 3. **Image/asset gen (web)** → READ `.agents/skills/web-mockup-gen/SKILL.md`
183
- 4. **Image/asset gen (mobile)** → READ `.agents/skills/mobile-mockup-gen/SKILL.md`
184
- 5. **Architecture decision** → READ `.agents/skills/stress-test-plan/SKILL.md`
185
-
186
- **Violation = SLOP output. Writing UI code without design skill = P0 violation.**
187
-
188
- ---
189
-
190
- ## 🛑 Socratic Gate
191
-
192
- Every user request must pass through the Socratic Gate before ANY implementation:
193
-
194
- | Request Type | Strategy | Required Action |
195
- |---|---|---|
196
- | **New Feature / Build** | Deep Discovery | ASK minimum 3 strategic questions |
197
- | **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions |
198
- | **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope |
199
-
200
- > [!IMPORTANT]
201
- > **STRICT SOCRATIC & WORKFLOW ENFORCEMENT:**
202
- > - **DO NOT write any code logic, execute modifications, or create plans before completing the required Socratic Gate action.** Bypassing the Socratic Gate is a P0 protocol violation.
203
- > - **DO NOT bypass specialized workflow skills** (like `bug-diagnostics` for debugging, `spec-clarification` for specifications, `tdd-loop` for writing code/tests) even if the task or error log seems simple or clear. Bypassing skills is a P0 protocol violation.
204
-
205
- ---
206
-
207
- ## Universal Rules
208
-
209
- ### Clean Code (Global Mandatory)
210
- - **Code**: Concise, direct, no over-engineering. Self-documenting.
211
- - **Laziness Ladder**: Before writing code, stop at the first rung that holds: YAGNI → Reuse existing → Stdlib → Native platform → Installed dep → One-liner → Minimum viable. The ladder runs AFTER understanding the problem.
212
- - **Bug Fix**: Root cause, not symptom. Grep every caller, fix the shared function once.
213
- - **No Bloat**: No unrequested abstractions, no scaffolding "for later", deletion > addition, fewest files.
214
- - **Testing**: Mandatory. Pyramid (Unit > Int > E2E) + AAA Pattern.
215
- - **Performance**: Measure first. Adhere to current Core Web Vitals standards.
216
-
217
- ### Anti-Slop Writing (Global Mandatory)
218
-
219
- When generating **any prose content** (.md, .docx, PRDs, specs, articles, BA docs, commit messages, PR descriptions), automatically avoid AI-writing patterns:
220
- - **Ban list**: delve, tapestry, landscape (abstract), vibrant, crucial, foster, underscore, showcase, pivotal, testament, interplay, intricacies, garner, enhance, enduring
221
- - **No copula avoidance**: use "is/are/has" not "serves as/stands as/boasts/features"
222
- - **No em dashes**: replace with periods, commas, colons, or parentheses
223
- - **No signposting**: no "Let's dive in", "Here's what you need to know"
224
- - **No filler**: "In order to" → "To", "Due to the fact that" → "Because"
225
- - **No sycophancy**: no "Great question!", "Absolutely!", "I hope this helps!"
226
- - **Prefer**: plain verbs, specific details, varied sentence length, active voice
227
-
228
- Full 33-pattern reference: `.agents/skills/humanizer/references/patterns.md`
229
-
230
- ### Quick Reference
231
- - **Masters**: `orchestrator`, `project-planner`, `security-auditor`, `backend-specialist`, `frontend-specialist`, `mobile-developer`, `debugger`
232
- - **Key Skills**: `clean-code`, `brainstorming`, `ui-style-rules`, `mobile-rules`, `web-mockup-gen`, `mobile-mockup-gen`, `stitch-design-flow`, `bug-diagnostics`, `tdd-loop`, `spec-clarification`, `prd-gen`, `task-breakdown`, `prototype`, `stress-test-plan`, `skill-generator`, `git-safety-guardrails`, `git-hook-setup`, `test-type-migration`, `exercise-scaffold`, `interactive-teaching`, `writing-flow`, `raw-idea-collector`, `draft-shaper`, `humanizer`, `project-config-wizard`, `skill-writing-guide`, `architecture-rules`, `solution-decision-map`, `task-implementation`, `git-conflict-resolver`, `workflow-navigator`, `terse-communication`, `session-handoff`
1
+ ---
2
+ description: AG Kit agent behavioral rules — tool selection, auto-trigger skills, session protocol
3
+ globs: **/*
4
+ alwaysApply: true
5
+ ---
6
+
7
+ # AG Kit — Agent Rules
8
+
9
+ > This file defines how the AI behaves in this workspace.
10
+
11
+ ## Agent skills
12
+
13
+ ### Support & issues
14
+
15
+ For bug reports, feature requests, or licensing questions, contact: `info.alphatechs.ai@gmail.com`
16
+
17
+ ### Issue tracker
18
+
19
+ Issues are tracked in GitLab Issues. See `docs/agents/issue-tracker.md`.
20
+
21
+ ### Triage labels
22
+
23
+ Default label vocabulary (needs-triage, needs-info, ready-for-agent, ready-for-human, wontfix). See `docs/agents/triage-labels.md`.
24
+
25
+ ### Domain docs
26
+
27
+ Single-context layout — one `CONTEXT.md` + `docs/adr/` at the repo root. See `docs/agents/domain.md`.
28
+
29
+ ---
30
+
31
+ ## APT session and execution contract
32
+
33
+ 1. Call `session_bootstrap` at session start and after context recovery. Read project conventions from `.agents/memory/MEMORY.md`; retrieve only relevant dynamic knowledge. Report unavailable backends once and use available fallbacks.
34
+ 2. Call `route_request` for a new request or changed intent, including target package/stack and explicit skills. Load the selected specialist and companion skills with `skill_load`. Do not read the complete trigger catalog into the model context.
35
+ 3. Read-only questions, reviews and running existing tests do not require a code-change pipeline. Before executable changes, inspect `pipeline_status` and bind `pipeline_start` or `pipeline_use` with canonical task/run identity and an explicit workspace.
36
+ 4. Small changes use scope, fix/check and review. Features use clarification only where needed, a plan with acceptance criteria, implementation, verification, review and acceptance. Bug fixes start with diagnosis and regression coverage. Do not require three questions, a PRD or external issues when the task is already clear.
37
+ 5. Use `pipeline_next` to reserve work before dispatch. Delegate useful independent research and reviews to native host subagents, with at most four active actors including the coordinator. Only one writer per workspace. Workers must not start/reset/rebind the parent pipeline.
38
+ 6. Record verification with `pipeline_verify` and report results with `pipeline_checkpoint`. Commands remain subject to host permissions and Plan Mode. Include current code and acceptance fingerprints; a free-form summary or skill-load receipt cannot prove completion.
39
+ 7. Review staged, unstaged and relevant untracked changes. Resolve in-scope findings, rerun affected checks and invalidate stale evidence. Review-only requests produce findings, not unsolicited edits or MR comments.
40
+ 8. Stop after ten repair/check attempts per work item or three repeated outcomes without progress. Preserve budgets and blocked/paused states across resume. User interruption always wins over continuation hooks.
41
+ 9. Native tool enforcement and automatic continuation depend on observed host capability. If unavailable, use sequential execution and state that limitation. Never claim independent review without an independent reviewer.
42
+ 10. Keep prose short and clear, reuse existing code, and load only current-step references. Strong caveman style is opt-in. Publishing, merging and external communication require authorization for those actions.
43
+
44
+ `pipeline_reset(task, runId, confirm=true)` cancels a run while preserving history. Legacy runs retain their legacy definitions. Content-only documentation does not require PRD, issue or TDD steps; AGENTS.md, SKILL.md, trigger maps and runtime configuration are operational contracts.
45
+
46
+ Read `docs/agents/mcp-tools.md` for interfaces. Run `npx apt-mcp-agent-setup doctor` to inspect configuration. A registered MCP server or installed hook is not proof of successful activation. Health must show successful initialization and functional probes, not only a running process.
47
+
48
+
49
+ ## 🔍 MCP Tool Selection
50
+
51
+ | Situation | Use Tool | NOT | Why |
52
+ |---|---|---|---|
53
+ | Find symbol definition, function, class | `code_search` | `grep_search` | Semantic search, understands code structure |
54
+ | Find all callers of a function | `find_callers` | `grep_search` | Follows call graph, not just text match |
55
+ | Find all functions called by a function | `find_callees` | — | Call graph traversal |
56
+ | Explore file structure & dependencies | `explore_code` | `list_dir` | Understands imports, exports, relationships |
57
+ | Search in config/docs (YAML, JSON, .env, markdown) | `grep_search` | `code_search` | Non-code files, literal string match |
58
+ | "What breaks if I change this?" | `impact_analysis` | — | Blast radius — always update index first |
59
+ | Save a decision/bug-fix/convention | `remember` | — | Cross-session persistence |
60
+ | Recall what was decided about X | `recall` | — | Search by keyword |
61
+ | Load full knowledge graph | `read_knowledge` | — | Session start, get full context |
62
+
63
+ **Rule: DEFAULT to `code_search` for code. Fall back to `grep_search` ONLY for non-code files or literal strings.**
64
+
65
+ ---
66
+
67
+ ## 🎯 Auto-Trigger Skills (MANDATORY)
68
+
69
+ ### Workflow Skills
70
+
71
+ | Skill | Trigger Conditions | Agent Action |
72
+ |---|---|---|
73
+ | `spec-clarification` | Design decision, architecture choice, plan review | Load SKILL.md → Start alignment session |
74
+ | `bug-diagnostics` | Bug report, error log, "fails", "crashes" | Load SKILL.md → Reproduce → minimise → hypothesise → fix |
75
+ | `task-breakdown` | Plan/PRD completed, "break down", "create tickets" | Load SKILL.md → Convert plan to vertical-slice issues |
76
+ | `prd-gen` | New feature/product description with enough context | Load SKILL.md → Extract PRD from conversation context |
77
+ | `prototype` | "mockup", "explore options", unclear UI/logic | Load SKILL.md → Build throwaway prototype |
78
+ | `tdd-loop` | Feature implementation, bug fix, "write tests" | Load SKILL.md → Apply RED-GREEN-REFACTOR loop |
79
+
80
+ ### UI/UX Design Skills
81
+
82
+ | Skill | Trigger Conditions | Agent Action |
83
+ |---|---|---|
84
+ | `ui-style-rules` | Any web UI task: page layout, component styling | Load SKILL.md → Apply anti-slop design rules |
85
+ | `web-mockup-gen` | Web UI concept needed before coding | Load SKILL.md → Generate web design reference images |
86
+ | `mobile-mockup-gen` | Mobile UI concept needed before coding | Load SKILL.md → Generate mobile screen mockups |
87
+ | `mobile-rules` | Any mobile UI implementation: Flutter, touch interaction | Load SKILL.md → Apply platform conventions |
88
+ | `stitch-design-flow` | "stitch", "tạo trên stitch", "/stitch-flow", design UI (khi stitch preset active) | Load SKILL.md → Collaborative 8-step Stitch design flow |
89
+ | `figma-handoff` | Figma URL detected (`figma.com/...`), "figma", "/figma", "code theo Figma" (khi figma preset active) | Load SKILL.md → Extract design → generate code |
90
+ | `design-to-code` | "code theo design", "pull code", "/design-to-code", design-to-code conversion | Load SKILL.md → Auto-detect input → route to correct design tool |
91
+ | `flutter-fix-layout-issues` | "overflow", "unbounded height", `RenderFlex`, layout error | Load SKILL.md → Fix overflow/constraint issues |
92
+ | `flutter-build-responsive-layout` | "responsive", "tablet", "media query", adaptive layout | Load SKILL.md → Build adaptive layout |
93
+ | `flutter-setup-declarative-routing` | "routing", "deep link", "go_router", URL navigation | Load SKILL.md → Configure declarative routing |
94
+ | `flutter-add-widget-test` | "widget test", "test component", "verify UI rendering" | Load SKILL.md → Write widget test |
95
+ | `flutter-add-integration-test` | "integration test", "e2e", "Flutter Driver" | Load SKILL.md → Add integration test |
96
+ | `flutter-implement-json-serialization` | "fromJson", "toJson", "model class", API mapping | Load SKILL.md → Create JSON serialization |
97
+ | `flutter-setup-localization` | "localization", "i18n", "intl", ".arb" | Load SKILL.md → Setup l10n |
98
+ | `flutter-apply-architecture-best-practices` | "architecture", "layer", project structure | Load SKILL.md → Apply layered architecture |
99
+ | `flutter-add-widget-preview` | "preview", "widget catalog", "golden test" | Load SKILL.md → Add widget preview |
100
+ | `flutter-use-http-package` | "http request", "REST API", "fetch data" | Load SKILL.md → Use http package |
101
+
102
+ ### BA/QC Skills — auto-trigger for requirements and testing:
103
+
104
+ | Skill | Trigger Conditions | Agent Action |
105
+ |---|---|---|
106
+ | `ba-urd-decomposer` | "URD", "phân rã URD", "feature list", .pdf (BA context) | Load SKILL.md → Parse URD → feature list |
107
+ | `ba-clarification-session` | "làm rõ yêu cầu", "clarify", "hỏi PO" | Load SKILL.md → Generate Q&A questions |
108
+ | `ba-specs-writer` | "viết specs", "đặc tả", "tạo specs", "PTTK" | Load SKILL.md → Generate Specs document |
109
+ | `ba-feature-tracker` | "tiến độ BA", "feature tracker", "BA progress" | Load SKILL.md → Show BA dashboard |
110
+ | `ba-requirements-generator` | "BRD", "user story", "sinh BRD", "tạo BRD" | Load SKILL.md → Generate BRD/User Story |
111
+ | `pdf-specs-parser` | "parse PDF specs", "đọc PTTK", .pdf (specs context) | Load SKILL.md → Extract API/UI definitions |
112
+ | `qc-template-parser` | "mẫu QC", "import QC template", .xlsx (QC context) | Load SKILL.md → Learn Excel template |
113
+ | `qc-bidv-workflow` | "tạo testcase BIDV", "QC workflow" | Load SKILL.md → Run BIDV QC pipeline |
114
+ | `testcase-generator` | "sinh test case", "generate TCs", "tạo testcase" | Load SKILL.md → Generate Excel testcase |
115
+ | `mindmap-reader` | "mindmap", "xmind", .xmind/.mm file | Load SKILL.md → Parse mindmap → JSON |
116
+ | `specs-to-mindmap` | "specs sang mindmap", "tạo outline từ specs" | Load SKILL.md → Specs → outline |
117
+ | `requirement-coverage` | "bao phủ yêu cầu", "traceability", "coverage" | Load SKILL.md → Requirements vs test cases |
118
+ | `webapp-testing` | "E2E test", "Playwright", "test trình duyệt" | Load SKILL.md → E2E/Playwright audit |
119
+
120
+ ### Failure Conditions
121
+ - ❌ Writing UI code without loading design skill = **SLOP RISK**
122
+ - ❌ Creating mobile screen without `mobile-rules` = **PLATFORM VIOLATION**
123
+
124
+ ### ⚠️ DOMAIN SKILL LOADING (CRITICAL — DO NOT SKIP)
125
+
126
+ Before writing ANY UI, design, or visual code:
127
+ 1. **Web UI** → READ `.agents/skills/ui-style-rules/SKILL.md` — MANDATORY
128
+ 2. **Mobile UI** → READ `.agents/skills/mobile-rules/SKILL.md` — MANDATORY
129
+ 3. **Image/asset gen (web)** → READ `.agents/skills/web-mockup-gen/SKILL.md`
130
+ 4. **Image/asset gen (mobile)** → READ `.agents/skills/mobile-mockup-gen/SKILL.md`
131
+ 5. **Architecture decision** → READ `.agents/skills/stress-test-plan/SKILL.md`
132
+
133
+ **Violation = SLOP output. Writing UI code without design skill = P0 violation.**
134
+
135
+ ---
136
+
137
+ ## Clarification
138
+
139
+ Ask only questions that resolve material uncertainty. Reuse established answers.
140
+
141
+ ## Universal Rules
142
+
143
+ ### Clean Code (Global Mandatory)
144
+ - **Code**: Concise, direct, no over-engineering. Self-documenting.
145
+ - **Laziness Ladder**: Before writing code, stop at the first rung that holds: YAGNI → Reuse existing → Stdlib → Native platform → Installed dep → One-liner → Minimum viable. The ladder runs AFTER understanding the problem.
146
+ - **Bug Fix**: Root cause, not symptom. Grep every caller, fix the shared function once.
147
+ - **No Bloat**: No unrequested abstractions, no scaffolding "for later", deletion > addition, fewest files.
148
+ - **Testing**: Mandatory. Pyramid (Unit > Int > E2E) + AAA Pattern.
149
+ - **Performance**: Measure first. Adhere to current Core Web Vitals standards.
150
+
151
+ ### Anti-Slop Writing (Global Mandatory)
152
+
153
+ When generating **any prose content** (.md, .docx, PRDs, specs, articles, BA docs, commit messages, PR descriptions), automatically avoid AI-writing patterns:
154
+ - **Ban list**: delve, tapestry, landscape (abstract), vibrant, crucial, foster, underscore, showcase, pivotal, testament, interplay, intricacies, garner, enhance, enduring
155
+ - **No copula avoidance**: use "is/are/has" not "serves as/stands as/boasts/features"
156
+ - **No em dashes**: replace with periods, commas, colons, or parentheses
157
+ - **No signposting**: no "Let's dive in", "Here's what you need to know"
158
+ - **No filler**: "In order to" → "To", "Due to the fact that" → "Because"
159
+ - **No sycophancy**: no "Great question!", "Absolutely!", "I hope this helps!"
160
+ - **Prefer**: plain verbs, specific details, varied sentence length, active voice
161
+
162
+ Full 33-pattern reference: `.agents/skills/humanizer/references/patterns.md`
163
+
164
+ ### Quick Reference
165
+ - **Masters**: `orchestrator`, `project-planner`, `security-auditor`, `backend-specialist`, `frontend-specialist`, `mobile-developer`, `debugger`
166
+ - **Key Skills**: `clean-code`, `brainstorming`, `ui-style-rules`, `mobile-rules`, `web-mockup-gen`, `mobile-mockup-gen`, `stitch-design-flow`, `bug-diagnostics`, `tdd-loop`, `spec-clarification`, `prd-gen`, `task-breakdown`, `prototype`, `stress-test-plan`, `skill-generator`, `git-safety-guardrails`, `git-hook-setup`, `test-type-migration`, `exercise-scaffold`, `interactive-teaching`, `writing-flow`, `raw-idea-collector`, `draft-shaper`, `humanizer`, `project-config-wizard`, `skill-writing-guide`, `architecture-rules`, `solution-decision-map`, `task-implementation`, `git-conflict-resolver`, `workflow-navigator`, `terse-communication`, `session-handoff`