apt-mcp-agent-setup 2.0.1 → 3.0.1
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/cli.js +1 -1
- package/bundle/NOTICES.md +0 -0
- package/bundle/core.enc +0 -0
- package/bundle/mcp-rules.enc +0 -0
- package/bundle/skills-aso.enc +0 -0
- package/bundle/skills-ba.enc +0 -0
- package/bundle/skills-base.enc +0 -0
- package/bundle/skills-be.enc +0 -0
- package/bundle/skills-design.enc +0 -0
- package/bundle/skills-fe.enc +0 -0
- package/bundle/skills-mobile.enc +0 -0
- package/bundle/skills-pm.enc +0 -0
- package/integrity-manifest.json +63 -17
- package/package.json +1 -1
- package/src/core/catalog.js +1 -0
- package/src/core/context-metrics.js +1 -0
- package/src/core/doctor.js +1 -0
- package/src/core/execution.js +1 -0
- package/src/core/hook-bridge.js +1 -0
- package/src/core/host-adapters.js +1 -0
- package/src/core/memory-store.js +1 -0
- package/src/core/model-routing.js +1 -0
- package/src/core/owned-lock.js +1 -0
- package/src/core/session.js +1 -0
- package/src/core/skill-names.js +1 -0
- package/src/installer/context-legacy-hashes.json +42 -0
- package/src/installer/global-setup.js +1 -1
- package/src/installer/host-hooks.js +1 -0
- package/src/installer/managed-config.js +1 -0
- package/src/installer/platform-config.js +1 -1
- package/src/installer/prerequisites.js +1 -1
- package/src/installer/project-setup.js +1 -1
- package/src/installer/runtime-launcher.js +1 -0
- package/src/installer/runtime-lock.js +1 -0
- package/src/installer/runtime-store.js +1 -0
- package/src/installer/setup-wizard.js +1 -1
- package/src/license/crypto.js +1 -1
- package/src/license/fingerprint.js +1 -1
- package/src/license/terms.js +1 -1
- package/src/license/verify.js +1 -1
- package/src/presets/index.js +1 -1
- package/src/proxy/backends.js +1 -1
- package/src/proxy/core-tools.js +1 -0
- package/src/proxy/pipeline.js +1 -1
- package/src/proxy/router.config.js +1 -1
- package/src/proxy/router.js +1 -1
- package/src/proxy/server.js +1 -1
- package/src/templates/AGENTS.md +13 -181
- package/src/templates/CLAUDE.md +7 -248
- package/src/templates/GEMINI.md +12 -293
- package/src/templates/apt-runtime.md +16 -0
- package/src/templates/copilot-instructions.md +7 -208
- package/src/templates/cursorrules.mdc +8 -222
- package/src/templates/mcp-tools.md +176 -175
- package/src/templates/windsurfrules.md +7 -208
package/src/templates/CLAUDE.md
CHANGED
|
@@ -1,254 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
# APT workspace contract
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
At session start and after context recovery, call `session_bootstrap` for this workspace and read `docs/agents/apt-runtime.md` once per context. Read project conventions in `.agents/memory/MEMORY.md`; retrieve only relevant dynamic memory. Report unavailable backends once and use available fallbacks.
|
|
4
4
|
|
|
5
|
-
For
|
|
5
|
+
For new or changed intent, call `route_request` with the target, stack and explicit skills. Use `skill_load` for selected skills and current-step references. Do not load the full trigger catalog or repeat rules on every tool call.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Before code changes, bind `pipeline_status` and `pipeline_start` or `pipeline_use` to an explicit task, runId and workspace. Reserve with `pipeline_next`; verify and checkpoint current code before completion. Read-only questions, review and existing tests need no code-change pipeline. Clarify only unresolved decisions.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Use at most four actors including the coordinator and one writer per workspace. Respect host permissions, Plan Mode and user stops. Never claim independent review or native enforcement without observed capability. Keep attempts and evidence across resume; do not reset exhausted budgets.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Preserve custom files. Write concise code and prose, run suitable checks, and review staged, unstaged and relevant new files. Publishing, merging and external messages require authorization. Strong caveman style is opt-in.
|
|
12
12
|
|
|
13
|
-
|
|
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`
|
|
13
|
+
Tool interfaces: `docs/agents/mcp-tools.md`. Project/domain and issue conventions: `docs/agents/domain.md` and `docs/agents/issue-tracker.md`. Support: info.alphatechs.ai@gmail.com.
|
package/src/templates/GEMINI.md
CHANGED
|
@@ -1,294 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
trigger: always_on
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# GEMINI.md - AG Kit
|
|
6
|
-
|
|
7
|
-
> This file defines how the AI behaves in this workspace.
|
|
8
|
-
|
|
9
|
-
---
|
|
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 the 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
|
-
## CRITICAL: AGENT & SKILL PROTOCOL (START HERE)
|
|
42
|
-
|
|
43
|
-
> **MANDATORY:** You MUST read the appropriate agent file and its skills BEFORE performing any implementation. This is the highest priority rule.
|
|
44
|
-
|
|
45
|
-
### 🗺️ System Map & Memory Read (MANDATORY at session start)
|
|
46
|
-
1. Read `.agents/ARCHITECTURE.md` to understand Agents, Skills, and Scripts.
|
|
47
|
-
2. Read `.agents/memory/MEMORY.md` to load persistent project conventions, user preferences, and tech decisions.
|
|
48
|
-
3. Read `docs/agents/mcp-tools.md` to load MCP tool selection rules & memory conventions.
|
|
49
|
-
4. Call `read_knowledge` to load dynamic knowledge graph from memory.
|
|
50
|
-
5. **Read `.agents/skill-triggers.json` to load auto-routing rules for all skills/workflows/tools.**
|
|
51
|
-
|
|
52
|
-
### 🔄 Context Recovery (MANDATORY after any context truncation/compression)
|
|
53
|
-
If your conversation context was truncated, compressed, or you are resuming after a checkpoint:
|
|
54
|
-
1. **Call `pipeline_status()` immediately** — it returns recovery instructions and tool reminders
|
|
55
|
-
2. Re-read the session start files above if not already in context
|
|
56
|
-
3. Classify the current user request before taking any code action
|
|
57
|
-
|
|
58
|
-
### ⚠️ MCP TOOL ACCESSIBILITY & FALLBACK WARNING (CRITICAL)
|
|
59
|
-
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:
|
|
60
|
-
- **DO NOT silently fall back to basic text search or skip debugging workflows.**
|
|
61
|
-
- **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.
|
|
62
|
-
- Only proceed with fallback tools (e.g. `grep_search`) if the user explicitly approves it.
|
|
63
|
-
|
|
64
|
-
### 🛠️ ENFORCED DEVELOPER PIPELINES (MANDATORY — MCP TOOL GATE)
|
|
65
|
-
|
|
66
|
-
Before writing any code or implementing features, you MUST follow one of the three enforced pipelines below.
|
|
67
|
-
**Start or bind a run with `pipeline_start(pipeline, task, workspace)` or `pipeline_use(task, runId)`.**
|
|
68
|
-
**After each step call `pipeline_checkpoint(task, runId, step, status="completed", summary)`.**
|
|
1
|
+
# APT workspace contract
|
|
69
2
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
5. **`/improve-codebase-architecture`** → Review and deepen architecture. Generate HTML report + grill-me session on codebase quality.
|
|
82
|
-
|
|
83
|
-
#### 🐛 Bug Fix Pipeline (5 steps — NO EXCEPTIONS, NO SKIP)
|
|
84
|
-
```
|
|
85
|
-
/diagnose → /grill-me → /to-prd → /to-issues → /tdd
|
|
86
|
-
```
|
|
87
|
-
1. **`/diagnose`** → Build feedback loop: reproduce → minimize → hypothesize → fix.
|
|
88
|
-
2. **`/grill-me`** → Challenge the fix design. Stress-test the proposed solution.
|
|
89
|
-
3. **`/to-prd`** → Document the fix as a formal PRD with root cause analysis.
|
|
90
|
-
4. **`/to-issues`** → Create tracking issues for the fix and any follow-up work.
|
|
91
|
-
5. **`/tdd`** → Write regression tests first, then implement the fix.
|
|
92
|
-
|
|
93
|
-
#### 🔧 Hotfix Pipeline (2 steps — for small, isolated changes ≤3 files)
|
|
94
|
-
```
|
|
95
|
-
/verify-scope → /fix-and-test
|
|
96
|
-
```
|
|
97
|
-
1. **`/verify-scope`** → Confirm change is small (≤3 files, no new API, no dependency changes). Provide scope justification in summary.
|
|
98
|
-
2. **`/fix-and-test`** → Apply fix + write regression test if applicable.
|
|
99
|
-
|
|
100
|
-
**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.
|
|
101
|
-
|
|
102
|
-
**ENFORCEMENT PROTOCOL:**
|
|
103
|
-
- After each step completion → call `pipeline_checkpoint(task, runId, step, "completed", summary)`
|
|
104
|
-
- Before each step start → call `pipeline_status(task, runId)`
|
|
105
|
-
- To cancel an active run → call `pipeline_reset(task, runId, confirm=true)`; history is preserved
|
|
106
|
-
- To run the same task again → call `pipeline_start` and use the new `runId`
|
|
107
|
-
- The MCP tool enforces ordering at runtime — out-of-order calls are **rejected with error**
|
|
108
|
-
- **Pipeline responses are terse. Follow `memory_action` and `skill_directive` fields immediately.**
|
|
109
|
-
|
|
110
|
-
### 🧠 Memory Auto-Save (MANDATORY after pipeline steps)
|
|
111
|
-
|
|
112
|
-
After completing pipeline steps, the checkpoint response includes a `memory_action` field.
|
|
113
|
-
**You MUST call the `remember` tool immediately** to save key decisions. Do NOT wait for user to ask.
|
|
114
|
-
|
|
115
|
-
| After Step | What to Save |
|
|
116
|
-
|---|---|
|
|
117
|
-
| `grill-me` | Design decisions + constraints |
|
|
118
|
-
| `diagnose` | Root cause + reproduction steps |
|
|
119
|
-
| `tdd` | Implementation decisions + test patterns |
|
|
120
|
-
| `improve-architecture` | Architecture improvements |
|
|
121
|
-
|
|
122
|
-
Also auto-save when: user states preference, non-trivial bug resolved, architecture decision made.
|
|
123
|
-
|
|
124
|
-
### 📖 Skill Auto-Loading (MANDATORY at pipeline step transitions)
|
|
125
|
-
|
|
126
|
-
Checkpoint responses include `skill_directive` field pointing to the SKILL.md for the **next** step.
|
|
127
|
-
**You MUST read that SKILL.md BEFORE starting the next step.** Skipping = P0 violation.
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
---
|
|
131
|
-
|
|
132
|
-
## 🤖 INTELLIGENT AGENT ROUTING
|
|
133
|
-
|
|
134
|
-
### Agent Routing Checklist
|
|
135
|
-
| Step | Check | If Unchecked |
|
|
136
|
-
|------|-------|--------------|
|
|
137
|
-
| 1 | Did I identify the correct agent for this domain? | → STOP. Analyze request domain first. |
|
|
138
|
-
| 2 | Did I READ the agent's `.md` file (or recall its rules)? | → STOP. Open `.agents/agent/{agent}.md` |
|
|
139
|
-
| 3 | Did I announce `🤖 Applying knowledge of @[agent]...`? | → STOP. Add announcement before response. |
|
|
140
|
-
| 4 | Did I load required skills from agent's frontmatter? | → STOP. Check `skills:` field and read them. |
|
|
141
|
-
| 5 | Did I check MCP tool selection rules? | → STOP. Read `docs/agents/mcp-tools.md` |
|
|
142
|
-
| 6 | Is this a UI task? Did I load design skill? | → STOP. Load appropriate design skill first |
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## 🎯 AUTO-TRIGGER SKILLS (MANDATORY)
|
|
147
|
-
|
|
148
|
-
Workflow Skills — tự trigger theo request type:
|
|
149
|
-
|
|
150
|
-
| Skill | Trigger Conditions | Agent Action |
|
|
151
|
-
|---|---|---|
|
|
152
|
-
| `spec-clarification` | Design decision, architecture choice, plan review, "should we X or Y?", "/plan" | Load SKILL.md → Start alignment session |
|
|
153
|
-
| `bug-diagnostics` | Bug report, error log, "bị lỗi", "không hoạt động", "fails", "crashes", "/debug" | Load SKILL.md → Reproduce → minimise → hypothesise → fix |
|
|
154
|
-
| `task-breakdown` | Plan/PRD just completed, "break down", "tách task", "create tickets", "/task-breakdown" | Load SKILL.md → Convert plan to vertical-slice issues |
|
|
155
|
-
| `prd-gen` | New feature/product description with enough context for spec, "/prd-gen" | Load SKILL.md → Extract PRD from conversation context |
|
|
156
|
-
| `prototype` | "thử xem", "mockup", "explore options", unclear UI/logic, "/prototype" | Load SKILL.md → Pick branch (logic vs UI) → Build throwaway prototype |
|
|
157
|
-
| `tdd-loop` | Feature implementation, bug fix, "write tests", "red-green", "/tdd" | Load SKILL.md → Apply RED-GREEN-REFACTOR loop |
|
|
158
|
-
|
|
159
|
-
UI/UX Design Skills — tự trigger khi touch UI/design:
|
|
160
|
-
|
|
161
|
-
| Skill | Trigger Conditions | Agent Action |
|
|
162
|
-
|---|---|---|
|
|
163
|
-
| `ui-style-rules` | Any web UI task: page layout, component styling, redesign, landing page | Load SKILL.md → Apply anti-slop design rules |
|
|
164
|
-
| `web-mockup-gen` | "mockup web", "design page", web UI concept needed before coding | Load SKILL.md → Generate web design reference images (no code) |
|
|
165
|
-
| `mobile-mockup-gen` | "mockup app", "design screen", mobile UI concept needed before coding | Load SKILL.md → Generate mobile screen mockups in phone frames |
|
|
166
|
-
| `mobile-rules` | Any mobile UI implementation: Flutter widget, screen, touch interaction | Load SKILL.md → Apply platform conventions, touch patterns, performance |
|
|
167
|
-
| `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 |
|
|
168
|
-
| `figma-handoff` | Figma URL detected (`figma.com/...`), "figma", "/figma", "code theo Figma" (khi figma preset active) | Load SKILL.md → Extract design → generate code |
|
|
169
|
-
| `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 |
|
|
170
|
-
| `flutter-fix-layout-issues` | "overflow", "unbounded height", `RenderFlex`, layout error | Load SKILL.md → Fix overflow/constraint issues |
|
|
171
|
-
| `flutter-build-responsive-layout` | "responsive", "tablet", "media query", adaptive layout | Load SKILL.md → Build adaptive layout |
|
|
172
|
-
| `flutter-setup-declarative-routing` | "routing", "deep link", "go_router", URL navigation | Load SKILL.md → Configure declarative routing |
|
|
173
|
-
| `flutter-add-widget-test` | "widget test", "test component", "verify UI rendering" | Load SKILL.md → Write widget test |
|
|
174
|
-
| `flutter-add-integration-test` | "integration test", "e2e", "Flutter Driver" | Load SKILL.md → Add integration test |
|
|
175
|
-
| `flutter-implement-json-serialization` | "fromJson", "toJson", "model class", API mapping | Load SKILL.md → Create JSON serialization |
|
|
176
|
-
| `flutter-setup-localization` | "localization", "i18n", "intl", ".arb" | Load SKILL.md → Setup l10n |
|
|
177
|
-
| `flutter-apply-architecture-best-practices` | "architecture", "layer", project structure | Load SKILL.md → Apply layered architecture |
|
|
178
|
-
| `flutter-add-widget-preview` | "preview", "widget catalog", "golden test" | Load SKILL.md → Add widget preview |
|
|
179
|
-
| `flutter-use-http-package` | "http request", "REST API", "fetch data" | Load SKILL.md → Use http package |
|
|
180
|
-
|
|
181
|
-
Productivity & Utility Skills — tự trigger theo task context:
|
|
182
|
-
|
|
183
|
-
| Skill | Trigger Conditions | Agent Action |
|
|
184
|
-
|---|---|---|
|
|
185
|
-
| `stress-test-plan` | "grill me", "challenge my plan", stress testing proposed plan | Load SKILL.md → Start interactive plan stress-testing session |
|
|
186
|
-
| `skill-generator` | "write skill", "create skill", building a new custom agent skill | Load SKILL.md → Generate new skill stub/directory |
|
|
187
|
-
| `git-safety-guardrails` | "git guardrails", "block dangerous git", protect git hooks | Load SKILL.md → Deploy Claude Code hooks to block push/hard-reset |
|
|
188
|
-
| `git-hook-setup` | "setup pre-commit", "configure husky", install pre-commit hooks | Load SKILL.md → Install Husky, lint-staged, Prettier hooks |
|
|
189
|
-
| `test-type-migration` | "migrate as in tests", "replace as assertions", shoehorn refactoring | Load SKILL.md → Refactor tests to remove unsafe type assertions |
|
|
190
|
-
| `exercise-scaffold` | "scaffold exercises", "exercise stubs", coding course setup | Load SKILL.md → Create problems, solutions, and tests stubs |
|
|
191
|
-
| `interactive-teaching` | "teach me", "tutorial", "learn Y", stateful workspace learning | Load SKILL.md → Create mission, lessons, and learning records |
|
|
192
|
-
| `writing-flow` | "writing beats", "narrative journey", write article step-by-step | Load SKILL.md → Guide user through choice of narrative beats |
|
|
193
|
-
| `raw-idea-collector` | "collect ideas", "writing fragments", ideate outline | Load SKILL.md → Collect heterogeneous claims, vignettes, and thoughts |
|
|
194
|
-
| `draft-shaper` | "shape draft", "edit notes", clean draft to publishable quality | Load SKILL.md → Iterate paragraph by paragraph to edit draft |
|
|
195
|
-
| `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 |
|
|
196
|
-
|
|
197
|
-
BA/QC Skills — tự trigger cho phân tích yêu cầu và testing:
|
|
198
|
-
|
|
199
|
-
| Skill | Trigger Conditions | Agent Action |
|
|
200
|
-
|---|---|---|
|
|
201
|
-
| `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 |
|
|
202
|
-
| `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 |
|
|
203
|
-
| `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 |
|
|
204
|
-
| `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 |
|
|
205
|
-
| `ba-template-parser` | "mẫu BA", "import template", "learn template", .docx file (BA context) | Load SKILL.md → Learn customer template structure |
|
|
206
|
-
| `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 |
|
|
207
|
-
| `pdf-specs-parser` | "parse PDF specs", "đọc PTTK", .pdf file (specs context) | Load SKILL.md → Extract API/UI field definitions |
|
|
208
|
-
| `qc-template-parser` | "mẫu QC", "import QC template", "mẫu testcase", .xlsx file (QC context) | Load SKILL.md → Learn Excel testcase template |
|
|
209
|
-
| `qc-bidv-workflow` | "tạo testcase BIDV", "QC workflow", "sinh test case từ specs" | Load SKILL.md → Run BIDV QC pipeline end-to-end |
|
|
210
|
-
| `testcase-generator` | "sinh test case", "generate TCs", "tạo testcase", "xuất Excel testcase" | Load SKILL.md → Generate Excel testcase from JSON |
|
|
211
|
-
| `mindmap-reader` | "mindmap", "xmind", "đọc mindmap", .xmind/.mm file | Load SKILL.md → Parse mindmap → Normalized Test Scenario JSON |
|
|
212
|
-
| `specs-to-mindmap` | "specs sang mindmap", "tạo outline từ specs", "test hierarchy" | Load SKILL.md → Convert Specs → Markdown outline |
|
|
213
|
-
| `requirement-coverage` | "bao phủ yêu cầu", "traceability", "coverage report" | Load SKILL.md → Cross-reference user stories vs test cases |
|
|
214
|
-
| `webapp-testing` | "E2E test", "Playwright", "test trình duyệt", "test tự động web" | Load SKILL.md → E2E/Playwright deep audit |
|
|
215
|
-
|
|
216
|
-
### UI/UX Auto-Detection Rules
|
|
217
|
-
- **mobile-flutter preset**: Load `mobile-rules` + `ui-style-rules` (adapted) + `mobile-mockup-gen` + matching flutter skill from table above
|
|
218
|
-
- **fe-react / fe-angular / fe-vue presets**: Load `ui-style-rules` + `web-mockup-gen`
|
|
219
|
-
- **aso preset**: Load `aso-router` + matching `aso-*` skills
|
|
220
|
-
- **system preset**: All of the above based on file context
|
|
221
|
-
|
|
222
|
-
**Failure Condition:**
|
|
223
|
-
- ❌ Writing UI code without loading design skill = **SLOP RISK**
|
|
224
|
-
- ❌ Creating mobile screen without `mobile-rules` = **PLATFORM VIOLATION**
|
|
225
|
-
- ❌ Designing web page without `ui-style-rules` = **GENERIC OUTPUT**
|
|
226
|
-
|
|
227
|
-
### ⚠️ DOMAIN SKILL LOADING (CRITICAL — DO NOT SKIP)
|
|
228
|
-
|
|
229
|
-
Before writing ANY UI, design, or visual code:
|
|
230
|
-
1. **Web UI** → READ `.agents/skills/ui-style-rules/SKILL.md` — MANDATORY
|
|
231
|
-
2. **Mobile UI** → READ `.agents/skills/mobile-rules/SKILL.md` — MANDATORY
|
|
232
|
-
3. **Image/asset gen (web)** → READ `.agents/skills/web-mockup-gen/SKILL.md`
|
|
233
|
-
4. **Image/asset gen (mobile)** → READ `.agents/skills/mobile-mockup-gen/SKILL.md`
|
|
234
|
-
5. **Architecture decision** → READ `.agents/skills/stress-test-plan/SKILL.md`
|
|
235
|
-
|
|
236
|
-
**Violation = SLOP output. Writing UI code without design skill = P0 violation.**
|
|
237
|
-
|
|
238
|
-
---
|
|
239
|
-
|
|
240
|
-
## 🛑 GLOBAL SOCRATIC GATE (TIER 0)
|
|
241
|
-
|
|
242
|
-
Every user request must pass through the Socratic Gate before ANY tool use or implementation:
|
|
243
|
-
|
|
244
|
-
| Request Type | Strategy | Required Action |
|
|
245
|
-
|---|---|---|
|
|
246
|
-
| **New Feature / Build** | Deep Discovery | ASK minimum 3 strategic questions |
|
|
247
|
-
| **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions |
|
|
248
|
-
| **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope |
|
|
249
|
-
| **Full Orchestration** | Gatekeeper | **STOP** subagents until user confirms plan details |
|
|
250
|
-
| **Direct "Proceed"** | Validation | **STOP** → Even if answers are given, ask 2 "Edge Case" questions |
|
|
251
|
-
|
|
252
|
-
> [!IMPORTANT]
|
|
253
|
-
> **STRICT SOCRATIC & WORKFLOW ENFORCEMENT:**
|
|
254
|
-
> - **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.
|
|
255
|
-
> - **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.
|
|
256
|
-
|
|
257
|
-
---
|
|
258
|
-
|
|
259
|
-
## TIER 0: UNIVERSAL RULES
|
|
260
|
-
|
|
261
|
-
### 🧹 Clean Code (Global Mandatory)
|
|
262
|
-
- **Code**: Concise, direct, no over-engineering. Self-documenting.
|
|
263
|
-
- **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.
|
|
264
|
-
- **Bug Fix**: Root cause, not symptom. Grep every caller, fix the shared function once.
|
|
265
|
-
- **No Bloat**: No unrequested abstractions, no scaffolding "for later", deletion > addition, fewest files.
|
|
266
|
-
- **Testing**: Mandatory. Pyramid (Unit > Int > E2E) + AAA Pattern.
|
|
267
|
-
- **Performance**: Measure first. Adhere to current Core Web Vitals standards.
|
|
268
|
-
|
|
269
|
-
### ✍️ Anti-Slop Writing (Global Mandatory)
|
|
270
|
-
|
|
271
|
-
When generating **any prose content** (.md, .docx, PRDs, specs, articles, BA docs, commit messages, PR descriptions), automatically apply these rules. No user invocation needed.
|
|
272
|
-
|
|
273
|
-
**Always avoid:**
|
|
274
|
-
- **AI vocabulary**: delve, tapestry, landscape (abstract), vibrant, crucial, foster, underscore, showcase, pivotal, testament, interplay, intricacies, garner, enhance, enduring
|
|
275
|
-
- **Significance inflation**: "marking a pivotal moment", "serves as a testament", "setting the stage for"
|
|
276
|
-
- **Copula avoidance**: use "is/are/has" not "serves as/stands as/boasts/features"
|
|
277
|
-
- **Em dashes**: replace with periods, commas, colons, or parentheses
|
|
278
|
-
- **Rule of three**: don't force ideas into groups of three
|
|
279
|
-
- **Sycophantic tone**: no "Great question!", "Absolutely!", "I hope this helps!"
|
|
280
|
-
- **Signposting**: no "Let's dive in", "Here's what you need to know", "Without further ado"
|
|
281
|
-
- **Filler phrases**: "In order to" → "To", "Due to the fact that" → "Because", "It is important to note that" → cut
|
|
282
|
-
- **Promotional language**: no "groundbreaking", "nestled", "breathtaking", "stunning"
|
|
283
|
-
- **Boldface overuse**: don't mechanically bold every key term
|
|
284
|
-
- **Generic positive conclusions**: end on the last concrete fact, not a send-off
|
|
285
|
-
|
|
286
|
-
**Always prefer:** plain verbs, specific details over vague claims, varied sentence length, active voice when clearer.
|
|
287
|
-
|
|
288
|
-
**Scope:** Applies to all prose output. Does NOT apply to code, data, or quoted text. For dedicated rewriting of existing text, use the full `/humanizer` skill with its 33-pattern audit.
|
|
289
|
-
|
|
290
|
-
> Full pattern reference: `.agents/skills/humanizer/references/patterns.md`
|
|
291
|
-
|
|
292
|
-
### 🗺️ Quick Reference
|
|
293
|
-
- **Masters**: `orchestrator`, `project-planner`, `security-auditor`, `backend-specialist`, `frontend-specialist`, `mobile-developer`, `aso-specialist`, `debugger`
|
|
294
|
-
- **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`, `aso-router`, `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`
|
|
3
|
+
At session start and after context recovery, call `session_bootstrap` for this workspace and read `docs/agents/apt-runtime.md` once per context. Read project conventions in `.agents/memory/MEMORY.md`; retrieve only relevant dynamic memory. Report unavailable backends once and use available fallbacks.
|
|
4
|
+
|
|
5
|
+
For new or changed intent, call `route_request` with the target, stack and explicit skills. Use `skill_load` for selected skills and current-step references. Do not load the full trigger catalog or repeat rules on every tool call.
|
|
6
|
+
|
|
7
|
+
Before code changes, bind `pipeline_status` and `pipeline_start` or `pipeline_use` to an explicit task, runId and workspace. Reserve with `pipeline_next`; verify and checkpoint current code before completion. Read-only questions, review and existing tests need no code-change pipeline. Clarify only unresolved decisions.
|
|
8
|
+
|
|
9
|
+
Use at most four actors including the coordinator and one writer per workspace. Respect host permissions, Plan Mode and user stops. Never claim independent review or native enforcement without observed capability. Keep attempts and evidence across resume; do not reset exhausted budgets.
|
|
10
|
+
|
|
11
|
+
Preserve custom files. Write concise code and prose, run suitable checks, and review staged, unstaged and relevant new files. Publishing, merging and external messages require authorization. Strong caveman style is opt-in.
|
|
12
|
+
|
|
13
|
+
Tool interfaces: `docs/agents/mcp-tools.md`. Project/domain and issue conventions: `docs/agents/domain.md` and `docs/agents/issue-tracker.md`. Support: info.alphatechs.ai@gmail.com.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# APT session and execution contract
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
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.
|
|
5
|
+
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.
|
|
6
|
+
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.
|
|
7
|
+
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.
|
|
8
|
+
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.
|
|
9
|
+
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.
|
|
10
|
+
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.
|
|
11
|
+
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.
|
|
12
|
+
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.
|
|
13
|
+
|
|
14
|
+
`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.
|
|
15
|
+
|
|
16
|
+
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.
|