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,254 +1,180 @@
1
- ## Agent skills
2
-
3
- ### Support & issues
4
-
5
- For bug reports, feature requests, or licensing questions, contact: `info.alphatechs.ai@gmail.com`
6
-
7
- ### Issue tracker
8
-
9
- Issues are tracked in GitLab Issues. See `docs/agents/issue-tracker.md`.
10
-
11
- ### Triage labels
12
-
13
- Default label vocabulary (needs-triage, needs-info, ready-for-agent, ready-for-human, wontfix). See `docs/agents/triage-labels.md`.
14
-
15
- ### Domain docs
16
-
17
- Single-context layout — one `CONTEXT.md` + `docs/adr/` at the repo root. See `docs/agents/domain.md`.
18
-
19
- ### FE Web design (taste-skill)
20
-
21
- Anti-slop frontend design skill for landing pages, portfolios, and redesigns.
22
-
23
- - `ui-style-rules` — anti-slop design rules, typography, color calibration, layout discipline for code generation.
24
- - `web-mockup-gen` — web design image/mockup generation (image-only, no code).
25
-
26
- ### FE Mobile design
27
-
28
- - `mobile-mockup-gen` — mobile app screen mockup generation (image-only, no code).
29
- - `mobile-rules` — mobile-first design thinking (touch, performance, platform conventions).
30
-
31
- ### Flutter development
32
-
33
- Skills for Flutter architecture, testing, layout, routing, localization, and serialization.
34
-
35
- Skills: `flutter-add-integration-test`, `flutter-add-widget-preview`, `flutter-add-widget-test`, `flutter-apply-architecture-best-practices`, `flutter-build-responsive-layout`, `flutter-fix-layout-issues`, `flutter-implement-json-serialization`, `flutter-setup-declarative-routing`, `flutter-setup-localization`, `flutter-use-http-package`.
36
-
37
- ### MCP tools
38
-
39
- Tool selection rules, index policies, memory conventions, and auto-skill activation. See `docs/agents/mcp-tools.md`.
40
-
41
- **Quick reference:**
42
- - Code search: `code_search` (default), `grep_search` (non-code only)
43
- - Impact: `impact_analysis` (always update index first)
44
- - Memory: `remember` / `recall` / `read_knowledge` (see conventions in mcp-tools.md)
45
-
46
- ## ⛔ CRITICAL: apt-mcp-agent TOOL USAGE (P0 — READ FIRST)
47
-
48
- **You have `apt-mcp-agent` MCP tools available. You MUST use them:**
49
- - **Before ANY code search**: use `explore_code` or `code_search` — NOT grep_search for code symbols
50
- - **Before executable changes**: call `pipeline_status`, then `pipeline_start` or `pipeline_use`
51
- - **After each pipeline step**: call `pipeline_checkpoint` with required `task` and `runId`
52
- - **Session start**: call `read_knowledge` + `pipeline_status`
53
-
54
- Ignoring these tools and using only built-in IDE tools is a **P0 protocol violation**.
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.
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
- ## Session Start Protocol (MANDATORY)
103
-
104
- At the start of every session:
105
- 1. Read `.agents/ARCHITECTURE.md` to understand Agents, Skills, and Scripts.
106
- 2. Read `.agents/memory/MEMORY.md` to load persistent project conventions, user preferences, and tech decisions.
107
- 3. Read `docs/agents/mcp-tools.md` to load MCP tool selection rules & memory conventions.
108
- 4. Call `read_knowledge` to load dynamic knowledge graph from memory.
109
- 5. **Read `.agents/skill-triggers.json` to load auto-routing rules for all skills/workflows/tools.**
110
-
111
- ### 🔄 Context Recovery (MANDATORY after any context truncation/compression)
112
- If your conversation context was truncated, compressed, or you are resuming after a checkpoint:
113
- 1. **Call `pipeline_status()` immediately** — it returns recovery instructions and tool reminders
114
- 2. Re-read the session start files above if not already in context
115
- 3. Classify the current user request before taking any code action
116
-
117
- ### ⚠️ MCP TOOL ACCESSIBILITY & FALLBACK WARNING (CRITICAL)
118
- 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:
119
- - **DO NOT silently fall back to basic text search or skip debugging workflows.**
120
- - **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.
121
- - Only proceed with fallback tools (e.g. `grep_search`) if the user explicitly approves it.
122
-
123
- ---
124
-
125
- ## Auto-Trigger Skills (MANDATORY)
126
-
127
- ### Workflow Skills — auto-trigger based on request type:
128
-
129
- | Skill | Trigger Conditions | Agent Action |
130
- |---|---|---|
131
- | `spec-clarification` | Design decision, architecture choice, plan review, "should we X or Y?" | Load SKILL.md → Start alignment session |
132
- | `bug-diagnostics` | Bug report, error log, "fails", "crashes", "/debug" | Load SKILL.md → Reproduce → minimise → hypothesise → fix |
133
- | `task-breakdown` | Plan/PRD just completed, "break down", "create tickets" | Load SKILL.md → Convert plan to vertical-slice issues |
134
- | `prd-gen` | New feature/product description with enough context for spec | Load SKILL.md → Extract PRD from conversation context |
135
- | `prototype` | "mockup", "explore options", unclear UI/logic | Load SKILL.md → Pick branch (logic vs UI) → Build throwaway prototype |
136
- | `tdd-loop` | Feature implementation, bug fix, "write tests", "red-green" | Load SKILL.md → Apply RED-GREEN-REFACTOR loop |
137
-
138
- ### UI/UX Design Skills — auto-trigger when touching UI/design:
139
-
140
- | Skill | Trigger Conditions | Agent Action |
141
- |---|---|---|
142
- | `ui-style-rules` | Any web UI task: page layout, component styling, redesign | Load SKILL.md → Apply anti-slop design rules |
143
- | `web-mockup-gen` | "mockup web", "design page", web UI concept needed before coding | Load SKILL.md → Generate web design reference images (no code) |
144
- | `mobile-mockup-gen` | "mockup app", "design screen", mobile UI concept needed before coding | Load SKILL.md → Generate mobile screen mockups in phone frames |
145
- | `mobile-rules` | Any mobile UI implementation: Flutter widget, screen, touch interaction | Load SKILL.md → Apply platform conventions, touch patterns |
146
- | `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 |
147
- | `figma-handoff` | Figma URL detected (`figma.com/...`), "figma", "/figma", "code theo Figma" (khi figma preset active) | Load SKILL.md → Extract design → generate code |
148
- | `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 |
149
- | `flutter-fix-layout-issues` | "overflow", "unbounded height", `RenderFlex`, layout constraint error | Load SKILL.md → Fix overflow/constraint issues |
150
- | `flutter-build-responsive-layout` | "responsive", "tablet", "media query", adaptive layout | Load SKILL.md → Build adaptive layout |
151
- | `flutter-setup-declarative-routing` | "routing", "deep link", "go_router", URL navigation | Load SKILL.md → Configure declarative routing |
152
- | `flutter-add-widget-test` | "widget test", "test component", "verify UI rendering" | Load SKILL.md → Write widget test |
153
- | `flutter-add-integration-test` | "integration test", "e2e", "app test", "Flutter Driver" | Load SKILL.md → Add integration test |
154
- | `flutter-implement-json-serialization` | "fromJson", "toJson", "model class", "API response mapping" | Load SKILL.md → Create JSON serialization |
155
- | `flutter-setup-localization` | "localization", "i18n", "intl", "translation", ".arb" | Load SKILL.md → Setup l10n |
156
- | `flutter-apply-architecture-best-practices` | "architecture", "clean arch", "layer", project structure | Load SKILL.md → Apply layered architecture |
157
- | `flutter-add-widget-preview` | "preview", "widget catalog", "golden test" | Load SKILL.md → Add widget preview |
158
- | `flutter-use-http-package` | "http request", "REST API", "fetch data", "GET/POST" | Load SKILL.md → Use http package |
159
-
160
- ### Productivity & Utility Skills — auto-trigger based on task context:
161
-
162
- | Skill | Trigger Conditions | Agent Action |
163
- |---|---|---|
164
- | `stress-test-plan` | "grill me", "challenge my plan", stress testing proposed plan | Load SKILL.md → Start interactive plan stress-testing session |
165
- | `skill-generator` | "write skill", "create skill", building a new custom agent skill | Load SKILL.md → Generate new skill stub/directory |
166
- | `git-safety-guardrails` | "git guardrails", "block dangerous git", protect git hooks | Load SKILL.md → Deploy Claude Code hooks to block push/hard-reset |
167
- | `git-hook-setup` | "setup pre-commit", "configure husky", install pre-commit hooks | Load SKILL.md → Install Husky, lint-staged, Prettier hooks |
168
- | `test-type-migration` | "migrate as in tests", "replace as assertions", shoehorn refactoring | Load SKILL.md → Refactor tests to remove unsafe type assertions |
169
- | `exercise-scaffold` | "scaffold exercises", "exercise stubs", coding course setup | Load SKILL.md → Create problems, solutions, and tests stubs |
170
- | `interactive-teaching` | "teach me", "tutorial", "learn Y", stateful workspace learning | Load SKILL.md → Create mission, lessons, and learning records |
171
- | `writing-flow` | "writing beats", "narrative journey", write article step-by-step | Load SKILL.md → Guide user through choice of narrative beats |
172
- | `raw-idea-collector` | "collect ideas", "writing fragments", ideate outline | Load SKILL.md → Collect heterogeneous claims, vignettes, and thoughts |
173
- | `draft-shaper` | "shape draft", "edit notes", clean draft to publishable quality | Load SKILL.md → Iterate paragraph by paragraph to edit draft |
174
- | `humanizer` | "humanize", "remove AI writing", "anti-slop", "viết tự nhiên hơn" | Load SKILL.md → Scrub 33 AI-writing patterns, rewrite to human voice |
175
-
176
- ### BA/QC Skills — auto-trigger for requirements analysis and testing:
177
-
178
- | Skill | Trigger Conditions | Agent Action |
179
- |---|---|---|
180
- | `ba-urd-decomposer` | "URD", "phân rã URD", "danh sách tính năng", "feature list", .pdf file (BA context) | Load SKILL.md → Parse URD → output structured feature list |
181
- | `ba-clarification-session` | "làm rõ yêu cầu", "clarify", "hỏi PO", "session làm rõ", "clarification" | Load SKILL.md → Generate Q&A questions for PO session |
182
- | `ba-specs-writer` | "viết specs", "đặc tả", "chi tiết tính năng", "tạo specs", "PTTK" | Load SKILL.md → Generate detailed Specs document |
183
- | `ba-feature-tracker` | "tiến độ BA", "feature tracker", "trạng thái tính năng", "BA progress" | Load SKILL.md → Show BA progress dashboard |
184
- | `ba-template-parser` | "mẫu BA", "import template", "learn template", .docx file (BA context) | Load SKILL.md → Learn customer template structure |
185
- | `ba-requirements-generator` | "BRD", "user story", "viết yêu cầu", "sinh BRD", "tạo BRD" | Load SKILL.md → Generate BRD/User Story document |
186
- | `pdf-specs-parser` | "parse PDF specs", "đọc PTTK", .pdf file (specs context) | Load SKILL.md → Extract API/UI field definitions |
187
- | `qc-template-parser` | "mẫu QC", "import QC template", "mẫu testcase", .xlsx file (QC context) | Load SKILL.md → Learn Excel testcase template |
188
- | `qc-bidv-workflow` | "tạo testcase BIDV", "QC workflow", "sinh test case từ specs" | Load SKILL.md → Run BIDV QC pipeline end-to-end |
189
- | `testcase-generator` | "sinh test case", "generate TCs", "tạo testcase", "xuất Excel testcase" | Load SKILL.md → Generate Excel testcase from JSON |
190
- | `mindmap-reader` | "mindmap", "xmind", "đọc mindmap", .xmind/.mm file | Load SKILL.md → Parse mindmap → Normalized Test Scenario JSON |
191
- | `specs-to-mindmap` | "specs sang mindmap", "tạo outline từ specs", "test hierarchy" | Load SKILL.md → Convert Specs → Markdown outline |
192
- | `requirement-coverage` | "bao phủ yêu cầu", "traceability", "coverage report" | Load SKILL.md → Cross-reference user stories vs test cases |
193
- | `webapp-testing` | "E2E test", "Playwright", "test trình duyệt", "test tự động web" | Load SKILL.md → E2E/Playwright deep audit |
194
-
195
- **Failure Conditions:**
196
- - ❌ Writing UI code without loading design skill = **SLOP RISK**
197
- - ❌ Creating mobile screen without `mobile-rules` = **PLATFORM VIOLATION**
198
-
199
- ### ⚠️ DOMAIN SKILL LOADING (CRITICAL — DO NOT SKIP)
200
-
201
- Before writing ANY UI, design, or visual code:
202
- 1. **Web UI** → READ `.agents/skills/ui-style-rules/SKILL.md` — MANDATORY
203
- 2. **Mobile UI** → READ `.agents/skills/mobile-rules/SKILL.md` — MANDATORY
204
- 3. **Image/asset gen (web)** → READ `.agents/skills/web-mockup-gen/SKILL.md`
205
- 4. **Image/asset gen (mobile)** → READ `.agents/skills/mobile-mockup-gen/SKILL.md`
206
- 5. **Architecture decision** → READ `.agents/skills/stress-test-plan/SKILL.md`
207
-
208
- **Violation = SLOP output. Writing UI code without design skill = P0 violation.**
209
-
210
- ---
211
-
212
- ## Socratic Gate
213
-
214
- Every user request must pass through the Socratic Gate before ANY implementation:
215
-
216
- | Request Type | Strategy | Required Action |
217
- |---|---|---|
218
- | **New Feature / Build** | Deep Discovery | ASK minimum 3 strategic questions |
219
- | **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions |
220
- | **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope |
221
-
222
- > [!IMPORTANT]
223
- > **STRICT SOCRATIC & WORKFLOW ENFORCEMENT:**
224
- > - **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.
225
- > - **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.
226
-
227
- ---
228
-
229
- ## Universal Rules
230
-
231
- ### Clean Code (Global Mandatory)
232
- - **Code**: Concise, direct, no over-engineering. Self-documenting.
233
- - **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.
234
- - **Bug Fix**: Root cause, not symptom. Grep every caller, fix the shared function once.
235
- - **No Bloat**: No unrequested abstractions, no scaffolding "for later", deletion > addition, fewest files.
236
- - **Testing**: Mandatory. Pyramid (Unit > Int > E2E) + AAA Pattern.
237
- - **Performance**: Measure first. Adhere to current Core Web Vitals standards.
238
-
239
- ### Anti-Slop Writing (Global Mandatory)
240
-
241
- When generating **any prose content** (.md, .docx, PRDs, specs, articles, BA docs, commit messages, PR descriptions), automatically avoid AI-writing patterns:
242
- - **Ban list**: delve, tapestry, landscape (abstract), vibrant, crucial, foster, underscore, showcase, pivotal, testament, interplay, intricacies, garner, enhance, enduring
243
- - **No copula avoidance**: use "is/are/has" not "serves as/stands as/boasts/features"
244
- - **No em dashes**: replace with periods, commas, colons, or parentheses
245
- - **No signposting**: no "Let's dive in", "Here's what you need to know"
246
- - **No filler**: "In order to" → "To", "Due to the fact that" → "Because"
247
- - **No sycophancy**: no "Great question!", "Absolutely!", "I hope this helps!"
248
- - **Prefer**: plain verbs, specific details, varied sentence length, active voice
249
-
250
- Full 33-pattern reference: `.agents/skills/humanizer/references/patterns.md`
251
-
252
- ### Quick Reference
253
- - **Masters**: `orchestrator`, `project-planner`, `security-auditor`, `backend-specialist`, `frontend-specialist`, `mobile-developer`, `debugger`
254
- - **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
+ ## Agent skills
2
+
3
+ ### Support & issues
4
+
5
+ For bug reports, feature requests, or licensing questions, contact: `info.alphatechs.ai@gmail.com`
6
+
7
+ ### Issue tracker
8
+
9
+ Issues are tracked in GitLab Issues. See `docs/agents/issue-tracker.md`.
10
+
11
+ ### Triage labels
12
+
13
+ Default label vocabulary (needs-triage, needs-info, ready-for-agent, ready-for-human, wontfix). See `docs/agents/triage-labels.md`.
14
+
15
+ ### Domain docs
16
+
17
+ Single-context layout — one `CONTEXT.md` + `docs/adr/` at the repo root. See `docs/agents/domain.md`.
18
+
19
+ ### FE Web design (taste-skill)
20
+
21
+ Anti-slop frontend design skill for landing pages, portfolios, and redesigns.
22
+
23
+ - `ui-style-rules` — anti-slop design rules, typography, color calibration, layout discipline for code generation.
24
+ - `web-mockup-gen` — web design image/mockup generation (image-only, no code).
25
+
26
+ ### FE Mobile design
27
+
28
+ - `mobile-mockup-gen` — mobile app screen mockup generation (image-only, no code).
29
+ - `mobile-rules` — mobile-first design thinking (touch, performance, platform conventions).
30
+
31
+ ### Flutter development
32
+
33
+ Skills for Flutter architecture, testing, layout, routing, localization, and serialization.
34
+
35
+ Skills: `flutter-add-integration-test`, `flutter-add-widget-preview`, `flutter-add-widget-test`, `flutter-apply-architecture-best-practices`, `flutter-build-responsive-layout`, `flutter-fix-layout-issues`, `flutter-implement-json-serialization`, `flutter-setup-declarative-routing`, `flutter-setup-localization`, `flutter-use-http-package`.
36
+
37
+ ### MCP tools
38
+
39
+ Tool selection rules, index policies, memory conventions, and auto-skill activation. See `docs/agents/mcp-tools.md`.
40
+
41
+ **Quick reference:**
42
+ - Code search: `code_search` (default), `grep_search` (non-code only)
43
+ - Impact: `impact_analysis` (always update index first)
44
+ - Memory: `remember` / `recall` / `read_knowledge` (see conventions in mcp-tools.md)
45
+
46
+ ## APT session and execution contract
47
+
48
+ 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.
49
+ 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.
50
+ 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.
51
+ 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.
52
+ 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.
53
+ 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.
54
+ 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.
55
+ 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.
56
+ 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.
57
+ 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.
58
+
59
+ `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.
60
+
61
+ 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.
62
+
63
+
64
+ ## Auto-Trigger Skills (MANDATORY)
65
+
66
+ ### Workflow Skills — auto-trigger based on request type:
67
+
68
+ | Skill | Trigger Conditions | Agent Action |
69
+ |---|---|---|
70
+ | `spec-clarification` | Design decision, architecture choice, plan review, "should we X or Y?" | Load SKILL.md → Start alignment session |
71
+ | `bug-diagnostics` | Bug report, error log, "fails", "crashes", "/debug" | Load SKILL.md → Reproduce → minimise → hypothesise → fix |
72
+ | `task-breakdown` | Plan/PRD just completed, "break down", "create tickets" | Load SKILL.md → Convert plan to vertical-slice issues |
73
+ | `prd-gen` | New feature/product description with enough context for spec | Load SKILL.md → Extract PRD from conversation context |
74
+ | `prototype` | "mockup", "explore options", unclear UI/logic | Load SKILL.md → Pick branch (logic vs UI) → Build throwaway prototype |
75
+ | `tdd-loop` | Feature implementation, bug fix, "write tests", "red-green" | Load SKILL.md → Apply RED-GREEN-REFACTOR loop |
76
+
77
+ ### UI/UX Design Skills — auto-trigger when touching UI/design:
78
+
79
+ | Skill | Trigger Conditions | Agent Action |
80
+ |---|---|---|
81
+ | `ui-style-rules` | Any web UI task: page layout, component styling, redesign | Load SKILL.md → Apply anti-slop design rules |
82
+ | `web-mockup-gen` | "mockup web", "design page", web UI concept needed before coding | Load SKILL.md → Generate web design reference images (no code) |
83
+ | `mobile-mockup-gen` | "mockup app", "design screen", mobile UI concept needed before coding | Load SKILL.md → Generate mobile screen mockups in phone frames |
84
+ | `mobile-rules` | Any mobile UI implementation: Flutter widget, screen, touch interaction | Load SKILL.md → Apply platform conventions, touch patterns |
85
+ | `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 |
86
+ | `figma-handoff` | Figma URL detected (`figma.com/...`), "figma", "/figma", "code theo Figma" (khi figma preset active) | Load SKILL.md → Extract design → generate code |
87
+ | `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 |
88
+ | `flutter-fix-layout-issues` | "overflow", "unbounded height", `RenderFlex`, layout constraint error | Load SKILL.md → Fix overflow/constraint issues |
89
+ | `flutter-build-responsive-layout` | "responsive", "tablet", "media query", adaptive layout | Load SKILL.md → Build adaptive layout |
90
+ | `flutter-setup-declarative-routing` | "routing", "deep link", "go_router", URL navigation | Load SKILL.md → Configure declarative routing |
91
+ | `flutter-add-widget-test` | "widget test", "test component", "verify UI rendering" | Load SKILL.md → Write widget test |
92
+ | `flutter-add-integration-test` | "integration test", "e2e", "app test", "Flutter Driver" | Load SKILL.md → Add integration test |
93
+ | `flutter-implement-json-serialization` | "fromJson", "toJson", "model class", "API response mapping" | Load SKILL.md → Create JSON serialization |
94
+ | `flutter-setup-localization` | "localization", "i18n", "intl", "translation", ".arb" | Load SKILL.md → Setup l10n |
95
+ | `flutter-apply-architecture-best-practices` | "architecture", "clean arch", "layer", project structure | Load SKILL.md → Apply layered architecture |
96
+ | `flutter-add-widget-preview` | "preview", "widget catalog", "golden test" | Load SKILL.md → Add widget preview |
97
+ | `flutter-use-http-package` | "http request", "REST API", "fetch data", "GET/POST" | Load SKILL.md → Use http package |
98
+
99
+ ### Productivity & Utility Skills — auto-trigger based on task context:
100
+
101
+ | Skill | Trigger Conditions | Agent Action |
102
+ |---|---|---|
103
+ | `stress-test-plan` | "grill me", "challenge my plan", stress testing proposed plan | Load SKILL.md → Start interactive plan stress-testing session |
104
+ | `skill-generator` | "write skill", "create skill", building a new custom agent skill | Load SKILL.md → Generate new skill stub/directory |
105
+ | `git-safety-guardrails` | "git guardrails", "block dangerous git", protect git hooks | Load SKILL.md → Deploy Claude Code hooks to block push/hard-reset |
106
+ | `git-hook-setup` | "setup pre-commit", "configure husky", install pre-commit hooks | Load SKILL.md → Install Husky, lint-staged, Prettier hooks |
107
+ | `test-type-migration` | "migrate as in tests", "replace as assertions", shoehorn refactoring | Load SKILL.md → Refactor tests to remove unsafe type assertions |
108
+ | `exercise-scaffold` | "scaffold exercises", "exercise stubs", coding course setup | Load SKILL.md → Create problems, solutions, and tests stubs |
109
+ | `interactive-teaching` | "teach me", "tutorial", "learn Y", stateful workspace learning | Load SKILL.md → Create mission, lessons, and learning records |
110
+ | `writing-flow` | "writing beats", "narrative journey", write article step-by-step | Load SKILL.md → Guide user through choice of narrative beats |
111
+ | `raw-idea-collector` | "collect ideas", "writing fragments", ideate outline | Load SKILL.md → Collect heterogeneous claims, vignettes, and thoughts |
112
+ | `draft-shaper` | "shape draft", "edit notes", clean draft to publishable quality | Load SKILL.md → Iterate paragraph by paragraph to edit draft |
113
+ | `humanizer` | "humanize", "remove AI writing", "anti-slop", "viết tự nhiên hơn" | Load SKILL.md → Scrub 33 AI-writing patterns, rewrite to human voice |
114
+
115
+ ### BA/QC Skills — auto-trigger for requirements analysis and testing:
116
+
117
+ | Skill | Trigger Conditions | Agent Action |
118
+ |---|---|---|
119
+ | `ba-urd-decomposer` | "URD", "phân rã URD", "danh sách tính năng", "feature list", .pdf file (BA context) | Load SKILL.md → Parse URD → output structured feature list |
120
+ | `ba-clarification-session` | "làm rõ yêu cầu", "clarify", "hỏi PO", "session làm rõ", "clarification" | Load SKILL.md → Generate Q&A questions for PO session |
121
+ | `ba-specs-writer` | "viết specs", "đặc tả", "chi tiết tính năng", "tạo specs", "PTTK" | Load SKILL.md → Generate detailed Specs document |
122
+ | `ba-feature-tracker` | "tiến độ BA", "feature tracker", "trạng thái tính năng", "BA progress" | Load SKILL.md → Show BA progress dashboard |
123
+ | `ba-template-parser` | "mẫu BA", "import template", "learn template", .docx file (BA context) | Load SKILL.md → Learn customer template structure |
124
+ | `ba-requirements-generator` | "BRD", "user story", "viết yêu cầu", "sinh BRD", "tạo BRD" | Load SKILL.md → Generate BRD/User Story document |
125
+ | `pdf-specs-parser` | "parse PDF specs", "đọc PTTK", .pdf file (specs context) | Load SKILL.md → Extract API/UI field definitions |
126
+ | `qc-template-parser` | "mẫu QC", "import QC template", "mẫu testcase", .xlsx file (QC context) | Load SKILL.md → Learn Excel testcase template |
127
+ | `qc-bidv-workflow` | "tạo testcase BIDV", "QC workflow", "sinh test case từ specs" | Load SKILL.md → Run BIDV QC pipeline end-to-end |
128
+ | `testcase-generator` | "sinh test case", "generate TCs", "tạo testcase", "xuất Excel testcase" | Load SKILL.md → Generate Excel testcase from JSON |
129
+ | `mindmap-reader` | "mindmap", "xmind", "đọc mindmap", .xmind/.mm file | Load SKILL.md → Parse mindmap → Normalized Test Scenario JSON |
130
+ | `specs-to-mindmap` | "specs sang mindmap", "tạo outline từ specs", "test hierarchy" | Load SKILL.md → Convert Specs → Markdown outline |
131
+ | `requirement-coverage` | "bao phủ yêu cầu", "traceability", "coverage report" | Load SKILL.md → Cross-reference user stories vs test cases |
132
+ | `webapp-testing` | "E2E test", "Playwright", "test trình duyệt", "test tự động web" | Load SKILL.md → E2E/Playwright deep audit |
133
+
134
+ **Failure Conditions:**
135
+ - ❌ Writing UI code without loading design skill = **SLOP RISK**
136
+ - ❌ Creating mobile screen without `mobile-rules` = **PLATFORM VIOLATION**
137
+
138
+ ### ⚠️ DOMAIN SKILL LOADING (CRITICAL — DO NOT SKIP)
139
+
140
+ Before writing ANY UI, design, or visual code:
141
+ 1. **Web UI** → READ `.agents/skills/ui-style-rules/SKILL.md` — MANDATORY
142
+ 2. **Mobile UI** → READ `.agents/skills/mobile-rules/SKILL.md` — MANDATORY
143
+ 3. **Image/asset gen (web)** → READ `.agents/skills/web-mockup-gen/SKILL.md`
144
+ 4. **Image/asset gen (mobile)** → READ `.agents/skills/mobile-mockup-gen/SKILL.md`
145
+ 5. **Architecture decision** → READ `.agents/skills/stress-test-plan/SKILL.md`
146
+
147
+ **Violation = SLOP output. Writing UI code without design skill = P0 violation.**
148
+
149
+ ---
150
+
151
+ ## Clarification
152
+
153
+ Ask only questions that resolve material uncertainty. Reuse established answers.
154
+
155
+ ## Universal Rules
156
+
157
+ ### Clean Code (Global Mandatory)
158
+ - **Code**: Concise, direct, no over-engineering. Self-documenting.
159
+ - **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.
160
+ - **Bug Fix**: Root cause, not symptom. Grep every caller, fix the shared function once.
161
+ - **No Bloat**: No unrequested abstractions, no scaffolding "for later", deletion > addition, fewest files.
162
+ - **Testing**: Mandatory. Pyramid (Unit > Int > E2E) + AAA Pattern.
163
+ - **Performance**: Measure first. Adhere to current Core Web Vitals standards.
164
+
165
+ ### Anti-Slop Writing (Global Mandatory)
166
+
167
+ When generating **any prose content** (.md, .docx, PRDs, specs, articles, BA docs, commit messages, PR descriptions), automatically avoid AI-writing patterns:
168
+ - **Ban list**: delve, tapestry, landscape (abstract), vibrant, crucial, foster, underscore, showcase, pivotal, testament, interplay, intricacies, garner, enhance, enduring
169
+ - **No copula avoidance**: use "is/are/has" not "serves as/stands as/boasts/features"
170
+ - **No em dashes**: replace with periods, commas, colons, or parentheses
171
+ - **No signposting**: no "Let's dive in", "Here's what you need to know"
172
+ - **No filler**: "In order to" → "To", "Due to the fact that" → "Because"
173
+ - **No sycophancy**: no "Great question!", "Absolutely!", "I hope this helps!"
174
+ - **Prefer**: plain verbs, specific details, varied sentence length, active voice
175
+
176
+ Full 33-pattern reference: `.agents/skills/humanizer/references/patterns.md`
177
+
178
+ ### Quick Reference
179
+ - **Masters**: `orchestrator`, `project-planner`, `security-auditor`, `backend-specialist`, `frontend-specialist`, `mobile-developer`, `debugger`
180
+ - **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`