@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.
Files changed (231) hide show
  1. package/.agent/CheatSheet.md +350 -0
  2. package/.agent/README.md +76 -0
  3. package/.agent/agents/README.md +155 -0
  4. package/.agent/agents/architect.md +185 -0
  5. package/.agent/agents/backend-specialist.md +276 -0
  6. package/.agent/agents/build-error-resolver.md +207 -0
  7. package/.agent/agents/code-reviewer.md +162 -0
  8. package/.agent/agents/database-architect.md +138 -0
  9. package/.agent/agents/devops-engineer.md +144 -0
  10. package/.agent/agents/doc-updater.md +229 -0
  11. package/.agent/agents/e2e-runner.md +145 -0
  12. package/.agent/agents/explorer-agent.md +143 -0
  13. package/.agent/agents/frontend-specialist.md +144 -0
  14. package/.agent/agents/go-reviewer.md +128 -0
  15. package/.agent/agents/knowledge-agent.md +197 -0
  16. package/.agent/agents/mobile-developer.md +150 -0
  17. package/.agent/agents/performance-optimizer.md +175 -0
  18. package/.agent/agents/planner.md +133 -0
  19. package/.agent/agents/pr-reviewer.md +148 -0
  20. package/.agent/agents/python-reviewer.md +123 -0
  21. package/.agent/agents/refactor-cleaner.md +201 -0
  22. package/.agent/agents/reliability-engineer.md +156 -0
  23. package/.agent/agents/security-reviewer.md +141 -0
  24. package/.agent/agents/sprint-orchestrator.md +124 -0
  25. package/.agent/agents/tdd-guide.md +179 -0
  26. package/.agent/agents/typescript-reviewer.md +110 -0
  27. package/.agent/checklists/README.md +102 -0
  28. package/.agent/checklists/pre-commit.md +93 -0
  29. package/.agent/checklists/session-end.md +99 -0
  30. package/.agent/checklists/session-start.md +102 -0
  31. package/.agent/checklists/task-complete.md +81 -0
  32. package/.agent/commands/README.md +130 -0
  33. package/.agent/commands/adr.md +29 -0
  34. package/.agent/commands/ask.md +28 -0
  35. package/.agent/commands/build.md +30 -0
  36. package/.agent/commands/changelog.md +40 -0
  37. package/.agent/commands/checkpoint.md +28 -0
  38. package/.agent/commands/code-review.md +65 -0
  39. package/.agent/commands/compact.md +28 -0
  40. package/.agent/commands/cook.md +30 -0
  41. package/.agent/commands/db.md +30 -0
  42. package/.agent/commands/debug.md +31 -0
  43. package/.agent/commands/deploy.md +37 -0
  44. package/.agent/commands/design.md +29 -0
  45. package/.agent/commands/doc.md +30 -0
  46. package/.agent/commands/eval.md +30 -0
  47. package/.agent/commands/fix.md +32 -0
  48. package/.agent/commands/git.md +32 -0
  49. package/.agent/commands/help.md +273 -0
  50. package/.agent/commands/implement.md +30 -0
  51. package/.agent/commands/integrate.md +32 -0
  52. package/.agent/commands/learn.md +29 -0
  53. package/.agent/commands/perf.md +31 -0
  54. package/.agent/commands/plan.md +56 -0
  55. package/.agent/commands/pr-describe.md +65 -0
  56. package/.agent/commands/pr-fix.md +45 -0
  57. package/.agent/commands/pr-merge.md +45 -0
  58. package/.agent/commands/pr-review.md +50 -0
  59. package/.agent/commands/pr-split.md +54 -0
  60. package/.agent/commands/pr-status.md +56 -0
  61. package/.agent/commands/pr.md +58 -0
  62. package/.agent/commands/refactor.md +32 -0
  63. package/.agent/commands/research.md +28 -0
  64. package/.agent/commands/scout.md +30 -0
  65. package/.agent/commands/security-scan.md +33 -0
  66. package/.agent/commands/setup.md +31 -0
  67. package/.agent/commands/status.md +59 -0
  68. package/.agent/commands/tdd.md +73 -0
  69. package/.agent/commands/verify.md +58 -0
  70. package/.agent/contexts/brainstorm.md +26 -0
  71. package/.agent/contexts/debug.md +28 -0
  72. package/.agent/contexts/implement.md +29 -0
  73. package/.agent/contexts/plan-quality-log.md +30 -0
  74. package/.agent/contexts/review.md +27 -0
  75. package/.agent/contexts/ship.md +28 -0
  76. package/.agent/decisions/001-trust-grade-governance.md +46 -0
  77. package/.agent/decisions/002-cross-ide-generation.md +15 -0
  78. package/.agent/engine/identity.json +4 -0
  79. package/.agent/engine/loading-rules.json +193 -0
  80. package/.agent/engine/marketplace-index.json +29 -0
  81. package/.agent/engine/mcp-servers/filesystem.json +9 -0
  82. package/.agent/engine/mcp-servers/github.json +11 -0
  83. package/.agent/engine/mcp-servers/postgres.json +11 -0
  84. package/.agent/engine/mcp-servers/supabase.json +11 -0
  85. package/.agent/engine/mcp-servers/vercel.json +11 -0
  86. package/.agent/engine/reliability-config.json +14 -0
  87. package/.agent/engine/sdlc-map.json +50 -0
  88. package/.agent/engine/workflow-state.json +167 -0
  89. package/.agent/hooks/README.md +101 -0
  90. package/.agent/hooks/hooks.json +104 -0
  91. package/.agent/hooks/templates/session-end.md +110 -0
  92. package/.agent/hooks/templates/session-start.md +95 -0
  93. package/.agent/manifest.json +466 -0
  94. package/.agent/rules/agent-upgrade-policy.md +56 -0
  95. package/.agent/rules/architecture.md +111 -0
  96. package/.agent/rules/coding-style.md +75 -0
  97. package/.agent/rules/documentation.md +74 -0
  98. package/.agent/rules/git-workflow.md +140 -0
  99. package/.agent/rules/quality-gate.md +117 -0
  100. package/.agent/rules/security.md +67 -0
  101. package/.agent/rules/sprint-tracking.md +103 -0
  102. package/.agent/rules/testing.md +80 -0
  103. package/.agent/rules/workflow-standards.md +30 -0
  104. package/.agent/rules.md +293 -0
  105. package/.agent/session-context.md +69 -0
  106. package/.agent/session-state.json +27 -0
  107. package/.agent/skills/README.md +135 -0
  108. package/.agent/skills/api-patterns/SKILL.md +117 -0
  109. package/.agent/skills/app-builder/SKILL.md +202 -0
  110. package/.agent/skills/architecture/SKILL.md +101 -0
  111. package/.agent/skills/behavioral-modes/SKILL.md +295 -0
  112. package/.agent/skills/brainstorming/SKILL.md +156 -0
  113. package/.agent/skills/clean-code/SKILL.md +142 -0
  114. package/.agent/skills/context-budget/SKILL.md +78 -0
  115. package/.agent/skills/continuous-learning/SKILL.md +145 -0
  116. package/.agent/skills/database-design/SKILL.md +303 -0
  117. package/.agent/skills/debugging-strategies/SKILL.md +158 -0
  118. package/.agent/skills/deployment-procedures/SKILL.md +191 -0
  119. package/.agent/skills/docker-patterns/SKILL.md +161 -0
  120. package/.agent/skills/eval-harness/SKILL.md +89 -0
  121. package/.agent/skills/frontend-patterns/SKILL.md +141 -0
  122. package/.agent/skills/git-workflow/SKILL.md +159 -0
  123. package/.agent/skills/i18n-localization/SKILL.md +191 -0
  124. package/.agent/skills/intelligent-routing/SKILL.md +180 -0
  125. package/.agent/skills/mcp-integration/SKILL.md +240 -0
  126. package/.agent/skills/mobile-design/SKILL.md +191 -0
  127. package/.agent/skills/nodejs-patterns/SKILL.md +164 -0
  128. package/.agent/skills/parallel-agents/SKILL.md +200 -0
  129. package/.agent/skills/performance-profiling/SKILL.md +134 -0
  130. package/.agent/skills/plan-validation/SKILL.md +192 -0
  131. package/.agent/skills/plan-writing/SKILL.md +183 -0
  132. package/.agent/skills/plan-writing/domain-enhancers.md +184 -0
  133. package/.agent/skills/plan-writing/plan-retrospective.md +116 -0
  134. package/.agent/skills/plan-writing/plan-schema.md +119 -0
  135. package/.agent/skills/pr-toolkit/SKILL.md +174 -0
  136. package/.agent/skills/production-readiness/SKILL.md +126 -0
  137. package/.agent/skills/security-practices/SKILL.md +109 -0
  138. package/.agent/skills/shell-conventions/SKILL.md +92 -0
  139. package/.agent/skills/strategic-compact/SKILL.md +62 -0
  140. package/.agent/skills/testing-patterns/SKILL.md +141 -0
  141. package/.agent/skills/typescript-expert/SKILL.md +160 -0
  142. package/.agent/skills/ui-ux-pro-max/SKILL.md +137 -0
  143. package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
  144. package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
  145. package/.agent/skills/ui-ux-pro-max/data/icons.csv +101 -0
  146. package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
  147. package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
  148. package/.agent/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
  149. package/.agent/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  150. package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  151. package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  152. package/.agent/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  153. package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  154. package/.agent/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  155. package/.agent/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  156. package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  157. package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
  158. package/.agent/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  159. package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  160. package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  161. package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  162. package/.agent/skills/ui-ux-pro-max/data/styles.csv +68 -0
  163. package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
  164. package/.agent/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
  165. package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  166. package/.agent/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
  167. package/.agent/skills/ui-ux-pro-max/scripts/core.py +253 -0
  168. package/.agent/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
  169. package/.agent/skills/ui-ux-pro-max/scripts/search.py +114 -0
  170. package/.agent/skills/verification-loop/SKILL.md +89 -0
  171. package/.agent/skills/webapp-testing/SKILL.md +175 -0
  172. package/.agent/templates/adr-template.md +32 -0
  173. package/.agent/templates/bug-report.md +37 -0
  174. package/.agent/templates/feature-request.md +32 -0
  175. package/.agent/workflows/README.md +101 -0
  176. package/.agent/workflows/brainstorm.md +86 -0
  177. package/.agent/workflows/create.md +85 -0
  178. package/.agent/workflows/debug.md +83 -0
  179. package/.agent/workflows/deploy.md +114 -0
  180. package/.agent/workflows/enhance.md +85 -0
  181. package/.agent/workflows/orchestrate.md +106 -0
  182. package/.agent/workflows/plan.md +105 -0
  183. package/.agent/workflows/pr-fix.md +163 -0
  184. package/.agent/workflows/pr-merge.md +117 -0
  185. package/.agent/workflows/pr-review.md +178 -0
  186. package/.agent/workflows/pr-split.md +118 -0
  187. package/.agent/workflows/pr.md +184 -0
  188. package/.agent/workflows/preflight.md +107 -0
  189. package/.agent/workflows/preview.md +95 -0
  190. package/.agent/workflows/quality-gate.md +103 -0
  191. package/.agent/workflows/retrospective.md +100 -0
  192. package/.agent/workflows/review.md +104 -0
  193. package/.agent/workflows/status.md +89 -0
  194. package/.agent/workflows/test.md +98 -0
  195. package/.agent/workflows/ui-ux-pro-max.md +93 -0
  196. package/.agent/workflows/upgrade.md +97 -0
  197. package/LICENSE +21 -0
  198. package/README.md +218 -0
  199. package/bin/kit.js +773 -0
  200. package/lib/agent-registry.js +228 -0
  201. package/lib/agent-reputation.js +343 -0
  202. package/lib/circuit-breaker.js +195 -0
  203. package/lib/cli-commands.js +322 -0
  204. package/lib/config-validator.js +274 -0
  205. package/lib/conflict-detector.js +252 -0
  206. package/lib/constants.js +47 -0
  207. package/lib/engineering-manager.js +336 -0
  208. package/lib/error-budget.js +370 -0
  209. package/lib/hook-system.js +256 -0
  210. package/lib/ide-generator.js +434 -0
  211. package/lib/identity.js +240 -0
  212. package/lib/io.js +146 -0
  213. package/lib/learning-engine.js +163 -0
  214. package/lib/loading-engine.js +421 -0
  215. package/lib/logger.js +118 -0
  216. package/lib/marketplace.js +321 -0
  217. package/lib/plugin-system.js +604 -0
  218. package/lib/plugin-verifier.js +197 -0
  219. package/lib/rate-limiter.js +113 -0
  220. package/lib/security-scanner.js +312 -0
  221. package/lib/self-healing.js +468 -0
  222. package/lib/session-manager.js +264 -0
  223. package/lib/skill-sandbox.js +244 -0
  224. package/lib/task-governance.js +522 -0
  225. package/lib/task-model.js +332 -0
  226. package/lib/updater.js +240 -0
  227. package/lib/verify.js +279 -0
  228. package/lib/workflow-engine.js +373 -0
  229. package/lib/workflow-events.js +166 -0
  230. package/lib/workflow-persistence.js +160 -0
  231. package/package.json +57 -0
@@ -0,0 +1,111 @@
1
+ # Architecture Rules
2
+
3
+ > **Priority**: HIGH — Enforced in design reviews
4
+ > **Scope**: All workspaces — universal architectural constraints
5
+
6
+ ---
7
+
8
+ ## Architecture Principles
9
+
10
+ | Principle | Enforcement |
11
+ | :----------------------- | :------------------------------------------------------------ |
12
+ | Separation of Concerns | Each module has a single, well-defined responsibility |
13
+ | Dependency Direction | Dependencies ALWAYS point inward — domain never imports infra |
14
+ | Contract-First Design | Define API contracts before implementation begins |
15
+ | Explicit Over Implicit | Configuration, dependencies, and boundaries must be explicit |
16
+ | Composition Over Inherit | Prefer composition and dependency injection over inheritance |
17
+
18
+ ---
19
+
20
+ ## Boundary Enforcement
21
+
22
+ - **NEVER** import backend code from frontend or vice versa
23
+ - **NEVER** skip architectural layers — each layer imports only from the layer directly below
24
+ - **NEVER** hold direct object references across aggregate or module boundaries — use IDs
25
+ - Shared types and contracts are defined at the API boundary and replicated per consumer
26
+ - Cross-module communication uses events or explicit service interfaces, not direct coupling
27
+
28
+ ---
29
+
30
+ ## Project Structure
31
+
32
+ Projects should follow one of these organizational patterns:
33
+
34
+ | Pattern | When to Use |
35
+ | :--------------- | :------------------------------------------------------- |
36
+ | **Monorepo** | Multiple apps sharing code (Turborepo, Nx, Rush) |
37
+ | **Polyrepo** | Independent services with separate lifecycles |
38
+ | **Modular Mono** | Single deployable with clear bounded context separation |
39
+
40
+ > **Customization**: Project-specific structure decisions should be documented in `decisions/` as Architecture Decision Records (ADRs).
41
+
42
+ ---
43
+
44
+ ## Layered Architecture
45
+
46
+ ```
47
+ Thin Routes / Controllers → Service Layer → Models / Data Access
48
+
49
+ Domain Logic
50
+ ```
51
+
52
+ | Layer | Responsibility | Rules |
53
+ | :--------------- | :---------------------------------------- | :------------------------------------------------- |
54
+ | Routes | HTTP handling, auth enforcement | MAX 10 lines per handler, delegate to services |
55
+ | Services | Business logic, validation, orchestration | Pure functions where possible, fully testable |
56
+ | Models / Data | Database schema, relationships | ORM-managed, migration-controlled |
57
+ | Schemas | Request/response contracts | Validated models, explicit field constraints |
58
+
59
+ ---
60
+
61
+ ## Database Conventions
62
+
63
+ - **Migrations** for ALL schema changes — no manual SQL in production
64
+ - Table names: `snake_case`, plural (`users`, `funnel_events`)
65
+ - Column names: `snake_case`
66
+ - Always include: `id` (UUID recommended), `created_at`, `updated_at`
67
+ - Foreign keys: `<entity>_id` naming convention
68
+ - Indexes: create for all foreign keys and frequent query columns
69
+ - Soft deletes preferred over hard deletes for audit-sensitive data
70
+
71
+ ---
72
+
73
+ ## API Design Principles
74
+
75
+ | Principle | Standard |
76
+ | :------------------- | :---------------------------------------------------------- |
77
+ | Versioning | URL-prefix (`/api/v1/`) or header-based — be consistent |
78
+ | Methods | Standard HTTP methods and status codes (RESTful) |
79
+ | Response Format | All endpoints return validated, structured JSON |
80
+ | Pagination | Offset-based (`skip`/`limit`) or cursor-based — documented |
81
+ | Error Format | `{ "detail": "Human-readable message" }` minimum |
82
+ | Rate Limiting | Documented per endpoint, enforced server-side |
83
+
84
+ ---
85
+
86
+ ## Architecture Decision Records
87
+
88
+ When making significant architectural decisions, document them using ADRs in the `decisions/` directory:
89
+
90
+ - Choosing between architectural approaches (monolith vs microservices)
91
+ - Selecting a technology (database, framework, library)
92
+ - Establishing a pattern (event sourcing vs CRUD)
93
+ - Making a trade-off (consistency vs availability)
94
+
95
+ ADR format: `decisions/adr-NNN-<decision-title>.md`
96
+
97
+ ---
98
+
99
+ ## Related Resources
100
+
101
+ - **Skill**: `.agent/skills/architecture/SKILL.md` — deep architectural patterns (DDD, Clean Architecture, 12-Factor, SOLID)
102
+ - **Agent**: `.agent/agents/architect.md` — architecture review process and checklists
103
+
104
+ ---
105
+
106
+ ## Version History
107
+
108
+ | Version | Date | Changes |
109
+ | :------ | :--------- | :----------------------------------------------------- |
110
+ | 1.0.0 | 2026-03-16 | Initial generic architecture enforcement rules for kit |
111
+
@@ -0,0 +1,75 @@
1
+ # Coding Style Rules
2
+
3
+ > **Priority**: HIGH — Enforced in reviews
4
+ > **Scope**: All workspaces (TypeScript + Python)
5
+
6
+ ---
7
+
8
+ ## TypeScript (Frontend & Backend)
9
+
10
+ - **STRICT** mode enabled (`strict: true` in `tsconfig.json`)
11
+ - **NO** `any` type usage — use `unknown` with type guards when needed
12
+ - **EXPLICIT** return types on all exported functions
13
+ - **Zod** for runtime validation of API responses and form input
14
+
15
+ ### Naming Conventions
16
+
17
+ | Entity | Convention | Example |
18
+ | :------------------------- | :---------------- | :-------------------- |
19
+ | Variables & functions | `camelCase` | `getUserProfile` |
20
+ | Types, interfaces, classes | `PascalCase` | `FunnelEventResponse` |
21
+ | Constants | `SCREAMING_SNAKE` | `MAX_RETRY_COUNT` |
22
+ | React components | `PascalCase` | `ThemeToggle` |
23
+ | CSS custom properties | `--kebab-case` | `--color-primary` |
24
+ | File names (components) | `PascalCase.tsx` | `NavDrawer.tsx` |
25
+ | File names (utilities) | `camelCase.ts` | `useScrollState.ts` |
26
+
27
+ ---
28
+
29
+ ## Python (Backend)
30
+
31
+ - **Type hints** on ALL function signatures (parameters + return)
32
+ - **Pydantic** models for all request/response validation
33
+ - **NO** bare `except` clauses — always catch specific exceptions
34
+ - `snake_case` for functions, variables, modules
35
+ - `PascalCase` for classes (SQLAlchemy models, Pydantic schemas)
36
+ - **f-strings** preferred over `.format()` or `%`
37
+
38
+ ---
39
+
40
+ ## File Organization (Universal)
41
+
42
+ | Metric | Limit | Enforcement |
43
+ | :---------------------- | :----------- | :-------------------------------- |
44
+ | Lines per file | MAX 800 | Hard limit |
45
+ | Lines per function | MAX 50 | Hard limit |
46
+ | Nesting depth | MAX 4 levels | Hard limit |
47
+ | Parameters per function | MAX 5 | Soft limit — use objects beyond 5 |
48
+
49
+ ---
50
+
51
+ ## Immutability
52
+
53
+ - **PREFER** `const` over `let` (TypeScript)
54
+ - **USE** spread operator for state updates
55
+ - **AVOID** direct mutation — return new objects/arrays
56
+ - Python: favor tuple unpacking and `dataclass(frozen=True)` where applicable
57
+
58
+ ---
59
+
60
+ ## Import Order
61
+
62
+ ### TypeScript
63
+
64
+ 1. React / Next.js built-ins
65
+ 2. Third-party packages
66
+ 3. Internal aliases (`@/components`, `@/lib`)
67
+ 4. Relative imports
68
+ 5. Type-only imports (`import type { ... }`)
69
+
70
+ ### Python
71
+
72
+ 1. Standard library
73
+ 2. Third-party packages
74
+ 3. Local application imports
75
+ 4. Blank line between each group
@@ -0,0 +1,74 @@
1
+ # Documentation Rules
2
+
3
+ > **Priority**: HIGH — Enforced in reviews
4
+
5
+ ---
6
+
7
+ ## Document Hierarchy
8
+
9
+ | File | Role | Update Frequency |
10
+ | :----------------------- | :--------------------------- | :------------------ |
11
+ | `docs/ARCHITECTURE.md` | System design, tech stack | On architecture changes |
12
+ | `docs/ROADMAP.md` | Sprint tracking (SSOT) | Every session start/end |
13
+ | `docs/CHANGELOG.md` | Shipped work log | Every session end |
14
+ | `.agent/session-context.md` | Session handoff context | Every session end |
15
+ | `.agent/session-state.json` | Machine-readable metadata | Every session end |
16
+
17
+ ---
18
+
19
+ ## ROADMAP.md as SSOT
20
+
21
+ **`docs/ROADMAP.md` is the Single Source of Truth for sprint tracking.**
22
+
23
+ - **NEVER** track task status in any other file
24
+ - **ALWAYS** read ROADMAP.md at session start before doing anything
25
+ - **UPDATE** ROADMAP.md at session end with completed/in-progress items
26
+ - **PRESENT** sprint state to user after loading
27
+
28
+ ---
29
+
30
+ ## CHANGELOG.md Format
31
+
32
+ Follow [Keep a Changelog](https://keepachangelog.com/):
33
+
34
+ ```markdown
35
+ ## [Sprint X] — YYYY-MM-DD
36
+
37
+ ### Added
38
+ - New feature description
39
+
40
+ ### Changed
41
+ - Modified behavior description
42
+
43
+ ### Fixed
44
+ - Bug fix description
45
+ ```
46
+
47
+ ---
48
+
49
+ ## Inline Documentation
50
+
51
+ - **WHY over WHAT**: Comments explain rationale, not mechanics
52
+ - **Complex logic**: Every non-obvious algorithm needs a comment explaining WHY it exists
53
+ - **API docs**: Public APIs documented with JSDoc/docstrings
54
+ - **No stale comments**: If code changes, comments must change too
55
+
56
+ ---
57
+
58
+ ## Preservation Rule
59
+
60
+ **No valuable content shall be silently deleted.**
61
+
62
+ - When updating files, apply changes **additively**
63
+ - If content must be removed, explicitly document what was removed and why
64
+ - Never silently drop sections when rewriting files
65
+
66
+ ---
67
+
68
+ ## Cross-Reference Integrity
69
+
70
+ **When referencing actions in other files, complete those actions in the same commit.**
71
+
72
+ - **Reference = Action**: "Move to X.md" means update X.md immediately
73
+ - **Completion Check**: Verify all referenced actions are completed
74
+ - **No broken links**: All file references must point to existing files
@@ -0,0 +1,140 @@
1
+ # Git Workflow Rules — GitFlow
2
+
3
+ > **Priority**: HIGH — Enforced by hooks
4
+ > **Strategy**: GitFlow with `dev` as integration branch, `main` as production
5
+
6
+ > [!CAUTION]
7
+ > **PUSH POLICY**: NEVER push commits during implementation or task work.
8
+ > Commits are **local-only** until the user explicitly requests the **session-end protocol**.
9
+ > The pre-push hook runs the full LOCAL-CI-GATE (lint, type-check, tests, build) which takes 60-160 seconds.
10
+ > Premature pushes waste time and block the agent. Only push once, at session end, after all work is verified.
11
+
12
+ ---
13
+
14
+ ## Branch Strategy
15
+
16
+ ```
17
+ main (production — protected, release-only)
18
+ └── dev (integration — all features merge here first)
19
+ ├── feat/add-python-agent
20
+ ├── fix/cli-init-error
21
+ ├── refactor/loading-engine
22
+ └── docs/update-readme
23
+ ```
24
+
25
+ ### Branch Types
26
+
27
+ | Branch | Base | Merges Into | Purpose |
28
+ | :--- | :--- | :--- | :--- |
29
+ | `main` | — | — | Production releases only. Never commit directly. |
30
+ | `dev` | `main` | `main` (via release PR) | Integration branch. All feature work targets here. |
31
+ | `feat/*` | `dev` | `dev` | New features |
32
+ | `fix/*` | `dev` | `dev` | Bug fixes |
33
+ | `refactor/*` | `dev` | `dev` | Code restructuring |
34
+ | `docs/*` | `dev` | `dev` | Documentation |
35
+ | `test/*` | `dev` | `dev` | Test additions |
36
+ | `chore/*` | `dev` | `dev` | Maintenance |
37
+ | `hotfix/*` | `main` | `main` AND `dev` | Critical production fixes |
38
+
39
+ ### Branch Naming Convention
40
+
41
+ ```
42
+ type/short-description
43
+ ```
44
+
45
+ Examples:
46
+ - `feat/pr-toolkit-v2`
47
+ - `fix/windows-eperm-retry`
48
+ - `hotfix/security-patch-auth`
49
+ - `chore/bump-vitest-v4`
50
+
51
+ ---
52
+
53
+ ## Merge Rules
54
+
55
+ ### Feature → dev
56
+
57
+ 1. Create feature branch from `dev`
58
+ 2. Develop and commit locally (conventional commits)
59
+ 3. Push feature branch to remote
60
+ 4. Create PR targeting `dev`
61
+ 5. Wait for CI checks to pass
62
+ 6. Wait for reviewer approval (gemini-code-assist or human)
63
+ 7. Squash-merge into `dev`
64
+
65
+ ### dev → main (Release)
66
+
67
+ 1. Ensure `dev` is stable (all CI green, no WIP)
68
+ 2. Create release PR: `dev` → `main`
69
+ 3. PR title: `release: vX.Y.Z`
70
+ 4. Wait for ALL CI checks to pass
71
+ 5. Wait for human review approval
72
+ 6. Merge (no squash — preserve history)
73
+ 7. Tag the release: `git tag vX.Y.Z`
74
+ 8. Run `npm publish` from `main`
75
+ 9. Merge `main` back into `dev` (sync release commit)
76
+
77
+ ### hotfix → main
78
+
79
+ 1. Create `hotfix/*` branch from `main`
80
+ 2. Fix the issue with minimal changes
81
+ 3. Create PR targeting `main`
82
+ 4. After merge, merge `main` back into `dev` to sync the hotfix
83
+
84
+ ---
85
+
86
+ ## Commit Format
87
+
88
+ ```
89
+ type(scope): description
90
+
91
+ [optional body]
92
+
93
+ [optional footer]
94
+ ```
95
+
96
+ ### Types
97
+
98
+ | Type | Use |
99
+ | :--- | :--- |
100
+ | `feat` | New feature |
101
+ | `fix` | Bug fix |
102
+ | `docs` | Documentation |
103
+ | `refactor` | Code restructuring |
104
+ | `test` | Test additions |
105
+ | `chore` | Maintenance |
106
+ | `perf` | Performance optimization |
107
+ | `ci` | CI/CD changes |
108
+
109
+ ---
110
+
111
+ ## Before Commit
112
+
113
+ - [ ] All tests pass (`npm test`)
114
+ - [ ] Lint passes
115
+ - [ ] Build succeeds
116
+ - [ ] No secrets in code
117
+ - [ ] Counts synced if components added/removed
118
+
119
+ ## Pull Requests
120
+
121
+ - **REQUIRE** code review (gemini-code-assist + human)
122
+ - **INCLUDE** test coverage
123
+ - **LINK** to issue/ticket
124
+ - **TARGET** `dev` for features/fixes, `main` for releases/hotfixes only
125
+ - **NEVER** create a PR from `main` or `dev` directly
126
+ - **CONVENTIONAL** title format: `type(scope): description`
127
+
128
+ ---
129
+
130
+ ## Session-End Protocol (Commit & Push)
131
+
132
+ When the user says "Commit & Push" or similar:
133
+
134
+ 1. **Branch Check**: Verify you're on a feature branch (not `main` or `dev`)
135
+ 2. **Stage Changes**: `git add` relevant files (never `git add -A` blindly)
136
+ 3. **Commit**: Use conventional commit message
137
+ 4. **Push**: Push feature branch to remote with `-u` flag
138
+ 5. **Create PR**: Target `dev` branch (not `main`)
139
+ 6. **Report**: Share PR URL and wait for CI + reviewer approval
140
+ 7. **Do NOT merge**: User decides when to merge after reviews pass
@@ -0,0 +1,117 @@
1
+ # Quality Gate Rules
2
+
3
+ > **Priority**: HIGH — Enforced before implementation of new features and refactors
4
+ > **Scope**: All workspaces — applies to `feat()` and `refactor()` tasks only
5
+
6
+ ---
7
+
8
+ ## Scope Filter
9
+
10
+ | Task Type | Quality Gate Required? |
11
+ | :-------------------------------- | :--------------------- |
12
+ | `feat()` — new features | ✅ Required |
13
+ | `refactor()` — structural changes | ✅ Required |
14
+ | `fix()` — bug fixes | ❌ Skip |
15
+ | `chore()` — maintenance | ❌ Skip |
16
+ | `docs()` — documentation | ❌ Skip |
17
+ | `test()` — test additions | ❌ Skip |
18
+
19
+ ---
20
+
21
+ ## Pre-Execution Research Checklist
22
+
23
+ Before implementing any in-scope task, **ALL** items must be completed. If any item is incomplete, execution is forbidden.
24
+
25
+ ### ☐ 1. Market Research Completed
26
+
27
+ - Analyze **minimum 5** competitors or market leaders in the feature domain
28
+ - Document how each implements the same or similar feature
29
+ - Identify user adoption drivers: UX simplicity, accuracy, speed, transparency
30
+
31
+ ### ☐ 2. Outdated Pattern Verification
32
+
33
+ - Verify the proposed approach does not use deprecated, abandoned, or criticized patterns
34
+ - If outdated → propose a modern, evidence-based alternative (mandatory)
35
+ - Document which patterns are considered harmful or legacy
36
+
37
+ ### ☐ 3. Baseline Parity Validation
38
+
39
+ - Confirm the project **meets or exceeds** the current market baseline
40
+ - Gaps must be explicitly listed with severity assessment
41
+ - No gap left unaddressed without documented justification
42
+
43
+ ### ☐ 4. Enhancement Definition
44
+
45
+ - Define exactly how the project **improves upon** the market baseline
46
+ - Improvement must be intentional and documented
47
+ - Consider: transparency, ethical automation, user-centricity, measurable outcomes
48
+
49
+ ### ☐ 5. Ethics & Automation Risk Assessment
50
+
51
+ - Evaluate: privacy implications, AI bias risks, automation safety, user autonomy
52
+ - Mitigation strategies must be documented for each identified risk
53
+ - Data protection compliance must be considered for data-touching features
54
+
55
+ ### ☐ 6. Implementation Plan Prepared
56
+
57
+ - Structured plan ready before execution begins
58
+ - Plan includes research summary, key insights, risks, execution steps
59
+ - Plan reviewed and approved before implementation may begin
60
+
61
+ ---
62
+
63
+ ## Enhancement Principle
64
+
65
+ | Scenario | Required Action |
66
+ | :------------------------------------------ | :------------------------------- |
67
+ | Competitors offer a standard | **Meet or exceed** it |
68
+ | Competitors use unethical automation | **Reject and improve** |
69
+ | Feature can be more transparent | **Enhance by default** |
70
+ | Feature can be more user-centric | **Enhance by default** |
71
+ | Feature can offer measurable outcomes | **Enhance by default** |
72
+
73
+ **Never replicate patterns without improvement.**
74
+
75
+ ---
76
+
77
+ ## Cross-Cutting Deference
78
+
79
+ Quality gate enforcement defers to specialized rules for domain-specific checks:
80
+
81
+ - **Security**: See `rules/security.md` for input validation, auth, data protection
82
+ - **Testing**: See `rules/testing.md` for coverage requirements, test types
83
+ - **Code Quality**: See `rules/coding-style.md` for naming, file limits, immutability
84
+ - **Documentation**: See `rules/documentation.md` for doc hierarchy, SSOT
85
+
86
+ ---
87
+
88
+ ## Reject & Escalate Rules
89
+
90
+ | Condition | Action |
91
+ | :------------------------------------------ | :------------------------------------- |
92
+ | No market research provided | ❌ Reject — enforce research protocol |
93
+ | Clearly outdated or harmful patterns | ❌ Reject — propose modern alternative |
94
+ | Below-market standard solutions | ❌ Reject — document gap |
95
+ | Ethics, privacy, or automation safety risks | ❌ Reject — document mitigation |
96
+ | Bypassing research ("just implement it") | ❌ Reject — enforce protocol |
97
+
98
+ ### Escalation Response
99
+
100
+ > "This task cannot proceed in its current form, as it does not meet quality and market standards. Below are the identified risks and gaps. A revised, modern alternative is proposed."
101
+
102
+ ---
103
+
104
+ ## Related Resources
105
+
106
+ - **Workflow**: `.agent/workflows/quality-gate.md` — step-by-step research procedure
107
+ - **Skill**: `.agent/skills/brainstorming/SKILL.md` — Socratic questioning patterns
108
+ - **Next Step**: After approval, proceed to `/plan` for implementation planning
109
+
110
+ ---
111
+
112
+ ## Version History
113
+
114
+ | Version | Date | Changes |
115
+ | :------ | :--------- | :------------------------------------------------ |
116
+ | 1.0.0 | 2026-03-16 | Initial generic quality gate protocol for kit |
117
+
@@ -0,0 +1,67 @@
1
+ # Security Rules
2
+
3
+ > **Priority**: CRITICAL — Inviolable
4
+
5
+ ---
6
+
7
+ ## Secrets Management
8
+
9
+ - **NEVER** hardcode secrets in source code
10
+ - **ALWAYS** use environment variables via project config
11
+ - **BLOCK** commits containing `sk-`, `api_key=`, `password=`, `secret=`
12
+ - **MAINTAIN** `.env.example` with all required variables (values redacted)
13
+ - `.env` files MUST be in `.gitignore` — no exceptions
14
+
15
+ ---
16
+
17
+ ## Input Validation
18
+
19
+ - **Backend**: Pydantic/Zod models validate ALL request bodies and query params
20
+ - **Frontend**: Zod schemas validate ALL form inputs and API responses
21
+ - **NEVER** trust client-side data — re-validate server-side
22
+ - **SANITIZE** all input before database writes or AI pipeline consumption
23
+ - **LIMIT** payload sizes (request body, file uploads)
24
+
25
+ ---
26
+
27
+ ## Authentication & Authorization
28
+
29
+ - **JWT** with separate access and refresh token secrets
30
+ - **REQUIRE** authentication on all sensitive endpoints
31
+ - Rate limiting: **5 login attempts/minute**, **10 API calls/hour/user** (adjust per project)
32
+ - **ROTATE** tokens on logout and password change
33
+ - Refresh tokens: httpOnly cookies, NOT localStorage
34
+
35
+ ---
36
+
37
+ ## Data Protection
38
+
39
+ > Projects processing PII must comply with applicable data protection regulations (GDPR, CCPA, etc.).
40
+
41
+ | Principle | Implementation |
42
+ | :----------------- | :---------------------------------------------- |
43
+ | Data minimization | Collect only what's needed for the feature |
44
+ | Purpose limitation | Document why each data field is collected |
45
+ | Right to erasure | User account deletion cascades to all user data |
46
+ | Data encryption | PII encrypted at rest (database-level) |
47
+ | Transfer security | HTTPS enforced for all API communication |
48
+ | Consent | Explicit opt-in for AI processing of user data |
49
+ | Retention | Define and enforce data retention periods |
50
+
51
+ ---
52
+
53
+ ## API Security
54
+
55
+ - **CORS**: Restrict to known origins only (project domains + localhost)
56
+ - **Headers**: Set security headers (`X-Content-Type-Options`, `X-Frame-Options`, `Strict-Transport-Security`)
57
+ - **Logging**: Log auth failures, never log passwords or tokens
58
+ - **Dependencies**: Run `npm audit` and `pip audit` before releases
59
+
60
+ ---
61
+
62
+ ## AI Pipeline Safety
63
+
64
+ - **NEVER** send raw user PII to external AI providers without anonymization review
65
+ - **LOG** all AI API calls for audit trail (sans PII)
66
+ - **VALIDATE** AI outputs before presenting to users (hallucination guards)
67
+ - **RATE LIMIT** AI provider calls to prevent cost overruns
@@ -0,0 +1,103 @@
1
+ # Sprint Tracking Protocol
2
+
3
+ > **Priority**: CRITICAL — Enforced by session checklists
4
+ > **SSOT**: `docs/ROADMAP.md` is the **only** place where task status is tracked
5
+
6
+ ---
7
+
8
+ ## Core Principle
9
+
10
+ > **`docs/ROADMAP.md` is the Single Source of Truth.**
11
+ > No task status lives outside this file. No exceptions.
12
+ > If it's not in ROADMAP.md, it doesn't exist as a tracked item.
13
+
14
+ ---
15
+
16
+ ## Session Start Protocol
17
+
18
+ 1. **Read** `docs/ROADMAP.md` — load current sprint state
19
+ 2. **Identify** in-progress `[/]` items from last session
20
+ 3. **Present** sprint state summary to user before starting work
21
+ 4. **Validate** against `docs/ARCHITECTURE.md` for structural context
22
+ 5. **Begin** work only after user confirms direction
23
+
24
+ ---
25
+
26
+ ## Session End Protocol
27
+
28
+ 1. **Update** `docs/ROADMAP.md` with completed `[x]` and in-progress `[/]` items
29
+ 2. **Sync** `docs/CHANGELOG.md` with shipped work from this session
30
+ 3. **Update** `.agent/session-context.md` with handoff notes for next session
31
+ 4. **Update** `.agent/session-state.json` with machine-readable metadata
32
+ 5. **Verify** no duplicate entries exist (ROADMAP ↔ CHANGELOG ↔ session-context)
33
+ 6. **Commit** all tracking files together in a single atomic commit
34
+
35
+ ---
36
+
37
+ ## Mid-Session Updates
38
+
39
+ - **Mark items `[/]`** when starting work on them
40
+ - **Mark items `[x]`** immediately when completing them
41
+ - **Add sub-items** under parent tasks as they're discovered
42
+ - **NEVER** mark items complete without verification
43
+
44
+ ---
45
+
46
+ ## Sprint Lifecycle States
47
+
48
+ | Marker | Meaning | When to Use |
49
+ | :----- | :----------- | :----------------------------------- |
50
+ | `[ ]` | Not started | Task exists but work hasn't begun |
51
+ | `[/]` | In progress | Actively being worked on |
52
+ | `[x]` | Completed | Done and verified |
53
+ | `[-]` | Cancelled | Intentionally dropped with reason |
54
+
55
+ ---
56
+
57
+ ## Sprint Question Protocol
58
+
59
+ When the user asks about sprint status:
60
+
61
+ 1. **ALWAYS** read `docs/ROADMAP.md` first
62
+ 2. **PRESENT** the current state from the file
63
+ 3. **NEVER** answer from memory — the file is the source of truth
64
+ 4. If file is stale or missing, inform user and offer to create/update it
65
+
66
+ ---
67
+
68
+ ## Reject & Escalate Rules
69
+
70
+ ### REJECT (Agent must refuse)
71
+
72
+ - Tracking task status in `session-context.md` instead of `ROADMAP.md`
73
+ - Creating duplicate task lists in multiple files
74
+ - Marking tasks complete without verification
75
+ - Updating CHANGELOG without updating ROADMAP
76
+
77
+ ### ESCALATE (Agent must ask user)
78
+
79
+ - Sprint scope changes (adding/removing major items)
80
+ - Changing sprint deadlines
81
+ - Deferring critical-path items to next sprint
82
+ - Architecture changes that affect sprint estimates
83
+
84
+ ---
85
+
86
+ ## Cultural References
87
+
88
+ > These organizations exemplify the sprint discipline we enforce:
89
+
90
+ | Company | Practice We Adopt |
91
+ | :--------- | :----------------------------------------- |
92
+ | Stripe | Ship fast, measure everything, iterate |
93
+ | Amazon | Two-pizza teams, ownership, bias for action |
94
+ | Anthropic | Safety-first, no shortcuts on quality |
95
+ | Linear | Opinionated tooling, consistent execution |
96
+
97
+ ---
98
+
99
+ ## Version History
100
+
101
+ | Version | Date | Changes |
102
+ | :------ | :--------- | :----------------------------------------- |
103
+ | 1.0.0 | 2026-03-15 | Initial sprint tracking protocol for kit |