@devran-ai/kit 4.1.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.
- package/.agent/CheatSheet.md +350 -0
- package/.agent/README.md +76 -0
- package/.agent/agents/README.md +155 -0
- package/.agent/agents/architect.md +185 -0
- package/.agent/agents/backend-specialist.md +276 -0
- package/.agent/agents/build-error-resolver.md +207 -0
- package/.agent/agents/code-reviewer.md +162 -0
- package/.agent/agents/database-architect.md +138 -0
- package/.agent/agents/devops-engineer.md +144 -0
- package/.agent/agents/doc-updater.md +229 -0
- package/.agent/agents/e2e-runner.md +145 -0
- package/.agent/agents/explorer-agent.md +143 -0
- package/.agent/agents/frontend-specialist.md +144 -0
- package/.agent/agents/go-reviewer.md +128 -0
- package/.agent/agents/knowledge-agent.md +197 -0
- package/.agent/agents/mobile-developer.md +150 -0
- package/.agent/agents/performance-optimizer.md +175 -0
- package/.agent/agents/planner.md +133 -0
- package/.agent/agents/pr-reviewer.md +148 -0
- package/.agent/agents/python-reviewer.md +123 -0
- package/.agent/agents/refactor-cleaner.md +201 -0
- package/.agent/agents/reliability-engineer.md +156 -0
- package/.agent/agents/security-reviewer.md +141 -0
- package/.agent/agents/sprint-orchestrator.md +124 -0
- package/.agent/agents/tdd-guide.md +179 -0
- package/.agent/agents/typescript-reviewer.md +110 -0
- package/.agent/checklists/README.md +102 -0
- package/.agent/checklists/pre-commit.md +93 -0
- package/.agent/checklists/session-end.md +99 -0
- package/.agent/checklists/session-start.md +102 -0
- package/.agent/checklists/task-complete.md +81 -0
- package/.agent/commands/README.md +130 -0
- package/.agent/commands/adr.md +29 -0
- package/.agent/commands/ask.md +28 -0
- package/.agent/commands/build.md +30 -0
- package/.agent/commands/changelog.md +40 -0
- package/.agent/commands/checkpoint.md +28 -0
- package/.agent/commands/code-review.md +65 -0
- package/.agent/commands/compact.md +28 -0
- package/.agent/commands/cook.md +30 -0
- package/.agent/commands/db.md +30 -0
- package/.agent/commands/debug.md +31 -0
- package/.agent/commands/deploy.md +37 -0
- package/.agent/commands/design.md +29 -0
- package/.agent/commands/doc.md +30 -0
- package/.agent/commands/eval.md +30 -0
- package/.agent/commands/fix.md +32 -0
- package/.agent/commands/git.md +32 -0
- package/.agent/commands/help.md +273 -0
- package/.agent/commands/implement.md +30 -0
- package/.agent/commands/integrate.md +32 -0
- package/.agent/commands/learn.md +29 -0
- package/.agent/commands/perf.md +31 -0
- package/.agent/commands/plan.md +56 -0
- package/.agent/commands/pr-describe.md +65 -0
- package/.agent/commands/pr-fix.md +45 -0
- package/.agent/commands/pr-merge.md +45 -0
- package/.agent/commands/pr-review.md +50 -0
- package/.agent/commands/pr-split.md +54 -0
- package/.agent/commands/pr-status.md +56 -0
- package/.agent/commands/pr.md +58 -0
- package/.agent/commands/refactor.md +32 -0
- package/.agent/commands/research.md +28 -0
- package/.agent/commands/scout.md +30 -0
- package/.agent/commands/security-scan.md +33 -0
- package/.agent/commands/setup.md +31 -0
- package/.agent/commands/status.md +59 -0
- package/.agent/commands/tdd.md +73 -0
- package/.agent/commands/verify.md +58 -0
- package/.agent/contexts/brainstorm.md +26 -0
- package/.agent/contexts/debug.md +28 -0
- package/.agent/contexts/implement.md +29 -0
- package/.agent/contexts/plan-quality-log.md +30 -0
- package/.agent/contexts/review.md +27 -0
- package/.agent/contexts/ship.md +28 -0
- package/.agent/decisions/001-trust-grade-governance.md +46 -0
- package/.agent/decisions/002-cross-ide-generation.md +15 -0
- package/.agent/engine/identity.json +4 -0
- package/.agent/engine/loading-rules.json +193 -0
- package/.agent/engine/marketplace-index.json +29 -0
- package/.agent/engine/mcp-servers/filesystem.json +9 -0
- package/.agent/engine/mcp-servers/github.json +11 -0
- package/.agent/engine/mcp-servers/postgres.json +11 -0
- package/.agent/engine/mcp-servers/supabase.json +11 -0
- package/.agent/engine/mcp-servers/vercel.json +11 -0
- package/.agent/engine/reliability-config.json +14 -0
- package/.agent/engine/sdlc-map.json +50 -0
- package/.agent/engine/workflow-state.json +167 -0
- package/.agent/hooks/README.md +101 -0
- package/.agent/hooks/hooks.json +104 -0
- package/.agent/hooks/templates/session-end.md +110 -0
- package/.agent/hooks/templates/session-start.md +95 -0
- package/.agent/manifest.json +466 -0
- package/.agent/rules/agent-upgrade-policy.md +56 -0
- package/.agent/rules/architecture.md +111 -0
- package/.agent/rules/coding-style.md +75 -0
- package/.agent/rules/documentation.md +74 -0
- package/.agent/rules/git-workflow.md +140 -0
- package/.agent/rules/quality-gate.md +117 -0
- package/.agent/rules/security.md +67 -0
- package/.agent/rules/sprint-tracking.md +103 -0
- package/.agent/rules/testing.md +80 -0
- package/.agent/rules/workflow-standards.md +30 -0
- package/.agent/rules.md +293 -0
- package/.agent/session-context.md +69 -0
- package/.agent/session-state.json +27 -0
- package/.agent/skills/README.md +135 -0
- package/.agent/skills/api-patterns/SKILL.md +117 -0
- package/.agent/skills/app-builder/SKILL.md +202 -0
- package/.agent/skills/architecture/SKILL.md +101 -0
- package/.agent/skills/behavioral-modes/SKILL.md +295 -0
- package/.agent/skills/brainstorming/SKILL.md +156 -0
- package/.agent/skills/clean-code/SKILL.md +142 -0
- package/.agent/skills/context-budget/SKILL.md +78 -0
- package/.agent/skills/continuous-learning/SKILL.md +145 -0
- package/.agent/skills/database-design/SKILL.md +303 -0
- package/.agent/skills/debugging-strategies/SKILL.md +158 -0
- package/.agent/skills/deployment-procedures/SKILL.md +191 -0
- package/.agent/skills/docker-patterns/SKILL.md +161 -0
- package/.agent/skills/eval-harness/SKILL.md +89 -0
- package/.agent/skills/frontend-patterns/SKILL.md +141 -0
- package/.agent/skills/git-workflow/SKILL.md +159 -0
- package/.agent/skills/i18n-localization/SKILL.md +191 -0
- package/.agent/skills/intelligent-routing/SKILL.md +180 -0
- package/.agent/skills/mcp-integration/SKILL.md +240 -0
- package/.agent/skills/mobile-design/SKILL.md +191 -0
- package/.agent/skills/nodejs-patterns/SKILL.md +164 -0
- package/.agent/skills/parallel-agents/SKILL.md +200 -0
- package/.agent/skills/performance-profiling/SKILL.md +134 -0
- package/.agent/skills/plan-validation/SKILL.md +192 -0
- package/.agent/skills/plan-writing/SKILL.md +183 -0
- package/.agent/skills/plan-writing/domain-enhancers.md +184 -0
- package/.agent/skills/plan-writing/plan-retrospective.md +116 -0
- package/.agent/skills/plan-writing/plan-schema.md +119 -0
- package/.agent/skills/pr-toolkit/SKILL.md +174 -0
- package/.agent/skills/production-readiness/SKILL.md +126 -0
- package/.agent/skills/security-practices/SKILL.md +109 -0
- package/.agent/skills/shell-conventions/SKILL.md +92 -0
- package/.agent/skills/strategic-compact/SKILL.md +62 -0
- package/.agent/skills/testing-patterns/SKILL.md +141 -0
- package/.agent/skills/typescript-expert/SKILL.md +160 -0
- package/.agent/skills/ui-ux-pro-max/SKILL.md +137 -0
- package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/.agent/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/.agent/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/.agent/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/.agent/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/.agent/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/.agent/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/.agent/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/.agent/skills/ui-ux-pro-max/scripts/search.py +114 -0
- package/.agent/skills/verification-loop/SKILL.md +89 -0
- package/.agent/skills/webapp-testing/SKILL.md +175 -0
- package/.agent/templates/adr-template.md +32 -0
- package/.agent/templates/bug-report.md +37 -0
- package/.agent/templates/feature-request.md +32 -0
- package/.agent/workflows/README.md +101 -0
- package/.agent/workflows/brainstorm.md +86 -0
- package/.agent/workflows/create.md +85 -0
- package/.agent/workflows/debug.md +83 -0
- package/.agent/workflows/deploy.md +114 -0
- package/.agent/workflows/enhance.md +85 -0
- package/.agent/workflows/orchestrate.md +106 -0
- package/.agent/workflows/plan.md +105 -0
- package/.agent/workflows/pr-fix.md +163 -0
- package/.agent/workflows/pr-merge.md +117 -0
- package/.agent/workflows/pr-review.md +178 -0
- package/.agent/workflows/pr-split.md +118 -0
- package/.agent/workflows/pr.md +184 -0
- package/.agent/workflows/preflight.md +107 -0
- package/.agent/workflows/preview.md +95 -0
- package/.agent/workflows/quality-gate.md +103 -0
- package/.agent/workflows/retrospective.md +100 -0
- package/.agent/workflows/review.md +104 -0
- package/.agent/workflows/status.md +89 -0
- package/.agent/workflows/test.md +98 -0
- package/.agent/workflows/ui-ux-pro-max.md +93 -0
- package/.agent/workflows/upgrade.md +97 -0
- package/LICENSE +21 -0
- package/README.md +218 -0
- package/bin/kit.js +773 -0
- package/lib/agent-registry.js +228 -0
- package/lib/agent-reputation.js +343 -0
- package/lib/circuit-breaker.js +195 -0
- package/lib/cli-commands.js +322 -0
- package/lib/config-validator.js +274 -0
- package/lib/conflict-detector.js +252 -0
- package/lib/constants.js +47 -0
- package/lib/engineering-manager.js +336 -0
- package/lib/error-budget.js +370 -0
- package/lib/hook-system.js +256 -0
- package/lib/ide-generator.js +434 -0
- package/lib/identity.js +240 -0
- package/lib/io.js +146 -0
- package/lib/learning-engine.js +163 -0
- package/lib/loading-engine.js +421 -0
- package/lib/logger.js +118 -0
- package/lib/marketplace.js +321 -0
- package/lib/plugin-system.js +604 -0
- package/lib/plugin-verifier.js +197 -0
- package/lib/rate-limiter.js +113 -0
- package/lib/security-scanner.js +312 -0
- package/lib/self-healing.js +468 -0
- package/lib/session-manager.js +264 -0
- package/lib/skill-sandbox.js +244 -0
- package/lib/task-governance.js +522 -0
- package/lib/task-model.js +332 -0
- package/lib/updater.js +240 -0
- package/lib/verify.js +279 -0
- package/lib/workflow-engine.js +373 -0
- package/lib/workflow-events.js +166 -0
- package/lib/workflow-persistence.js +160 -0
- package/package.json +57 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brainstorming
|
|
3
|
+
description: Socratic questioning and discovery protocol. Ensures requirements clarity before implementation.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
allowed-tools: Read, Glob, Grep
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Brainstorming & Communication Protocol
|
|
9
|
+
|
|
10
|
+
> Understand before building. Ask before assuming.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 🛑 SOCRATIC GATE (MANDATORY)
|
|
15
|
+
|
|
16
|
+
### When to Trigger
|
|
17
|
+
|
|
18
|
+
| Pattern | Action |
|
|
19
|
+
| ------------------------------------------- | ---------------------------------- |
|
|
20
|
+
| "Build/Create/Make [thing]" without details | 🛑 ASK 3 questions |
|
|
21
|
+
| Complex feature or architecture | 🛑 Clarify before implementing |
|
|
22
|
+
| Update/change request | 🛑 Confirm scope |
|
|
23
|
+
| Vague requirements | 🛑 Ask purpose, users, constraints |
|
|
24
|
+
|
|
25
|
+
### 3 Questions Before Implementation
|
|
26
|
+
|
|
27
|
+
1. **STOP** — Do NOT start coding
|
|
28
|
+
2. **ASK** — Minimum 3 questions:
|
|
29
|
+
- 🎯 **Purpose**: What problem are you solving?
|
|
30
|
+
- 👥 **Users**: Who will use this?
|
|
31
|
+
- 📦 **Scope**: Must-have vs nice-to-have?
|
|
32
|
+
3. **WAIT** — Get response before proceeding
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 🧠 Dynamic Question Generation
|
|
37
|
+
|
|
38
|
+
> **⛔ NEVER use static templates.** Generate questions based on context.
|
|
39
|
+
|
|
40
|
+
### Core Principles
|
|
41
|
+
|
|
42
|
+
| Principle | Application |
|
|
43
|
+
| ------------------- | ---------------------------- |
|
|
44
|
+
| **Context-aware** | Questions match the domain |
|
|
45
|
+
| **Prioritized** | Ask most important first |
|
|
46
|
+
| **Open-ended** | Encourage detailed responses |
|
|
47
|
+
| **Assumption-free** | Don't lead the answer |
|
|
48
|
+
|
|
49
|
+
### Question Generation Process
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
1. Identify domain (frontend, backend, mobile, etc.)
|
|
53
|
+
2. Detect ambiguities in request
|
|
54
|
+
3. Generate 3-5 clarifying questions
|
|
55
|
+
4. Order by impact on implementation
|
|
56
|
+
5. Present clearly with formatting
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Question Format
|
|
60
|
+
|
|
61
|
+
```markdown
|
|
62
|
+
Before I proceed, I have a few questions:
|
|
63
|
+
|
|
64
|
+
1. **[Topic]**: [Specific question]?
|
|
65
|
+
2. **[Topic]**: [Specific question]?
|
|
66
|
+
3. **[Topic]**: [Specific question]?
|
|
67
|
+
|
|
68
|
+
Feel free to answer all at once, and I'll start implementing.
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 📊 Progress Reporting
|
|
74
|
+
|
|
75
|
+
### Status Icons
|
|
76
|
+
|
|
77
|
+
| Icon | Meaning |
|
|
78
|
+
| ---- | ------------------------ |
|
|
79
|
+
| ✅ | Complete |
|
|
80
|
+
| 🔄 | In progress |
|
|
81
|
+
| ⏳ | Pending |
|
|
82
|
+
| ❌ | Failed/Blocked |
|
|
83
|
+
| ⚠️ | Warning/Attention needed |
|
|
84
|
+
|
|
85
|
+
### Status Board Format
|
|
86
|
+
|
|
87
|
+
```markdown
|
|
88
|
+
## Status Update
|
|
89
|
+
|
|
90
|
+
| Task | Status | Notes |
|
|
91
|
+
| --------------- | ------ | -------- |
|
|
92
|
+
| Database schema | ✅ | Migrated |
|
|
93
|
+
| API endpoints | 🔄 | 3/5 done |
|
|
94
|
+
| Frontend pages | ⏳ | Next up |
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## ⚠️ Error Handling
|
|
100
|
+
|
|
101
|
+
### Error Response Pattern
|
|
102
|
+
|
|
103
|
+
```markdown
|
|
104
|
+
🔍 **Symptom**: [What happened]
|
|
105
|
+
🎯 **Root cause**: [Why it happened]
|
|
106
|
+
✅ **Fix**: [The solution]
|
|
107
|
+
🛡️ **Prevention**: [How to avoid in future]
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## ✅ Completion Message
|
|
113
|
+
|
|
114
|
+
### Structure
|
|
115
|
+
|
|
116
|
+
```markdown
|
|
117
|
+
## ✅ Complete: [Task Name]
|
|
118
|
+
|
|
119
|
+
### What was done
|
|
120
|
+
|
|
121
|
+
- [Deliverable 1]
|
|
122
|
+
- [Deliverable 2]
|
|
123
|
+
|
|
124
|
+
### How to verify
|
|
125
|
+
|
|
126
|
+
[Specific steps to test]
|
|
127
|
+
|
|
128
|
+
### Next steps (suggested)
|
|
129
|
+
|
|
130
|
+
1. [Optional follow-up]
|
|
131
|
+
2. [Optional follow-up]
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Communication Principles
|
|
137
|
+
|
|
138
|
+
| Principle | Implementation |
|
|
139
|
+
| ---------------- | ---------------------------------- |
|
|
140
|
+
| **Concise** | No unnecessary details |
|
|
141
|
+
| **Visual** | Use emojis for quick scanning |
|
|
142
|
+
| **Specific** | "~2 minutes" not "wait a bit" |
|
|
143
|
+
| **Alternatives** | Offer paths when stuck |
|
|
144
|
+
| **Proactive** | Suggest next step after completion |
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Anti-Patterns (AVOID)
|
|
149
|
+
|
|
150
|
+
| ❌ Don't | ✅ Do |
|
|
151
|
+
| ------------------- | ---------------- |
|
|
152
|
+
| Jump to solutions | Understand first |
|
|
153
|
+
| Assume requirements | Ask questions |
|
|
154
|
+
| Over-engineer v1 | MVP first |
|
|
155
|
+
| Ignore constraints | Factor them in |
|
|
156
|
+
| "I think" phrases | Ask for clarity |
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: clean-code
|
|
3
|
+
description: Code quality principles and best practices
|
|
4
|
+
triggers: [context, code, quality, review]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Clean Code Skill
|
|
8
|
+
|
|
9
|
+
> **Purpose**: Write maintainable, readable, and professional code
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
This skill applies Robert C. Martin's Clean Code principles and industry best practices for writing professional-grade code.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Naming Conventions
|
|
20
|
+
|
|
21
|
+
### Variables
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
// ❌ Bad
|
|
25
|
+
const d = new Date();
|
|
26
|
+
const u = users.filter((x) => x.active);
|
|
27
|
+
|
|
28
|
+
// ✅ Good
|
|
29
|
+
const currentDate = new Date();
|
|
30
|
+
const activeUsers = users.filter((user) => user.isActive);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Functions
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
// ❌ Bad
|
|
37
|
+
function process(data) { ... }
|
|
38
|
+
function handle(x) { ... }
|
|
39
|
+
|
|
40
|
+
// ✅ Good
|
|
41
|
+
function validateUserInput(formData) { ... }
|
|
42
|
+
function calculateTotalPrice(orderItems) { ... }
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Classes
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
// ❌ Bad
|
|
49
|
+
class Data { ... }
|
|
50
|
+
class Manager { ... }
|
|
51
|
+
|
|
52
|
+
// ✅ Good
|
|
53
|
+
class UserRepository { ... }
|
|
54
|
+
class OrderService { ... }
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Functions
|
|
60
|
+
|
|
61
|
+
### Single Responsibility
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
// ❌ Bad - does too much
|
|
65
|
+
function processOrder(order) {
|
|
66
|
+
validateOrder(order);
|
|
67
|
+
calculateTotal(order);
|
|
68
|
+
saveToDatabase(order);
|
|
69
|
+
sendEmail(order);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// ✅ Good - one responsibility each
|
|
73
|
+
function validateOrder(order) { ... }
|
|
74
|
+
function calculateOrderTotal(order) { ... }
|
|
75
|
+
function persistOrder(order) { ... }
|
|
76
|
+
function notifyCustomer(order) { ... }
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Keep Small (≤20 lines)
|
|
80
|
+
|
|
81
|
+
- Each function should do ONE thing
|
|
82
|
+
- Extract helper functions when growing
|
|
83
|
+
|
|
84
|
+
### Minimize Parameters
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
// ❌ Bad
|
|
88
|
+
function createUser(name, email, age, address, phone, role) { ... }
|
|
89
|
+
|
|
90
|
+
// ✅ Good
|
|
91
|
+
function createUser(userData: CreateUserDto) { ... }
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Error Handling
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
// ❌ Bad
|
|
100
|
+
try {
|
|
101
|
+
doSomething();
|
|
102
|
+
} catch (e) {
|
|
103
|
+
console.log(e);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// ✅ Good
|
|
107
|
+
try {
|
|
108
|
+
await processPayment(order);
|
|
109
|
+
} catch (error) {
|
|
110
|
+
logger.error("Payment processing failed", { orderId: order.id, error });
|
|
111
|
+
throw new PaymentFailedError(order.id, error.message);
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Comments
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
// ❌ Bad - obvious comment
|
|
121
|
+
// Increment counter by 1
|
|
122
|
+
counter++;
|
|
123
|
+
|
|
124
|
+
// ✅ Good - explains WHY
|
|
125
|
+
// Offset for 0-based index when displaying to users
|
|
126
|
+
const displayIndex = arrayIndex + 1;
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Quick Reference
|
|
132
|
+
|
|
133
|
+
| Principle | Guideline |
|
|
134
|
+
| :------------- | :-------------------- |
|
|
135
|
+
| Names | Intention-revealing |
|
|
136
|
+
| Functions | Small, single purpose |
|
|
137
|
+
| Parameters | ≤3 ideally |
|
|
138
|
+
| Comments | Explain why, not what |
|
|
139
|
+
| Formatting | Consistent, readable |
|
|
140
|
+
| Error Handling | Explicit, informative |
|
|
141
|
+
| DRY | Don't repeat yourself |
|
|
142
|
+
| KISS | Keep it simple |
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: context-budget
|
|
3
|
+
description: Context window budget management and selective capability loading for LLM token optimization.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
triggers: [context-warning, session-start, manual]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Context Budget Skill
|
|
9
|
+
|
|
10
|
+
> **Purpose**: Manage LLM context window as a finite resource. Ensure the right agents and skills are loaded for each task while preventing context overflow.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
LLM context windows have hard token limits. Loading all 19 agents and 27 skills simultaneously consumes context that should be reserved for the actual work. This skill implements intelligent selective loading to maximize usable context for code and reasoning.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## How It Works
|
|
21
|
+
|
|
22
|
+
### 1. Domain Detection
|
|
23
|
+
|
|
24
|
+
At the start of each task, analyze the user request to identify which domains are involved:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
User: "Add JWT authentication to the API"
|
|
28
|
+
→ Detected domains: security, backend, testing
|
|
29
|
+
→ Load: security-reviewer, backend-specialist, tdd-guide
|
|
30
|
+
→ Load: security-practices, api-patterns, testing-patterns
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 2. Selective Loading
|
|
34
|
+
|
|
35
|
+
Consult `engine/loading-rules.json` to determine which agents and skills to load:
|
|
36
|
+
|
|
37
|
+
- **Always loaded** (core): `rules.md`, `manifest.json`, `workflow-state.json`
|
|
38
|
+
- **Session context**: `session-context.md`, `session-state.json`
|
|
39
|
+
- **Domain-specific**: Only agents/skills matching detected domains
|
|
40
|
+
|
|
41
|
+
### 3. Budget Limits
|
|
42
|
+
|
|
43
|
+
| Resource | Default Limit | Rationale |
|
|
44
|
+
|:---------|:-------------|:----------|
|
|
45
|
+
| Agents per session | 4 | Each agent ~200-500 tokens of context |
|
|
46
|
+
| Skills per session | 6 | Each skill ~200-800 tokens of context |
|
|
47
|
+
| Maximum loaded context | ~30% of window | Reserve 70% for code and reasoning |
|
|
48
|
+
|
|
49
|
+
### 4. Overflow Prevention
|
|
50
|
+
|
|
51
|
+
When approaching context limits:
|
|
52
|
+
|
|
53
|
+
1. **Warn**: Alert that context is nearing capacity
|
|
54
|
+
2. **Compact**: Apply `strategic-compact` skill to summarize completed work
|
|
55
|
+
3. **Unload**: Release agents/skills no longer needed for current phase
|
|
56
|
+
4. **Persist**: Save important context to `session-state.json` before compaction
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Task-Based Loading Profiles
|
|
61
|
+
|
|
62
|
+
| Task Type | Agents Loaded | Skills Loaded |
|
|
63
|
+
|:----------|:-------------|:-------------|
|
|
64
|
+
| **Security audit** | security-reviewer, architect | security-practices, architecture |
|
|
65
|
+
| **Feature build** | planner, architect, tdd-guide | plan-writing, testing-patterns, clean-code |
|
|
66
|
+
| **Bug fix** | build-error-resolver | debugging-strategies |
|
|
67
|
+
| **Sprint planning** | sprint-orchestrator, planner | plan-writing, brainstorming |
|
|
68
|
+
| **Code review** | code-reviewer, security-reviewer | clean-code, security-practices |
|
|
69
|
+
| **Deployment** | devops-engineer, reliability-engineer | deployment-procedures, docker-patterns |
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Integration
|
|
74
|
+
|
|
75
|
+
- Triggered at session start by reading `engine/loading-rules.json`
|
|
76
|
+
- Enforced by `reliability-engineer` agent
|
|
77
|
+
- Monitored throughout session lifecycle
|
|
78
|
+
- Compaction delegated to `strategic-compact` skill
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: continuous-learning
|
|
3
|
+
description: Extract reusable patterns from sessions and save them as knowledge
|
|
4
|
+
triggers: [session-end, manual]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Continuous Learning Skill
|
|
8
|
+
|
|
9
|
+
> **Purpose**: Learn from development sessions to improve future assistance
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
This skill implements the PAAL (Perceive-Analyze-Adapt-Learn) cycle to extract reusable patterns from development sessions.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## PAAL Cycle
|
|
20
|
+
|
|
21
|
+
### 1. Perceive
|
|
22
|
+
|
|
23
|
+
Monitor session for significant events:
|
|
24
|
+
|
|
25
|
+
- User corrections
|
|
26
|
+
- Repeated patterns
|
|
27
|
+
- Error resolutions
|
|
28
|
+
- Decision rationale
|
|
29
|
+
|
|
30
|
+
### 2. Analyze
|
|
31
|
+
|
|
32
|
+
Identify learning opportunities:
|
|
33
|
+
|
|
34
|
+
- What went wrong?
|
|
35
|
+
- What went right?
|
|
36
|
+
- What patterns emerged?
|
|
37
|
+
- What knowledge was missing?
|
|
38
|
+
|
|
39
|
+
### 3. Adapt
|
|
40
|
+
|
|
41
|
+
Apply learnings immediately:
|
|
42
|
+
|
|
43
|
+
- Update mental models
|
|
44
|
+
- Adjust approach
|
|
45
|
+
- Incorporate feedback
|
|
46
|
+
|
|
47
|
+
### 4. Learn
|
|
48
|
+
|
|
49
|
+
Persist knowledge for future:
|
|
50
|
+
|
|
51
|
+
- Document patterns in `decisions/`
|
|
52
|
+
- Update knowledge base
|
|
53
|
+
- Create reusable templates
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Pattern Extraction Format
|
|
58
|
+
|
|
59
|
+
```markdown
|
|
60
|
+
# Pattern: [Name]
|
|
61
|
+
|
|
62
|
+
## Context
|
|
63
|
+
|
|
64
|
+
When: [Situation]
|
|
65
|
+
Problem: [What problem this solves]
|
|
66
|
+
|
|
67
|
+
## Solution
|
|
68
|
+
|
|
69
|
+
[How to apply the pattern]
|
|
70
|
+
|
|
71
|
+
## Example
|
|
72
|
+
|
|
73
|
+
[Concrete example]
|
|
74
|
+
|
|
75
|
+
## Anti-patterns
|
|
76
|
+
|
|
77
|
+
[What NOT to do]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Confidence Scoring
|
|
83
|
+
|
|
84
|
+
Patterns are scored 0-5 based on reinforcement frequency:
|
|
85
|
+
|
|
86
|
+
| Score | Label | Criteria |
|
|
87
|
+
|-------|-------|----------|
|
|
88
|
+
| 1 | Observed | Seen once |
|
|
89
|
+
| 2 | Emerging | Confirmed 2-3 times |
|
|
90
|
+
| 3 | Established | Confirmed 4-5 times |
|
|
91
|
+
| 4 | Proven | Confirmed 6-9 times |
|
|
92
|
+
| 5 | Battle-tested | 10+ reinforcements |
|
|
93
|
+
|
|
94
|
+
Runtime: `lib/learning-engine.js` → `scoreConfidence(reinforcementCount)`
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Domain Clustering
|
|
99
|
+
|
|
100
|
+
Patterns are grouped by `loading-rules.json` domains (security, testing, architecture, frontend, backend, database, devops, performance, reliability, mobile, documentation, planning, debugging, refactoring).
|
|
101
|
+
|
|
102
|
+
When a cluster reaches 3+ proven patterns (confidence >= 4), recommend promotion to a new skill or rule.
|
|
103
|
+
|
|
104
|
+
Runtime: `lib/learning-engine.js` → `clusterPatterns(patterns, domainRules)`
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Decay Model
|
|
109
|
+
|
|
110
|
+
Patterns that are not reinforced lose confidence over time:
|
|
111
|
+
- Every 10 sessions without reinforcement: -1 confidence
|
|
112
|
+
- Confidence reaches 0: pattern is archived (not deleted)
|
|
113
|
+
- Archived patterns can be restored if re-observed
|
|
114
|
+
|
|
115
|
+
This prevents stale patterns from consuming context budget.
|
|
116
|
+
|
|
117
|
+
Runtime: `lib/learning-engine.js` → `decayPatterns(patterns)`
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Pattern Extraction Format
|
|
122
|
+
|
|
123
|
+
```markdown
|
|
124
|
+
# Pattern: [Name]
|
|
125
|
+
|
|
126
|
+
## Context
|
|
127
|
+
When: [Situation]
|
|
128
|
+
Problem: [What problem this solves]
|
|
129
|
+
Confidence: [1-5]
|
|
130
|
+
Keywords: [domain keywords for clustering]
|
|
131
|
+
|
|
132
|
+
## Solution
|
|
133
|
+
[How to apply the pattern]
|
|
134
|
+
|
|
135
|
+
## Anti-patterns
|
|
136
|
+
[What NOT to do]
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Integration
|
|
142
|
+
|
|
143
|
+
- Runs at session end via `/learn` or automatically
|
|
144
|
+
- Outputs to `decisions/` directory
|
|
145
|
+
- Runtime engine: `lib/learning-engine.js` (pure functions, zero I/O)
|