anchi-kit 1.2.0 → 1.2.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.
Files changed (80) hide show
  1. package/.antigravity/skills/article-extractor/SKILL.md +52 -0
  2. package/.antigravity/skills/artifacts-builder/SKILL.md +63 -0
  3. package/.antigravity/skills/aws-deployment/SKILL.md +85 -0
  4. package/.antigravity/skills/brainstorming/SKILL.md +73 -0
  5. package/.antigravity/skills/canvas-design/SKILL.md +62 -0
  6. package/.antigravity/skills/changelog-generator/SKILL.md +149 -0
  7. package/.antigravity/skills/changelog-generator/assets/changelog-template.md +60 -0
  8. package/.antigravity/skills/changelog-generator/scripts/generate-changelog.js +181 -0
  9. package/.antigravity/skills/claude-code/references/advanced-features.md +399 -0
  10. package/.antigravity/skills/claude-code/references/agent-skills.md +399 -0
  11. package/.antigravity/skills/claude-code/references/api-reference.md +498 -0
  12. package/.antigravity/skills/claude-code/references/best-practices.md +447 -0
  13. package/.antigravity/skills/claude-code/references/cicd-integration.md +428 -0
  14. package/.antigravity/skills/claude-code/references/common-workflows.md +119 -0
  15. package/.antigravity/skills/claude-code/references/configuration.md +480 -0
  16. package/.antigravity/skills/claude-code/references/enterprise-features.md +472 -0
  17. package/.antigravity/skills/claude-code/references/getting-started.md +252 -0
  18. package/.antigravity/skills/claude-code/references/hooks-and-plugins.md +444 -0
  19. package/.antigravity/skills/claude-code/references/hooks-comprehensive.md +622 -0
  20. package/.antigravity/skills/claude-code/references/ide-integration.md +316 -0
  21. package/.antigravity/skills/claude-code/references/mcp-integration.md +386 -0
  22. package/.antigravity/skills/claude-code/references/slash-commands.md +489 -0
  23. package/.antigravity/skills/claude-code/references/troubleshooting.md +456 -0
  24. package/.antigravity/skills/claude-code/skill.md +60 -0
  25. package/.antigravity/skills/code-quality/SKILL.md +273 -0
  26. package/.antigravity/skills/comprehensive-review/complexity.md +11 -0
  27. package/.antigravity/skills/comprehensive-review/index.yaml +19 -0
  28. package/.antigravity/skills/comprehensive-review/maintainability.md +12 -0
  29. package/.antigravity/skills/comprehensive-review/readability.md +12 -0
  30. package/.antigravity/skills/content-research-writer/SKILL.md +65 -0
  31. package/.antigravity/skills/csv-data-analyzer/SKILL.md +91 -0
  32. package/.antigravity/skills/d3-visualization/SKILL.md +65 -0
  33. package/.antigravity/skills/debugging/references/root-cause-analysis-methods.md +140 -0
  34. package/.antigravity/skills/engineering-discipline/incremental-change.md +15 -0
  35. package/.antigravity/skills/engineering-discipline/index.yaml +30 -0
  36. package/.antigravity/skills/engineering-discipline/planning-first.md +18 -0
  37. package/.antigravity/skills/engineering-discipline/reasoning-clarity.md +19 -0
  38. package/.antigravity/skills/engineering-discipline/verify-before-commit.md +17 -0
  39. package/.antigravity/skills/file-organizer/SKILL.md +64 -0
  40. package/.antigravity/skills/git-automation/SKILL.md +68 -0
  41. package/.antigravity/skills/git-automation/references/branch-finishing.md +64 -0
  42. package/.antigravity/skills/impact-scoring/SKILL.md +219 -0
  43. package/.antigravity/skills/kaizen/SKILL.md +94 -0
  44. package/.antigravity/skills/performance-patterns/SKILL.md +209 -0
  45. package/.antigravity/skills/playwright-testing/SKILL.md +115 -0
  46. package/.antigravity/skills/playwright-testing/references/playwright-patterns.md +122 -0
  47. package/.antigravity/skills/prompt-engineering/SKILL.md +126 -0
  48. package/.antigravity/skills/prompt-engineering/references/anthropic-best-practices.md +160 -0
  49. package/.antigravity/skills/pypict-testing/SKILL.md +79 -0
  50. package/.antigravity/skills/review-implementing/SKILL.md +287 -0
  51. package/.antigravity/skills/security-audit/SKILL.md +263 -0
  52. package/.antigravity/skills/software-architecture/SKILL.md +91 -0
  53. package/.antigravity/skills/software-architecture/references/solid-principles.md +293 -0
  54. package/.antigravity/skills/subagent-driven-development/SKILL.md +237 -0
  55. package/.antigravity/skills/test-driven-development/SKILL.md +130 -0
  56. package/.antigravity/skills/test-driven-development/references/tdd-patterns.md +124 -0
  57. package/.antigravity/skills/test-driven-development/references/testing-strategies.md +131 -0
  58. package/.antigravity/skills/test-fixing/SKILL.md +256 -0
  59. package/.antigravity/skills/theme-factory/SKILL.md +63 -0
  60. package/.antigravity/workflows/clean.md +333 -0
  61. package/.antigravity/workflows/health.md +228 -0
  62. package/.cursor/skills/_packs/common/pack-architecture.md +40 -0
  63. package/.cursor/skills/_packs/common/pack-devops.md +43 -0
  64. package/.cursor/skills/_packs/common/pack-productivity.md +37 -0
  65. package/.cursor/skills/_packs/common/pack-quality.md +41 -0
  66. package/.cursor/skills/_packs/data/pack-ai.md +41 -0
  67. package/.cursor/skills/_packs/data/pack-data-science.md +36 -0
  68. package/.cursor/skills/_packs/mobile/pack-mobile.md +40 -0
  69. package/.cursor/skills/_packs/web/pack-backend.md +61 -0
  70. package/.cursor/skills/_packs/web/pack-frontend.md +66 -0
  71. package/.cursor/skills/_packs/web3/pack-blockchain.md +37 -0
  72. package/.cursor/skills/advanced-coding/references/getting-started.md +93 -0
  73. package/.cursor/skills/advanced-coding/skill.md +34 -0
  74. package/.cursor/skills/template-skill/SKILL.md +6 -0
  75. package/README.md +1 -1
  76. package/docs/reference/SECURITY.md +1 -1
  77. package/package.json +2 -2
  78. package/src/cli.js +5 -5
  79. package/src/commands/dashboard.js +3 -3
  80. package/src/commands/init.js +15 -3
@@ -0,0 +1,228 @@
1
+ ---
2
+ description: 🏥 Project health check - Security, Performance, Bugs, Tests
3
+ argument-hint: [optional: --robot for JSON output]
4
+ ---
5
+
6
+ # /health - Project Health Check
7
+
8
+ **Proactive health monitoring for your codebase.**
9
+
10
+ ---
11
+
12
+ ## 🧠 EXECUTION FLOW
13
+
14
+ ```
15
+ STEP 1: SCAN PROJECT
16
+ → Analyze package.json, config files, source code
17
+
18
+ STEP 2: RUN CHECKS
19
+ → Security: dependencies, secrets, auth patterns
20
+ → Performance: N+1, caching, pagination
21
+ → Bugs: error handling, edge cases, types
22
+ → Tests: coverage, failing tests
23
+
24
+ STEP 3: CALCULATE HEALTH SCORE
25
+ → Each category: 0-100
26
+ → Overall: weighted average
27
+
28
+ STEP 4: GENERATE RECOMMENDATIONS
29
+ → Priority-ordered action items
30
+
31
+ STEP 5: OUTPUT
32
+ → Box format (default) or JSON (--robot)
33
+ ```
34
+
35
+ ---
36
+
37
+ ## 📋 OUTPUT FORMAT (Default)
38
+
39
+ ```
40
+ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
41
+ ┃ 🏥 PROJECT HEALTH ┃
42
+ ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
43
+ ┃ 📁 Project: {project_name} ┃
44
+ ┃ 📊 Health Score: {score}/100 ┃
45
+ ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
46
+ ┃ 🔐 Security: {✅ OK | ⚠️ Warning | ❌ Critical}┃
47
+ ┃ ⚡ Performance: {status} ┃
48
+ ┃ 🐛 Bugs: {status} ┃
49
+ ┃ 🧪 Tests: {coverage}% coverage ┃
50
+ ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
51
+ ┃ 💡 Recommendations: ┃
52
+ ┃ 1. {recommendation_1} ┃
53
+ ┃ 2. {recommendation_2} ┃
54
+ ┃ 3. {recommendation_3} ┃
55
+ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
56
+ ```
57
+
58
+ ---
59
+
60
+ ## 🤖 ROBOT PROTOCOL (--robot flag)
61
+
62
+ For AI agent consumption:
63
+
64
+ ```json
65
+ {
66
+ "command": "/health",
67
+ "timestamp": "2024-12-28T22:30:00Z",
68
+ "project": {
69
+ "name": "my-app",
70
+ "path": "/path/to/project",
71
+ "stack": ["nextjs", "prisma", "typescript"]
72
+ },
73
+ "health": {
74
+ "overall": 78,
75
+ "security": {
76
+ "score": 85,
77
+ "status": "ok",
78
+ "issues": []
79
+ },
80
+ "performance": {
81
+ "score": 65,
82
+ "status": "warning",
83
+ "issues": [
84
+ { "type": "n_plus_one", "file": "src/api/users.ts", "line": 45 },
85
+ { "type": "missing_pagination", "file": "src/api/posts.ts" }
86
+ ]
87
+ },
88
+ "bugs": {
89
+ "score": 80,
90
+ "status": "ok",
91
+ "issues": []
92
+ },
93
+ "tests": {
94
+ "score": 78,
95
+ "coverage": 78,
96
+ "passing": 45,
97
+ "failing": 2,
98
+ "skipped": 3
99
+ }
100
+ },
101
+ "recommendations": [
102
+ {
103
+ "priority": 1,
104
+ "category": "performance",
105
+ "action": "Fix N+1 query in users API"
106
+ },
107
+ {
108
+ "priority": 2,
109
+ "category": "performance",
110
+ "action": "Add pagination to posts listing"
111
+ },
112
+ { "priority": 3, "category": "tests", "action": "Fix 2 failing tests" }
113
+ ],
114
+ "next_actions": ["Fix N+1 in src/api/users.ts:45"]
115
+ }
116
+ ```
117
+
118
+ ---
119
+
120
+ ## 🔍 HEALTH CHECKS
121
+
122
+ ### 🔐 Security Checks
123
+
124
+ | Check | Detection | Severity |
125
+ | ------------------------ | ----------------------------- | -------- |
126
+ | Hardcoded secrets | Regex for API keys, passwords | CRITICAL |
127
+ | Outdated dependencies | npm audit | HIGH |
128
+ | Missing input validation | No zod/yup usage | MEDIUM |
129
+ | Missing auth on routes | Public API endpoints | HIGH |
130
+ | No rate limiting | Missing rate-limit middleware | MEDIUM |
131
+
132
+ ### ⚡ Performance Checks
133
+
134
+ | Check | Detection | Severity |
135
+ | ------------------ | -------------------------------- | -------- |
136
+ | N+1 queries | Loop with DB calls | HIGH |
137
+ | Missing pagination | Large findMany without take/skip | HIGH |
138
+ | No caching | Repeated identical queries | MEDIUM |
139
+ | Missing indexes | Schema without indexes | MEDIUM |
140
+ | Large bundle | > 500KB initial load | LOW |
141
+
142
+ ### 🐛 Bug Risk Checks
143
+
144
+ | Check | Detection | Severity |
145
+ | ---------------------- | -------------------------- | -------- |
146
+ | Missing error handling | catch without handling | MEDIUM |
147
+ | TypeScript `any` usage | Explicit any types | LOW |
148
+ | Missing null checks | Optional chaining not used | MEDIUM |
149
+ | Unhandled promises | .then without .catch | MEDIUM |
150
+
151
+ ### 🧪 Test Checks
152
+
153
+ | Check | Detection | Severity |
154
+ | ---------------------- | --------------------- | -------- |
155
+ | Low coverage | < 50% | HIGH |
156
+ | Failing tests | npm test fails | CRITICAL |
157
+ | Missing critical tests | No auth/payment tests | HIGH |
158
+ | Outdated snapshots | Stale snapshot files | LOW |
159
+
160
+ ---
161
+
162
+ ## 🎯 HEALTH SCORE CALCULATION
163
+
164
+ ```
165
+ Overall = (0.30 × Security) + (0.25 × Performance) + (0.25 × Bugs) + (0.20 × Tests)
166
+ ```
167
+
168
+ | Score | Status | Color |
169
+ | ------ | ---------- | ----- |
170
+ | 90-100 | Excellent | 🟢 |
171
+ | 70-89 | Good | 🟡 |
172
+ | 50-69 | Needs Work | 🟠 |
173
+ | 0-49 | Critical | 🔴 |
174
+
175
+ ---
176
+
177
+ ## ⚡ EXAMPLES
178
+
179
+ ### Basic Health Check
180
+
181
+ ```
182
+ User: /health
183
+
184
+ Output:
185
+ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
186
+ ┃ 🏥 PROJECT HEALTH ┃
187
+ ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
188
+ ┃ 📁 Project: my-app ┃
189
+ ┃ 📊 Health Score: 78/100 🟡 ┃
190
+ ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
191
+ ┃ 🔐 Security: ✅ OK (85) ┃
192
+ ┃ ⚡ Performance: ⚠️ Warning (65) ┃
193
+ ┃ 🐛 Bugs: ✅ OK (80) ┃
194
+ ┃ 🧪 Tests: 78% coverage ┃
195
+ ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
196
+ ┃ 💡 Top 3 Recommendations: ┃
197
+ ┃ 1. 🔴 Fix N+1 query in users API ┃
198
+ ┃ 2. 🟡 Add pagination to posts ┃
199
+ ┃ 3. 🟡 Fix 2 failing tests ┃
200
+ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
201
+ ```
202
+
203
+ ### Robot Output for AI
204
+
205
+ ```
206
+ User: /health --robot
207
+
208
+ AI receives JSON → parses → prioritizes fixes → executes
209
+ ```
210
+
211
+ ---
212
+
213
+ ## 🔗 INTEGRATION WITH /do
214
+
215
+ When AI runs `/do` on HIGH risk tasks, it should:
216
+
217
+ 1. Run `/health` first to understand current state
218
+ 2. Check if task will improve or degrade health
219
+ 3. Include health impact in report
220
+
221
+ ---
222
+
223
+ ## 📚 SKILLS ACTIVATED
224
+
225
+ - `performance-patterns/` - N+1, pagination detection
226
+ - `security-audit/` - Vulnerability scanning
227
+ - `code-quality/` - Bug risk analysis
228
+ - `test-driven-development/` - Test coverage
@@ -0,0 +1,40 @@
1
+ # Pack: Architecture
2
+
3
+ Tier: Core
4
+ Load Cost: High
5
+ Keywords: ddd, solid, patterns, planning, system-design
6
+
7
+ ## Scope
8
+
9
+ This pack covers **Software Architecture and High-Level Planning**.
10
+
11
+ - **Includes**: Domain-Driven Design (DDD), Modular Monolith, SOLID principles, Project Structure, Implementation Planning.
12
+ - **Excludes**: Specific coding syntax.
13
+
14
+ ## Canonical Patterns (Best Practices)
15
+
16
+ ### 1. Structure (Modular Monolith)
17
+
18
+ - **Feature Modules**: Group by feature (`features/billing/`), not type (`controllers/`).
19
+ - **Encapsulation**: Modules expose a Public API (`index.ts`); internals are private.
20
+ - **Dependency Rule**: Outer layers depend on inner layers (Core Domain).
21
+
22
+ ### 2. SOLID Principles
23
+
24
+ - **SRP**: Single Responsibility per class/module.
25
+ - **DIP**: Depend on abstractions (interfaces), not concretions.
26
+
27
+ ### 3. Planning
28
+
29
+ - **Implementation Plan**: Always create `implementation_plan.md` before coding complex features.
30
+ - **Task Breakdown**: Break tasks into < 1 hour chunks.
31
+
32
+ ## Anti-Patterns (What to Avoid)
33
+
34
+ - ❌ **Big Ball of Mud**: Circular dependencies between all modules.
35
+ - ❌ **God Objects**: Classes that do everything.
36
+ - ❌ **Coding without Plan**: Jumping into code for complex tasks.
37
+
38
+ ## Load Confirmation
39
+
40
+ > Rule: If you use this pack, you must explicitly state: "Loaded Architecture Pack."
@@ -0,0 +1,43 @@
1
+ # Pack: DevOps
2
+
3
+ Tier: Domain
4
+ Load Cost: Medium
5
+ Keywords: docker, ci-cd, git, deployment, infrastructure, automation
6
+
7
+ ## Scope
8
+
9
+ This pack covers **Development Operations, Infrastructure, and Automation**.
10
+
11
+ - **Includes**: Git workflow, CI/CD pipelines (GitHub Actions), Docker containers, Deployment scripts, MCP Server management.
12
+ - **Excludes**: Application code logic (Frontend/Backend).
13
+
14
+ ## Canonical Patterns (Best Practices)
15
+
16
+ ### 1. Git Workflow
17
+
18
+ - **Conventional Commits**: `feat:`, `fix:`, `chore:`, `docs:`.
19
+ - **Branching**: `main` (stable), `develop` (integration), `feature/xyz`.
20
+ - **Clean History**: Rebase before merge preferred over merge commits for cleaner history.
21
+
22
+ ### 2. CI/CD (GitHub Actions)
23
+
24
+ - **Fast Feedback**: Run lint and tests on every PR.
25
+ - **Cache Dependencies**: Use `actions/cache` for npm/pnpm.
26
+ - **Secret Management**: Use GitHub Secrets, never hardcode tokens in YAML.
27
+
28
+ ### 3. MCP (Model Context Protocol)
29
+
30
+ - **Builder**: Use standard MCP SDKs.
31
+ - **Management**: Register servers via config files, not ad-hoc commands.
32
+ - **Security**: MCP servers run locally; trust bounds apply.
33
+
34
+ ## Anti-Patterns (What to Avoid)
35
+
36
+ - ❌ **Commit "WIP"**: Avoid vague messages. Squash WIP commits before merge.
37
+ - ❌ **Broken Build**: Never merge code that fails CI.
38
+ - ❌ **Manual Deploys**: Automate via pipeline whenever possible.
39
+ - ❌ **Root Keys**: Never use root access keys in CI; use scoped service accounts.
40
+
41
+ ## Load Confirmation
42
+
43
+ > Rule: If you use this pack, you must explicitly state: "Loaded DevOps Pack."
@@ -0,0 +1,37 @@
1
+ # Pack: Productivity
2
+
3
+ Tier: Core
4
+ Load Cost: Low
5
+ Keywords: files, research, data, docs, organization
6
+
7
+ ## Scope
8
+
9
+ This pack covers **General Productivity, File Management, and Data Handling**.
10
+
11
+ - **Includes**: File searching, filtering, documentation organization, data analysis (CSV/JSON), learning patterns.
12
+
13
+ ## Canonical Patterns (Best Practices)
14
+
15
+ ### 1. File Management
16
+
17
+ - **Search**: Use `scout` or `fd` to find files efficiently.
18
+ - **Organization**: Keep directories flat where possible; group by domain.
19
+
20
+ ### 2. Documentation
21
+
22
+ - **Proximity**: Keep docs close to code (`README.md` in folders).
23
+ - **Updates**: Update docs _with_ code changes in the same PR.
24
+
25
+ ### 3. Data Analysis
26
+
27
+ - **Validation**: Validate input data schema.
28
+ - **Visualization**: Summarize data trends clearly.
29
+
30
+ ## Anti-Patterns (What to Avoid)
31
+
32
+ - ❌ **Stale Docs**: Documentation that contradicts code.
33
+ - ❌ **Messy Workspace**: files scattered in root.
34
+
35
+ ## Load Confirmation
36
+
37
+ > Rule: If you use this pack, you must explicitly state: "Loaded Productivity Pack."
@@ -0,0 +1,41 @@
1
+ # Pack: Quality
2
+
3
+ Tier: Domain
4
+ Load Cost: Medium
5
+ Keywords: testing, debug, review, security, performance, kaizen
6
+
7
+ ## Scope
8
+
9
+ This pack covers **Quality Assurance, Testing, and Code Review**.
10
+
11
+ - **Includes**: Unit Testing (Vitest/Jest), E2E (Playwright), Debugging strategies, Security audits, Performance profiling.
12
+ - **Excludes**: Implementation details.
13
+
14
+ ## Canonical Patterns (Best Practices)
15
+
16
+ ### 1. Testing (TDD)
17
+
18
+ - **Red-Green-Refactor**: Write test -> Fail -> Pass -> Clean.
19
+ - **AAA Pattern**: Arrange, Act, Assert.
20
+ - **Mocking**: Mock external boundaries (API, DB), test logic in isolation.
21
+
22
+ ### 2. Review
23
+
24
+ - **Readability**: Code should be self-documenting.
25
+ - **Maintainability**: Avoid complex abstractions early.
26
+ - **Security**: Sanitize inputs, check authorization.
27
+
28
+ ### 3. Debugging
29
+
30
+ - **Systematic Approach**: Reproduce -> Isolate -> Fix -> Verify.
31
+ - **Logs**: Use structured logging.
32
+
33
+ ## Anti-Patterns (What to Avoid)
34
+
35
+ - ❌ **Testing Implementation**: Test behavior, not internal state.
36
+ - ❌ **Flaky Tests**: Tests relying on timing/network without mocks.
37
+ - ❌ **Premature Optimization**: Optimize only after profiling.
38
+
39
+ ## Load Confirmation
40
+
41
+ > Rule: If you use this pack, you must explicitly state: "Loaded Quality Pack."
@@ -0,0 +1,41 @@
1
+ # Pack: AI (Cognitive)
2
+
3
+ Tier: Core
4
+ Load Cost: Medium
5
+ Keywords: llm, prompt, mcp, agents, reasoning, research
6
+
7
+ ## Scope
8
+
9
+ This pack covers **AI Capabilities, Reasoning Strategies, and Research**.
10
+
11
+ - **Includes**: Prompt Engineering, Agent Personas, Sequential Thinking, Research methodologies, Context Management.
12
+ - **Excludes**: Specific implementation details (coding).
13
+
14
+ ## Canonical Patterns (Best Practices)
15
+
16
+ ### 1. Sequential Thinking
17
+
18
+ - **Step-by-Step**: Break complex problems into atomic steps.
19
+ - **Self-Correction**: Review previous steps before proceeding.
20
+ - **Hypothesis Testing**: Formulate hypotheses and verifying them effectively.
21
+
22
+ ### 2. Research (Scout)
23
+
24
+ - **Breadth-First**: Scan wide before diving deep.
25
+ - **Source Verification**: Prefer official docs and code over generic articles.
26
+ - **Synthesis**: Combine multiple sources into a coherent answer.
27
+
28
+ ### 3. Multi-Modal
29
+
30
+ - **Images**: Analyze UI screenshots for design fidelity.
31
+ - **Context**: Provide relevant context files, not whole folders.
32
+
33
+ ## Anti-Patterns (What to Avoid)
34
+
35
+ - ❌ **Hallucination**: Inventing APIs or libraries. Always verify.
36
+ - ❌ **Looping**: Getting stuck in "I will fix" loops without changing strategy.
37
+ - ❌ **Ignoring Constraints**: Forgetting project-specific rules (e.g., "No Tailwind").
38
+
39
+ ## Load Confirmation
40
+
41
+ > Rule: If you use this pack, you must explicitly state: "Loaded AI Pack."
@@ -0,0 +1,36 @@
1
+ # Pack: Data Science
2
+
3
+ Tier: Domain
4
+ Load Cost: High
5
+ Keywords: python, pandas, numpy, visualization, analysis, machine-learning, plot
6
+
7
+ ## Scope
8
+
9
+ This pack covers **Deep Data Science and Analysis**.
10
+
11
+ - **Includes**: Data manipulation (Pandas/Polars), Visualization (Matplotlib/Seaborn), Statistical Analysis, Basic ML (Scikit-learn).
12
+ - **Primary Lang**: Python (assumed execution environment or script generation).
13
+
14
+ ## Canonical Patterns (Best Practices)
15
+
16
+ ### 1. Data Pipeline
17
+
18
+ - **ETL**: Extract -> Transform -> Load. Clean data before analysis.
19
+ - **Vectorization**: Use Pandas/NumPy vector operations, avoid Python loops.
20
+ - **Reproducibility**: Use Jupyter Notebooks or scripts with seed fixing.
21
+
22
+ ### 2. Visualization
23
+
24
+ - **Clarity**: Label axes, titles, and legends.
25
+ - **Color**: Use accessible color palettes.
26
+ - **Context**: Annotate outliers or key events.
27
+
28
+ ## Anti-Patterns (What to Avoid)
29
+
30
+ - ❌ **Mutating Data**: Modifying DataFrames in-place implicitly.
31
+ - ❌ **Magic Numbers**: Hardcoding boundaries without explanation.
32
+ - ❌ **Overfitting**: training on test data.
33
+
34
+ ## Load Confirmation
35
+
36
+ > Rule: If you use this pack, you must explicitly state: "Loaded Data Science Pack."
@@ -0,0 +1,40 @@
1
+ # Pack: Mobile
2
+
3
+ Tier: Domain
4
+ Load Cost: Medium
5
+ Keywords: react-native, expo, ios, android, mobile
6
+
7
+ ## Scope
8
+
9
+ This pack covers **Mobile App Development** using React Native and Expo.
10
+
11
+ - **Includes**: Native Components, Navigation (React Navigation/Expo Router), native modules, platform-specific code.
12
+ - **Excludes**: Pure web components (DOM-based).
13
+
14
+ ## Canonical Patterns (Best Practices)
15
+
16
+ ### 1. Framework
17
+
18
+ - **Expo Framework**: Preferred for new projects (File-based routing, Prebuild).
19
+ - **NativeWind**: Tailwind CSS for React Native.
20
+
21
+ ### 2. Components
22
+
23
+ - **Core Components**: Use `<View>`, `<Text>`, `<Pressable>` (not `<div>`, `<span>`).
24
+ - **Lists**: Use `<FlatList>` or `<FlashList>` for long lists (virtualization).
25
+ - **Images**: Use `expo-image` for caching and performance.
26
+
27
+ ### 3. Navigation
28
+
29
+ - **Architecture**: Stack Navigator for flows, Tab Navigator for main shell.
30
+ - **Deep Linking**: Configure schemes for external access.
31
+
32
+ ## Anti-Patterns (What to Avoid)
33
+
34
+ - ❌ **Web-only APIs**: Using `window`, `document`, or `localStorage` (Use `AsyncStorage`).
35
+ - ❌ **Blocking JS Thread**: Heavy computations on UI thread. Use Worklets (Reanimated).
36
+ - ❌ **Unoptimized Images**: Loading huge raw images.
37
+
38
+ ## Load Confirmation
39
+
40
+ > Rule: If you use this pack, you must explicitly state: "Loaded Mobile Pack."
@@ -0,0 +1,61 @@
1
+ # Pack: Backend
2
+
3
+ Tier: Domain
4
+ Load Cost: High
5
+ Keywords: node, api, database, auth, payment, backend, server
6
+
7
+ ## Scope
8
+
9
+ This pack covers **Backend Development** logic, API design, and Data Management.
10
+
11
+ - **Includes**: API endpoints (Next.js App Router), Database interactions (Prisma/Drizzle), Authentication (Auth.js), Payments (Stripe), Business Logic.
12
+ - **Excludes**: UI components, detailed DevOps/Infrastructure (see `pack-devops`).
13
+
14
+ ## Canonical Patterns (Best Practices)
15
+
16
+ ### 1. API Design
17
+
18
+ - **Resource Oriented**: `GET /api/users`, `POST /api/users`.
19
+ - **Validation**: Use Zod for all request body/param validation.
20
+ - **Error Handling**: Return structured errors `{ code, message, details }`.
21
+ - **Type Safety**: Share types between Backend and Frontend (Monorepo/RPC).
22
+
23
+ ### 2. Database Interactions
24
+
25
+ - **ORM**: Use Prisma or Drizzle.
26
+ - **Migrations**: Always verify migrations locally before commit.
27
+ - **Indexing**: Add indexes for foreign keys and frequently searched columns.
28
+ - **Connection Pooling**: Use connection pooling for Serverless environments.
29
+
30
+ ### 3. Authentication & Security
31
+
32
+ - **Auth.js / Better-Auth**: Standard implementations preferred.
33
+ - **Middleware**: Protect routes via middleware, not just client-side checks.
34
+ - **RBAC**: Implement Role-Based Access Control logic in services.
35
+ - **Secrets**: Never commit `.env`. Access via `process.env`.
36
+
37
+ ### 4. Payments (Stripe)
38
+
39
+ - **Webhooks**: Always verify webhook signatures securely.
40
+ - **Idempotency**: Handle duplicate webhook events gracefully.
41
+ - **Client/Server Split**: Create PaymentIntent on server, confirm on client.
42
+
43
+ ## Anti-Patterns (What to Avoid)
44
+
45
+ - ❌ **Logic in Controllers**: Keep Route Handlers thin; move logic to Services/UseCases.
46
+ - ❌ **N+1 Queries**: Loop queries inside loops. Use `include` or `Promise.all`.
47
+ - ❌ **Trusting Client**: Never trust `req.body` without Zod validation.
48
+ - ❌ **SQL Injection**: Never concat strings for queries. Use ORM or parametrized queries.
49
+ - ❌ **Hardcoded IDs**: Do not rely on specific DB IDs in logic.
50
+
51
+ ## Specialized Modules
52
+
53
+ ### Shopify Integration
54
+
55
+ - Use Shopify Admin API / Storefront API.
56
+ - Respect rate limits.
57
+ - Handle webhook HMAC verification strict.
58
+
59
+ ## Load Confirmation
60
+
61
+ > Rule: If you use this pack, you must explicitly state: "Loaded Backend Pack."
@@ -0,0 +1,66 @@
1
+ # Pack: Frontend
2
+
3
+ Tier: Domain
4
+ Load Cost: High
5
+ Keywords: react, nextjs, tailwind, ui, ux, components, frontend
6
+
7
+ ## Scope
8
+
9
+ This pack covers all aspects of **Frontend Development** within the Anchi-Kit ecosystem.
10
+
11
+ - **Includes**: Component architecture, UI styling (Tailwind), State Management, React Hooks, Next.js Routing, Client-Side logic, Accessibility (a11y), Animations.
12
+ - **Excludes**: Backend API logic (see `pack-backend`), Database schemas, DevOps pipelines.
13
+
14
+ ## Canonical Patterns (Best Practices)
15
+
16
+ ### 1. Component Design
17
+
18
+ - **Single Responsibility**: Each component should do one thing well.
19
+ - **Composition over Inheritance**: Use children props and slots.
20
+ - **Props Interface**: Always define explicit interfaces for props (TypeScript).
21
+ - **Atomic Design**: Structure components as Atoms, Molecules, Organisms, Templates.
22
+
23
+ ### 2. Styling (Tailwind CSS)
24
+
25
+ - **Utility-First**: Use Tailwind classes directly in markup.
26
+ - **Tokens**: Use `theme('colors...')` for consistency.
27
+ - **Responsive**: Mobile-first design (`min-width` default, `md:`, `lg:` overrides).
28
+ - **ClassName Merging**: Use `cn()` utility (clsx + tailwind-merge) for conditional classes.
29
+
30
+ ### 3. State Management
31
+
32
+ - **Local State**: `useState` for simple UI toggles.
33
+ - **Server State**: Use `useQuery` or Next.js Server Components for data fetching.
34
+ - **Global State**: Minimal use of Context/Zustand only when absolutely necessary (e.g., Theme, Auth User).
35
+
36
+ ### 4. Performance
37
+
38
+ - **Image Optimization**: Use `next/image`.
39
+ - **Lazy Loading**: Use `dynamic()` for heavy components below the fold.
40
+ - **Memoization**: `useMemo`/`useCallback` only when profiling shows re-render issues.
41
+
42
+ ## Anti-Patterns (What to Avoid)
43
+
44
+ - ❌ **Hardcoded Styles**: Avoid `style={{ margin: 10 }}`. Use Tailwind classes.
45
+ - ❌ **Prop Drilling**: Passing data through >3 layers. Use Composition or Context.
46
+ - ❌ **Client-Side Heavy**: Making everything `"use client"`. Default to Server Components.
47
+ - ❌ **Magic Numbers**: Using arbitrary pixel values (e.g., `width: 317px`). Use design tokens.
48
+ - ❌ **Huge Components**: Files > 300 lines should likely be split.
49
+
50
+ ## Specialized Modules
51
+
52
+ ### 3D / WebGL (Three.js)
53
+
54
+ - Use `@react-three/fiber`.
55
+ - Keep canvas logic separate from DOM UI.
56
+ - optimize models (GLB/GLTF) via `gltfjsx`.
57
+
58
+ ### Mobile (React Native / Expo)
59
+
60
+ - Use `StyleSheet.create` or strict Tailwind integration (NativeWind).
61
+ - Handle platform differences (`Platform.OS`).
62
+ - Avoid web-only APIs is critical paths.
63
+
64
+ ## Load Confirmation
65
+
66
+ > Rule: If you use this pack, you must explicitly state: "Loaded Frontend Pack."
@@ -0,0 +1,37 @@
1
+ # Pack: Blockchain
2
+
3
+ Tier: Domain
4
+ Load Cost: High
5
+ Keywords: blockchain, web3, solidity, smart-contract, ethereum, crypto, wallet
6
+
7
+ ## Scope
8
+
9
+ This pack covers **Web3 and Blockchain Development**.
10
+
11
+ - **Includes**: Smart Contract development (Solidity), Interaction (Ethers.js/Viem), Testing (Hardhat/Foundry), Security (Reentrancy prevention).
12
+ - **Excludes**: Creating new L1 chains (Core Protocol Dev).
13
+
14
+ ## Canonical Patterns (Best Practices)
15
+
16
+ ### 1. Smart Contracts (Solidity)
17
+
18
+ - **Security First**: Use OpenZeppelin contracts (standard libraries).
19
+ - **Checks-Effects-Interactions**: Update state _before_ external calls to prevent Reentrancy.
20
+ - **Gas Optimization**: Use `calldata` vs `memory`, pack variables, avoid loops.
21
+
22
+ ### 2. Integration
23
+
24
+ - **Wagmi/Viem**: Modern React hooks for wallet connection.
25
+ - **Event Listening**: Index events for UI updates (The Graph or direct listeners).
26
+ - **Error Handling**: Handle chain-specific errors (UserRejected, InsufficientFunds).
27
+
28
+ ## Anti-Patterns (What to Avoid)
29
+
30
+ - ❌ **Rolling Crypto**: Never invent your own encryption/hashing.
31
+ - ❌ **Unchecked Calls**: Always check return values of low-level calls.
32
+ - ❌ **Timestamp Dependence**: Block timestamps can be manipulated by miners.
33
+ - ❌ **Private Logic**: Nothing on-chain is truly private.
34
+
35
+ ## Load Confirmation
36
+
37
+ > Rule: If you use this pack, you must explicitly state: "Loaded Blockchain Pack."