@c0x12c/ai-toolkit 1.15.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/.claude-plugin/marketplace.json +16 -0
- package/.claude-plugin/plugin.json +12 -0
- package/README.md +439 -0
- package/VERSION +1 -0
- package/agents/design-critic.md +127 -0
- package/agents/idea-killer.md +72 -0
- package/agents/infrastructure-expert.md +49 -0
- package/agents/micronaut-backend-expert.md +45 -0
- package/agents/phase-reviewer.md +150 -0
- package/agents/research-planner.md +70 -0
- package/agents/solution-architect-cto.md +49 -0
- package/agents/sre-architect.md +49 -0
- package/agents/team-coordinator.md +111 -0
- package/bin/cli.js +780 -0
- package/claude-md/00-header.md +39 -0
- package/claude-md/01-core.md +105 -0
- package/claude-md/05-database.md +20 -0
- package/claude-md/11-backend-micronaut.md +19 -0
- package/claude-md/20-frontend-react.md +44 -0
- package/claude-md/25-ux-design.md +56 -0
- package/claude-md/30-infrastructure.md +24 -0
- package/claude-md/30-project-mgmt.md +119 -0
- package/claude-md/40-product.md +39 -0
- package/claude-md/50-ops.md +34 -0
- package/claude-md/60-research.md +27 -0
- package/claude-md/90-footer.md +21 -0
- package/commands/spartan/brainstorm.md +134 -0
- package/commands/spartan/brownfield.md +157 -0
- package/commands/spartan/build.md +435 -0
- package/commands/spartan/careful.md +94 -0
- package/commands/spartan/commit-message.md +112 -0
- package/commands/spartan/content.md +17 -0
- package/commands/spartan/context-save.md +161 -0
- package/commands/spartan/contribute.md +140 -0
- package/commands/spartan/daily.md +42 -0
- package/commands/spartan/debug.md +308 -0
- package/commands/spartan/deep-dive.md +55 -0
- package/commands/spartan/deploy.md +207 -0
- package/commands/spartan/e2e.md +264 -0
- package/commands/spartan/env-setup.md +166 -0
- package/commands/spartan/epic.md +199 -0
- package/commands/spartan/fe-review.md +181 -0
- package/commands/spartan/figma-to-code.md +260 -0
- package/commands/spartan/forensics.md +46 -0
- package/commands/spartan/freeze.md +84 -0
- package/commands/spartan/fundraise.md +53 -0
- package/commands/spartan/gate-review.md +229 -0
- package/commands/spartan/gsd-upgrade.md +376 -0
- package/commands/spartan/guard.md +42 -0
- package/commands/spartan/init-project.md +178 -0
- package/commands/spartan/init-rules.md +298 -0
- package/commands/spartan/interview.md +154 -0
- package/commands/spartan/kickoff.md +73 -0
- package/commands/spartan/kotlin-service.md +109 -0
- package/commands/spartan/lean-canvas.md +222 -0
- package/commands/spartan/lint-rules.md +122 -0
- package/commands/spartan/map-codebase.md +124 -0
- package/commands/spartan/migration.md +82 -0
- package/commands/spartan/next-app.md +317 -0
- package/commands/spartan/next-feature.md +212 -0
- package/commands/spartan/onboard.md +326 -0
- package/commands/spartan/outreach.md +16 -0
- package/commands/spartan/phase.md +142 -0
- package/commands/spartan/pitch.md +18 -0
- package/commands/spartan/plan.md +210 -0
- package/commands/spartan/pr-ready.md +202 -0
- package/commands/spartan/project.md +106 -0
- package/commands/spartan/qa.md +222 -0
- package/commands/spartan/research.md +254 -0
- package/commands/spartan/review.md +132 -0
- package/commands/spartan/scan-rules.md +173 -0
- package/commands/spartan/sessions.md +143 -0
- package/commands/spartan/spec.md +131 -0
- package/commands/spartan/startup.md +257 -0
- package/commands/spartan/team.md +570 -0
- package/commands/spartan/teardown.md +161 -0
- package/commands/spartan/testcontainer.md +97 -0
- package/commands/spartan/tf-cost.md +123 -0
- package/commands/spartan/tf-deploy.md +116 -0
- package/commands/spartan/tf-drift.md +100 -0
- package/commands/spartan/tf-import.md +107 -0
- package/commands/spartan/tf-module.md +121 -0
- package/commands/spartan/tf-plan.md +100 -0
- package/commands/spartan/tf-review.md +106 -0
- package/commands/spartan/tf-scaffold.md +109 -0
- package/commands/spartan/tf-security.md +147 -0
- package/commands/spartan/think.md +221 -0
- package/commands/spartan/unfreeze.md +13 -0
- package/commands/spartan/update.md +134 -0
- package/commands/spartan/ux.md +1233 -0
- package/commands/spartan/validate.md +193 -0
- package/commands/spartan/web-to-prd.md +706 -0
- package/commands/spartan/workstreams.md +109 -0
- package/commands/spartan/write.md +16 -0
- package/commands/spartan.md +386 -0
- package/frameworks/00-framework-comparison-guide.md +317 -0
- package/frameworks/01-lean-canvas.md +196 -0
- package/frameworks/02-design-sprint.md +304 -0
- package/frameworks/03-foundation-sprint.md +337 -0
- package/frameworks/04-business-model-canvas.md +391 -0
- package/frameworks/05-customer-development.md +426 -0
- package/frameworks/06-jobs-to-be-done.md +358 -0
- package/frameworks/07-mom-test.md +392 -0
- package/frameworks/08-value-proposition-canvas.md +488 -0
- package/frameworks/09-javelin-board.md +428 -0
- package/frameworks/10-build-measure-learn.md +467 -0
- package/frameworks/11-mvp-approaches.md +533 -0
- package/frameworks/think-before-build.md +593 -0
- package/lib/assembler.js +197 -0
- package/lib/assembler.test.js +159 -0
- package/lib/detector.js +166 -0
- package/lib/detector.test.js +221 -0
- package/lib/packs.js +16 -0
- package/lib/resolver.js +272 -0
- package/lib/resolver.test.js +298 -0
- package/lib/worktree.sh +104 -0
- package/package.json +50 -0
- package/packs/backend-micronaut.yaml +35 -0
- package/packs/backend-nodejs.yaml +15 -0
- package/packs/backend-python.yaml +15 -0
- package/packs/core.yaml +37 -0
- package/packs/database.yaml +21 -0
- package/packs/frontend-react.yaml +24 -0
- package/packs/infrastructure.yaml +40 -0
- package/packs/ops.yaml +16 -0
- package/packs/packs.compiled.json +371 -0
- package/packs/product.yaml +22 -0
- package/packs/project-mgmt.yaml +24 -0
- package/packs/research.yaml +39 -0
- package/packs/shared-backend.yaml +14 -0
- package/packs/ux-design.yaml +21 -0
- package/rules/backend-micronaut/API_DESIGN.md +313 -0
- package/rules/backend-micronaut/BATCH_PROCESSING.md +92 -0
- package/rules/backend-micronaut/CONTROLLERS.md +388 -0
- package/rules/backend-micronaut/KOTLIN.md +414 -0
- package/rules/backend-micronaut/RETROFIT_PLACEMENT.md +290 -0
- package/rules/backend-micronaut/SERVICES_AND_BEANS.md +325 -0
- package/rules/core/NAMING_CONVENTIONS.md +208 -0
- package/rules/core/SKILL_AUTHORING.md +174 -0
- package/rules/core/TIMEZONE.md +316 -0
- package/rules/database/ORM_AND_REPO.md +289 -0
- package/rules/database/SCHEMA.md +146 -0
- package/rules/database/TRANSACTIONS.md +311 -0
- package/rules/frontend-react/FRONTEND.md +344 -0
- package/rules/infrastructure/MODULES.md +260 -0
- package/rules/infrastructure/NAMING.md +196 -0
- package/rules/infrastructure/PROVIDERS.md +309 -0
- package/rules/infrastructure/SECURITY.md +310 -0
- package/rules/infrastructure/STATE_AND_BACKEND.md +237 -0
- package/rules/infrastructure/STRUCTURE.md +234 -0
- package/rules/infrastructure/VARIABLES.md +285 -0
- package/rules/shared-backend/ARCHITECTURE.md +46 -0
- package/rules/ux-design/DESIGN_PROCESS.md +176 -0
- package/skills/api-endpoint-creator/SKILL.md +455 -0
- package/skills/api-endpoint-creator/error-handling-guide.md +244 -0
- package/skills/api-endpoint-creator/examples.md +522 -0
- package/skills/api-endpoint-creator/testing-patterns.md +302 -0
- package/skills/article-writing/SKILL.md +109 -0
- package/skills/article-writing/examples.md +59 -0
- package/skills/backend-api-design/SKILL.md +84 -0
- package/skills/backend-api-design/code-patterns.md +138 -0
- package/skills/brainstorm/SKILL.md +95 -0
- package/skills/browser-qa/SKILL.md +87 -0
- package/skills/browser-qa/playwright-snippets.md +110 -0
- package/skills/ci-cd-patterns/SKILL.md +108 -0
- package/skills/ci-cd-patterns/workflows.md +149 -0
- package/skills/competitive-teardown/SKILL.md +93 -0
- package/skills/competitive-teardown/example-analysis.md +50 -0
- package/skills/content-engine/SKILL.md +131 -0
- package/skills/content-engine/examples.md +72 -0
- package/skills/database-patterns/SKILL.md +72 -0
- package/skills/database-patterns/code-templates.md +114 -0
- package/skills/database-table-creator/SKILL.md +141 -0
- package/skills/database-table-creator/examples.md +552 -0
- package/skills/database-table-creator/kotlin-templates.md +400 -0
- package/skills/database-table-creator/migration-template.sql +68 -0
- package/skills/database-table-creator/validation-checklist.md +337 -0
- package/skills/deep-research/SKILL.md +80 -0
- package/skills/design-intelligence/SKILL.md +268 -0
- package/skills/design-workflow/SKILL.md +127 -0
- package/skills/design-workflow/checklists.md +45 -0
- package/skills/idea-validation/SKILL.md +129 -0
- package/skills/idea-validation/example-report.md +50 -0
- package/skills/investor-materials/SKILL.md +122 -0
- package/skills/investor-materials/example-outline.md +70 -0
- package/skills/investor-outreach/SKILL.md +112 -0
- package/skills/investor-outreach/examples.md +76 -0
- package/skills/kotlin-best-practices/SKILL.md +58 -0
- package/skills/kotlin-best-practices/code-patterns.md +132 -0
- package/skills/market-research/SKILL.md +99 -0
- package/skills/security-checklist/SKILL.md +65 -0
- package/skills/security-checklist/audit-reference.md +95 -0
- package/skills/service-debugging/SKILL.md +116 -0
- package/skills/service-debugging/common-issues.md +65 -0
- package/skills/startup-pipeline/SKILL.md +152 -0
- package/skills/terraform-best-practices/SKILL.md +244 -0
- package/skills/terraform-module-creator/SKILL.md +284 -0
- package/skills/terraform-review/SKILL.md +222 -0
- package/skills/terraform-security-audit/SKILL.md +280 -0
- package/skills/terraform-service-scaffold/SKILL.md +574 -0
- package/skills/testing-strategies/SKILL.md +116 -0
- package/skills/testing-strategies/examples.md +103 -0
- package/skills/testing-strategies/integration-test-setup.md +71 -0
- package/skills/ui-ux-pro-max/SKILL.md +238 -0
- package/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/skills/ui-ux-pro-max/python-setup.md +146 -0
- package/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/skills/ui-ux-pro-max/scripts/search.py +114 -0
- package/skills/web-to-prd/SKILL.md +478 -0
- package/templates/build-config.yaml +44 -0
- package/templates/commands-config.yaml +55 -0
- package/templates/competitor-analysis.md +60 -0
- package/templates/content/AGENT_TEMPLATE.md +47 -0
- package/templates/content/COMMAND_TEMPLATE.md +27 -0
- package/templates/content/RULE_TEMPLATE.md +40 -0
- package/templates/content/SKILL_TEMPLATE.md +41 -0
- package/templates/design-config.md +105 -0
- package/templates/design-doc.md +207 -0
- package/templates/epic.md +100 -0
- package/templates/feature-spec.md +181 -0
- package/templates/idea-canvas.md +47 -0
- package/templates/implementation-plan.md +159 -0
- package/templates/prd-template.md +86 -0
- package/templates/preamble.md +89 -0
- package/templates/project-readme.md +35 -0
- package/templates/quality-gates.md +230 -0
- package/templates/spartan-config.yaml +164 -0
- package/templates/user-interview.md +69 -0
- package/templates/validation-checklist.md +108 -0
- package/templates/workflow-backend-micronaut.md +409 -0
- package/templates/workflow-frontend-react.md +233 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Investor Outreach — Email Examples
|
|
2
|
+
|
|
3
|
+
> Read these examples to calibrate your email style. Short, specific, and with a clear ask.
|
|
4
|
+
|
|
5
|
+
## Cold Email
|
|
6
|
+
|
|
7
|
+
### Bad
|
|
8
|
+
> Subject: Exciting Opportunity in the AI Space
|
|
9
|
+
>
|
|
10
|
+
> Dear [Investor Name],
|
|
11
|
+
>
|
|
12
|
+
> I hope this email finds you well. My name is [Name] and I'm the CEO of [Company]. We are building a revolutionary AI-powered platform that leverages cutting-edge machine learning technology to transform the way businesses handle customer support.
|
|
13
|
+
>
|
|
14
|
+
> We have a comprehensive product roadmap and a talented team of engineers from top universities. Our platform utilizes state-of-the-art natural language processing to deliver seamless customer experiences.
|
|
15
|
+
>
|
|
16
|
+
> I would love to schedule a 30-minute call to discuss how we can work together. Please let me know your availability.
|
|
17
|
+
>
|
|
18
|
+
> Best regards,
|
|
19
|
+
> [Name]
|
|
20
|
+
|
|
21
|
+
**Problems:** Generic subject, "I hope this email finds you well", buzzword soup, no proof point, no personalization, too long, asks for 30 minutes from a stranger.
|
|
22
|
+
|
|
23
|
+
### Good
|
|
24
|
+
> Subject: AI support tool — 40 paying customers, raising seed
|
|
25
|
+
>
|
|
26
|
+
> Hi Sarah,
|
|
27
|
+
>
|
|
28
|
+
> Your investment in Intercom caught my eye — we're solving a related problem for smaller teams.
|
|
29
|
+
>
|
|
30
|
+
> We built an AI tool that handles L1 support tickets automatically. 40 companies paying us, $18K MRR, growing 25% monthly. B2B SaaS teams with 2-5 support agents.
|
|
31
|
+
>
|
|
32
|
+
> Would you be open to a 15-min intro call next week?
|
|
33
|
+
>
|
|
34
|
+
> [Name]
|
|
35
|
+
> CEO, [Company]
|
|
36
|
+
|
|
37
|
+
**Why this works:** Specific subject with proof point, personalized to their portfolio, concrete numbers, short ask.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Warm Intro Request
|
|
42
|
+
|
|
43
|
+
### The Ask (to the connector)
|
|
44
|
+
> Hey [Connector],
|
|
45
|
+
>
|
|
46
|
+
> Would you be open to introducing me to Sarah at [Fund]? She led their Intercom investment and we're in a similar space (AI for support teams).
|
|
47
|
+
>
|
|
48
|
+
> Here's a forwardable blurb if you're up for it:
|
|
49
|
+
|
|
50
|
+
### Forwardable Blurb
|
|
51
|
+
> [Name] is building [Company] — an AI tool that auto-resolves L1 support tickets. 40 paying customers, $18K MRR, 25% monthly growth. Raising a $2M seed. Thought it might be up your alley given the Intercom investment.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Follow-Up (Day 5)
|
|
56
|
+
|
|
57
|
+
### Bad
|
|
58
|
+
> Hi Sarah,
|
|
59
|
+
>
|
|
60
|
+
> Just following up on my previous email. I wanted to make sure it didn't get lost in your inbox. Would love to connect when you have a chance.
|
|
61
|
+
>
|
|
62
|
+
> Best,
|
|
63
|
+
> [Name]
|
|
64
|
+
|
|
65
|
+
**Problems:** No new information, apologetic tone, "didn't get lost in your inbox" is cliche.
|
|
66
|
+
|
|
67
|
+
### Good
|
|
68
|
+
> Hi Sarah,
|
|
69
|
+
>
|
|
70
|
+
> Quick update since last week — we crossed $20K MRR and signed our first enterprise pilot (200-seat team).
|
|
71
|
+
>
|
|
72
|
+
> Still raising our seed if the timing works on your end.
|
|
73
|
+
>
|
|
74
|
+
> [Name]
|
|
75
|
+
|
|
76
|
+
**Why this works:** New information (MRR growth + enterprise pilot), short, no begging, leaves door open.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kotlin-best-practices
|
|
3
|
+
description: Kotlin coding standards including null safety, Either error handling, coroutines, and Exposed ORM patterns. Use when writing Kotlin code, reviewing code quality, or learning project patterns.
|
|
4
|
+
allowed_tools:
|
|
5
|
+
- Read
|
|
6
|
+
- Write
|
|
7
|
+
- Edit
|
|
8
|
+
- Glob
|
|
9
|
+
- Grep
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Kotlin Best Practices — Quick Reference
|
|
13
|
+
|
|
14
|
+
## Null Safety
|
|
15
|
+
|
|
16
|
+
`!!` is banned. Use `?.`, `?:`, or null check for smart cast.
|
|
17
|
+
|
|
18
|
+
> See code-patterns.md for all null safety examples.
|
|
19
|
+
|
|
20
|
+
## Either Error Handling
|
|
21
|
+
|
|
22
|
+
Managers return `Either<ClientException, T>` -- never throw. Controllers unwrap with `.throwOrValue()`.
|
|
23
|
+
|
|
24
|
+
> See code-patterns.md for manager + controller examples.
|
|
25
|
+
|
|
26
|
+
## Enum Usage
|
|
27
|
+
|
|
28
|
+
Never hardcode strings when an enum exists. Use `EnumName.VALUE.value` everywhere.
|
|
29
|
+
|
|
30
|
+
> See code-patterns.md for enum definition and usage patterns.
|
|
31
|
+
|
|
32
|
+
## Exposed ORM Patterns
|
|
33
|
+
|
|
34
|
+
Extend `UUIDTable`, use `text()` not `varchar()`. Always filter `deletedAt.isNull()`. Soft delete via timestamp update, never hard delete.
|
|
35
|
+
|
|
36
|
+
> See code-patterns.md for table, query, and soft delete examples.
|
|
37
|
+
|
|
38
|
+
## Transaction Rules
|
|
39
|
+
|
|
40
|
+
Reads use `db.replica`, writes use `db.primary`. Multi-table writes go in one transaction block -- all succeed or all rollback.
|
|
41
|
+
|
|
42
|
+
> See code-patterns.md for transaction examples.
|
|
43
|
+
|
|
44
|
+
## Conversion Pattern
|
|
45
|
+
|
|
46
|
+
Put `companion object { fun from(entity) }` inside Response DTOs. Never create separate mapper files.
|
|
47
|
+
|
|
48
|
+
> See code-patterns.md for the full pattern.
|
|
49
|
+
|
|
50
|
+
## What to Avoid
|
|
51
|
+
|
|
52
|
+
- `!!` -- always use `?.`, `?:`, or null check
|
|
53
|
+
- `@Suppress` -- fix the root cause
|
|
54
|
+
- Throwing exceptions -- return `Either.left()` instead
|
|
55
|
+
- `VARCHAR` in SQL -- use `TEXT`
|
|
56
|
+
- Hardcoded strings for enum values
|
|
57
|
+
- `Table` base class -- use `UUIDTable`
|
|
58
|
+
- Field injection -- use constructor injection
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Kotlin Best Practices — Code Patterns
|
|
2
|
+
|
|
3
|
+
> This file is referenced by SKILL.md. Read it when writing Kotlin code and you need the exact syntax.
|
|
4
|
+
|
|
5
|
+
## Null Safety Patterns
|
|
6
|
+
|
|
7
|
+
```kotlin
|
|
8
|
+
// NEVER — banned, pre-commit hook rejects it
|
|
9
|
+
val x = foo!!.bar
|
|
10
|
+
|
|
11
|
+
// GOOD — safe call + elvis
|
|
12
|
+
val x = foo?.bar ?: defaultValue
|
|
13
|
+
|
|
14
|
+
// GOOD — explicit null check (smart cast after)
|
|
15
|
+
if (foo == null) return error.left()
|
|
16
|
+
foo.bar // smart cast, no ?. needed
|
|
17
|
+
|
|
18
|
+
// GOOD — let for null-safe chains
|
|
19
|
+
user?.let { generateTokens(it, provider) }
|
|
20
|
+
?: return AuthError.AUTHENTICATION_FAILED.asException().left()
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Either Error Handling
|
|
24
|
+
|
|
25
|
+
```kotlin
|
|
26
|
+
// Managers return Either — never throw
|
|
27
|
+
suspend fun findById(id: UUID): Either<ClientException, UserResponse> {
|
|
28
|
+
val entity = userRepository.byId(id)
|
|
29
|
+
?: return ClientError.USER_NOT_FOUND.asException().left()
|
|
30
|
+
return UserResponse.from(entity).right()
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Controllers unwrap with .throwOrValue()
|
|
34
|
+
@Get("/user")
|
|
35
|
+
suspend fun getUser(@QueryValue id: UUID): UserResponse {
|
|
36
|
+
return userManager.findById(id).throwOrValue()
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Enum Usage
|
|
41
|
+
|
|
42
|
+
```kotlin
|
|
43
|
+
// NEVER hardcode strings when an enum exists
|
|
44
|
+
val status = "critical" // WRONG
|
|
45
|
+
val status = HealthStatus.CRITICAL.value // RIGHT
|
|
46
|
+
|
|
47
|
+
// Define enums with .value
|
|
48
|
+
enum class HealthStatus(val value: String) {
|
|
49
|
+
HEALTHY("healthy"),
|
|
50
|
+
AT_RISK("at_risk"),
|
|
51
|
+
CRITICAL("critical");
|
|
52
|
+
|
|
53
|
+
companion object {
|
|
54
|
+
fun fromValue(v: String) = entries.find { it.value == v }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Exposed ORM Patterns
|
|
60
|
+
|
|
61
|
+
```kotlin
|
|
62
|
+
// Table — extend UUIDTable, use text() not varchar()
|
|
63
|
+
object UsersTable : UUIDTable("users") {
|
|
64
|
+
val email = text("email")
|
|
65
|
+
val displayName = text("display_name").nullable()
|
|
66
|
+
val createdAt = timestamp("created_at")
|
|
67
|
+
val updatedAt = timestamp("updated_at").nullable()
|
|
68
|
+
val deletedAt = timestamp("deleted_at").nullable()
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Query — ALWAYS check deletedAt.isNull()
|
|
72
|
+
fun byId(id: UUID): UserEntity? {
|
|
73
|
+
return transaction(db.replica) {
|
|
74
|
+
UsersTable
|
|
75
|
+
.selectAll()
|
|
76
|
+
.where { (UsersTable.id eq id) and UsersTable.deletedAt.isNull() }
|
|
77
|
+
.singleOrNull()
|
|
78
|
+
?.let { convert(it) }
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Soft delete — NEVER hard delete
|
|
83
|
+
fun deleteById(id: UUID): UserEntity? {
|
|
84
|
+
return transaction(db.primary) {
|
|
85
|
+
UsersTable.update(
|
|
86
|
+
where = { (UsersTable.id eq id) and UsersTable.deletedAt.isNull() }
|
|
87
|
+
) {
|
|
88
|
+
it[deletedAt] = Instant.now()
|
|
89
|
+
it[updatedAt] = Instant.now()
|
|
90
|
+
}
|
|
91
|
+
UsersTable.selectAll()
|
|
92
|
+
.where { UsersTable.id eq id }
|
|
93
|
+
.singleOrNull()
|
|
94
|
+
?.let { convert(it) }
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Transaction Rules
|
|
100
|
+
|
|
101
|
+
```kotlin
|
|
102
|
+
// Reads use replica, writes use primary
|
|
103
|
+
val user = transaction(db.replica) { userRepository.byId(id) }
|
|
104
|
+
val saved = transaction(db.primary) { userRepository.insert(entity) }
|
|
105
|
+
|
|
106
|
+
// Multiple writes in one transaction
|
|
107
|
+
transaction(db.primary) {
|
|
108
|
+
val user = userRepository.insert(userEntity)
|
|
109
|
+
profileRepository.insert(profileEntity)
|
|
110
|
+
// all succeed or all rollback
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Conversion Pattern
|
|
115
|
+
|
|
116
|
+
```kotlin
|
|
117
|
+
// Companion object from() on Response DTOs
|
|
118
|
+
data class UserResponse(
|
|
119
|
+
val id: UUID,
|
|
120
|
+
val email: String
|
|
121
|
+
) {
|
|
122
|
+
companion object {
|
|
123
|
+
fun from(entity: UserEntity) = UserResponse(
|
|
124
|
+
id = entity.id,
|
|
125
|
+
email = entity.email
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Use in manager
|
|
131
|
+
return UserResponse.from(entity).right()
|
|
132
|
+
```
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: market-research
|
|
3
|
+
description: Run market research, competitive analysis, investor due diligence, and industry scans. Use when the user wants market sizing, competitor comparisons, fund research, or tech scans.
|
|
4
|
+
allowed_tools:
|
|
5
|
+
- WebSearch
|
|
6
|
+
- WebFetch
|
|
7
|
+
- Read
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Market Research
|
|
11
|
+
|
|
12
|
+
Make research that helps decisions, not research for show.
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
- Researching a market, company, investor, or tech trend
|
|
17
|
+
- Building TAM/SAM/SOM numbers
|
|
18
|
+
- Comparing competitors
|
|
19
|
+
- Checking investor fit before outreach
|
|
20
|
+
- Testing a thesis before building
|
|
21
|
+
|
|
22
|
+
## Process
|
|
23
|
+
|
|
24
|
+
### 1. Pick the Research Type
|
|
25
|
+
|
|
26
|
+
Figure out which kind of research the user needs:
|
|
27
|
+
- Investor / Fund Check
|
|
28
|
+
- Competitor Check
|
|
29
|
+
- Market Size
|
|
30
|
+
- Tech / Tool Research
|
|
31
|
+
|
|
32
|
+
### 2. Run Investor / Fund Check
|
|
33
|
+
|
|
34
|
+
Get:
|
|
35
|
+
- Fund size, stage, check size
|
|
36
|
+
- Portfolio companies that matter
|
|
37
|
+
- Public thesis and recent deals
|
|
38
|
+
- Why they fit or don't fit
|
|
39
|
+
- Red flags
|
|
40
|
+
|
|
41
|
+
### 3. Run Competitor Check
|
|
42
|
+
|
|
43
|
+
Get:
|
|
44
|
+
- What the product really does (not marketing fluff)
|
|
45
|
+
- Funding and investors
|
|
46
|
+
- Traction if public
|
|
47
|
+
- How they get users and what they charge
|
|
48
|
+
- Strengths, weaknesses, gaps
|
|
49
|
+
|
|
50
|
+
### 4. Run Market Size
|
|
51
|
+
|
|
52
|
+
Use:
|
|
53
|
+
- Top-down from reports
|
|
54
|
+
- Bottom-up from real customer numbers
|
|
55
|
+
- Show your math. Every guess should be clear.
|
|
56
|
+
|
|
57
|
+
### 5. Run Tech / Tool Research
|
|
58
|
+
|
|
59
|
+
Get:
|
|
60
|
+
- How it works
|
|
61
|
+
- Trade-offs and who's using it
|
|
62
|
+
- How hard to set up
|
|
63
|
+
- Lock-in, security, and risk
|
|
64
|
+
|
|
65
|
+
### 6. Write It Up
|
|
66
|
+
|
|
67
|
+
Structure every deliverable as:
|
|
68
|
+
1. Quick summary (2-3 sentences)
|
|
69
|
+
2. Key findings
|
|
70
|
+
3. What this means
|
|
71
|
+
4. Risks and caveats
|
|
72
|
+
5. What to do next
|
|
73
|
+
6. Sources
|
|
74
|
+
|
|
75
|
+
## Rules
|
|
76
|
+
|
|
77
|
+
- Every big claim needs a source.
|
|
78
|
+
- Use recent data. Flag old data.
|
|
79
|
+
- Include the bad news too. Show risks.
|
|
80
|
+
- End with a decision, not just a summary.
|
|
81
|
+
- Keep facts, guesses, and suggestions separate.
|
|
82
|
+
- All numbers have sources or are marked as guesses.
|
|
83
|
+
- Old data is flagged.
|
|
84
|
+
- The suggestion follows from the facts.
|
|
85
|
+
- Someone can make a decision from this.
|
|
86
|
+
|
|
87
|
+
## Gotchas
|
|
88
|
+
|
|
89
|
+
- **Top-down TAM is lazy and always wrong.** "10% of the $X billion market" is not analysis. Bottom-up from real customer numbers or go home.
|
|
90
|
+
- **Analyst reports have built-in bias.** Reports from vendors (like AWS sizing the cloud market) overstate their own segment. Use independent sources.
|
|
91
|
+
- **Revenue proxies are unreliable.** SimilarWeb traffic estimates can be off by 5x. Combine multiple signals: hiring, social, Crunchbase, app store rankings.
|
|
92
|
+
- **Don't confuse market size with addressable market.** The CRM market is $80B, but if you're building for freelancers, your market is a fraction of that.
|
|
93
|
+
- **Recency matters.** A market growing 40% in 2024 might be flat in 2026. Always check the latest data points, not just the headline number.
|
|
94
|
+
|
|
95
|
+
## Output
|
|
96
|
+
|
|
97
|
+
Save to the project's `02-research/` folder.
|
|
98
|
+
|
|
99
|
+
Format each deliverable with: quick summary, key findings, what this means, risks and caveats, next steps, and sources.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-checklist
|
|
3
|
+
description: Security best practices for Micronaut/Kotlin backend including authentication, authorization, input validation, and OWASP prevention. Use when implementing auth, validating inputs, or reviewing security.
|
|
4
|
+
allowed_tools:
|
|
5
|
+
- Read
|
|
6
|
+
- Glob
|
|
7
|
+
- Grep
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Security Checklist
|
|
11
|
+
|
|
12
|
+
Run a security audit against Micronaut/Kotlin backend code.
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
- Adding authentication or authorization to endpoints
|
|
17
|
+
- Validating user inputs on new or changed endpoints
|
|
18
|
+
- Reviewing code for security issues before merge
|
|
19
|
+
- Checking for common vulnerabilities (SQL injection, XSS, IDOR)
|
|
20
|
+
- Setting up secrets management
|
|
21
|
+
|
|
22
|
+
## Process
|
|
23
|
+
|
|
24
|
+
> See audit-reference.md for code examples, vulnerability table, and SAFE/DANGEROUS patterns.
|
|
25
|
+
|
|
26
|
+
1. **Check Authentication** — every controller has @Secured, current user comes from security context
|
|
27
|
+
2. **Check Authorization** — verify user has access to the resource before returning it
|
|
28
|
+
3. **Check Input Validation** — @Valid on controller params, Jakarta annotations on request DTOs
|
|
29
|
+
4. **Check SQL Injection Prevention** — use Exposed ORM (auto-parameterized), never raw SQL with string concat
|
|
30
|
+
5. **Check Common Vulnerabilities** — SQL injection, XSS, CSRF, auth bypass, IDOR, mass assignment, data exposure, rate limiting
|
|
31
|
+
6. **Check Secrets Management** — no hardcoded secrets, use env vars, never log tokens/passwords/PII, never commit .env
|
|
32
|
+
7. **Check Response Sanitization** — response DTOs control what's exposed, never return raw entities
|
|
33
|
+
|
|
34
|
+
## Interaction Style
|
|
35
|
+
|
|
36
|
+
- Always checks all categories, doesn't skip any section
|
|
37
|
+
- Flags the most dangerous issues first
|
|
38
|
+
- Shows code examples for every fix, not just descriptions
|
|
39
|
+
- Tells you what's wrong AND how to fix it
|
|
40
|
+
|
|
41
|
+
## Rules
|
|
42
|
+
|
|
43
|
+
- Every endpoint must have a @Secured annotation
|
|
44
|
+
- Admin endpoints use OAuthSecurityRule.ADMIN
|
|
45
|
+
- Users can only access their own resources (or admin can access all)
|
|
46
|
+
- Input validated with @Valid and Jakarta annotations
|
|
47
|
+
- No raw SQL queries with string concatenation
|
|
48
|
+
- Sensitive fields excluded from response DTOs
|
|
49
|
+
- Tokens/passwords never logged
|
|
50
|
+
- Error messages don't leak internal details
|
|
51
|
+
- Rate limiting on auth endpoints
|
|
52
|
+
|
|
53
|
+
## Output
|
|
54
|
+
|
|
55
|
+
Produces a checklist report with pass/fail for each category:
|
|
56
|
+
|
|
57
|
+
- [ ] All endpoints have @Secured annotation
|
|
58
|
+
- [ ] Admin endpoints use OAuthSecurityRule.ADMIN
|
|
59
|
+
- [ ] User can only access their own resources (or admin can access all)
|
|
60
|
+
- [ ] Input validated with @Valid and Jakarta annotations
|
|
61
|
+
- [ ] No raw SQL queries with string concatenation
|
|
62
|
+
- [ ] Sensitive fields excluded from response DTOs
|
|
63
|
+
- [ ] Tokens/passwords never logged
|
|
64
|
+
- [ ] Error messages don't leak internal details
|
|
65
|
+
- [ ] Rate limiting on auth endpoints
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Security Checklist — Audit Reference
|
|
2
|
+
|
|
3
|
+
> This file is referenced by SKILL.md. Read it when running a security audit and you need code examples.
|
|
4
|
+
|
|
5
|
+
## Authentication Patterns
|
|
6
|
+
|
|
7
|
+
```kotlin
|
|
8
|
+
// Always use @Secured on controllers
|
|
9
|
+
@Secured(SecurityRule.IS_AUTHENTICATED) // Any logged-in user
|
|
10
|
+
@Secured(OAuthSecurityRule.ADMIN) // Admin only
|
|
11
|
+
@Secured(SecurityRule.IS_ANONYMOUS) // Public endpoint
|
|
12
|
+
|
|
13
|
+
// Get current user from security context
|
|
14
|
+
val principal = SecurityUtils.currentPrincipal()
|
|
15
|
+
?: return AuthError.UNAUTHORIZED.asException().left()
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Authorization Patterns
|
|
19
|
+
|
|
20
|
+
```kotlin
|
|
21
|
+
// Verify user has access to the resource
|
|
22
|
+
suspend fun getEmployee(id: UUID, requesterId: UUID): Either<ClientException, EmployeeResponse> {
|
|
23
|
+
val employee = employeeRepository.byId(id)
|
|
24
|
+
?: return ClientError.NOT_FOUND.asException().left()
|
|
25
|
+
|
|
26
|
+
// Check: can this user see this employee?
|
|
27
|
+
if (!hasAccess(requesterId, employee)) {
|
|
28
|
+
return ClientError.FORBIDDEN.asException().left()
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return EmployeeResponse.from(employee).right()
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Input Validation Patterns
|
|
36
|
+
|
|
37
|
+
```kotlin
|
|
38
|
+
// Validate at controller boundary
|
|
39
|
+
@Post("/employee")
|
|
40
|
+
suspend fun create(@Valid @Body request: CreateEmployeeRequest): EmployeeResponse {
|
|
41
|
+
// @Valid triggers Jakarta validation annotations
|
|
42
|
+
return employeeManager.create(request).throwOrValue()
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Request with validation
|
|
46
|
+
data class CreateEmployeeRequest(
|
|
47
|
+
@field:NotBlank val name: String,
|
|
48
|
+
@field:Email val email: String,
|
|
49
|
+
@field:Size(max = 1000) val description: String?
|
|
50
|
+
)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## SQL Injection Prevention
|
|
54
|
+
|
|
55
|
+
```kotlin
|
|
56
|
+
// SAFE — Exposed ORM parameterizes automatically
|
|
57
|
+
UsersTable.selectAll()
|
|
58
|
+
.where { UsersTable.email eq userInput } // parameterized
|
|
59
|
+
|
|
60
|
+
// DANGEROUS — raw SQL with string concat
|
|
61
|
+
exec("SELECT * FROM users WHERE email = '$userInput'") // NEVER DO THIS
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Common Vulnerabilities Table
|
|
65
|
+
|
|
66
|
+
| Vulnerability | Prevention |
|
|
67
|
+
|--------------|-----------|
|
|
68
|
+
| SQL Injection | Use Exposed ORM (auto-parameterized) |
|
|
69
|
+
| XSS | Don't render user input as HTML |
|
|
70
|
+
| CSRF | Micronaut handles via token validation |
|
|
71
|
+
| Auth bypass | @Secured on every controller |
|
|
72
|
+
| IDOR | Check resource ownership in manager |
|
|
73
|
+
| Mass assignment | Use explicit request DTOs, not entity directly |
|
|
74
|
+
| Sensitive data exposure | Never return passwords, tokens in responses |
|
|
75
|
+
| Missing rate limiting | Add @RateLimiter for auth endpoints |
|
|
76
|
+
|
|
77
|
+
## Response Sanitization
|
|
78
|
+
|
|
79
|
+
```kotlin
|
|
80
|
+
// Response DTO controls what's exposed — don't return raw entities
|
|
81
|
+
data class UserResponse(
|
|
82
|
+
val id: UUID,
|
|
83
|
+
val email: String,
|
|
84
|
+
val displayName: String
|
|
85
|
+
// NO password field, NO internal fields
|
|
86
|
+
) {
|
|
87
|
+
companion object {
|
|
88
|
+
fun from(entity: UserEntity) = UserResponse(
|
|
89
|
+
id = entity.id,
|
|
90
|
+
email = entity.email,
|
|
91
|
+
displayName = entity.displayName ?: entity.email
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: service-debugging
|
|
3
|
+
description: "Structured debugging runbook for backend services. Use when investigating production issues, API errors, performance problems, or when something broke and you need to find why."
|
|
4
|
+
allowed_tools:
|
|
5
|
+
- Read
|
|
6
|
+
- Glob
|
|
7
|
+
- Grep
|
|
8
|
+
- Bash
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Service Debugging
|
|
12
|
+
|
|
13
|
+
Structured approach to investigating and fixing service issues. Symptoms in, root cause out.
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
- API endpoint returning errors (4xx, 5xx)
|
|
18
|
+
- Performance degradation or slow queries
|
|
19
|
+
- Service not starting or crashing
|
|
20
|
+
- Data inconsistency between services
|
|
21
|
+
- After a deploy when something broke
|
|
22
|
+
- User reports "something is broken"
|
|
23
|
+
|
|
24
|
+
## Process
|
|
25
|
+
|
|
26
|
+
### 1. Gather Symptoms
|
|
27
|
+
|
|
28
|
+
Before touching code, collect:
|
|
29
|
+
- **What's broken?** (specific endpoint, feature, or behavior)
|
|
30
|
+
- **When did it start?** (after a deploy? gradually? suddenly?)
|
|
31
|
+
- **Who's affected?** (all users, specific users, specific data?)
|
|
32
|
+
- **Error messages?** (logs, HTTP responses, stack traces)
|
|
33
|
+
|
|
34
|
+
### 2. Check the Obvious
|
|
35
|
+
|
|
36
|
+
Run these first — they catch 80% of issues:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Recent deploys (did someone push something?)
|
|
40
|
+
git log --oneline -10
|
|
41
|
+
|
|
42
|
+
# Service health
|
|
43
|
+
curl -s http://localhost:8080/health | jq .
|
|
44
|
+
|
|
45
|
+
# Recent errors in logs
|
|
46
|
+
grep -i "error\|exception\|fatal" logs/app.log | tail -20
|
|
47
|
+
|
|
48
|
+
# Database connectivity
|
|
49
|
+
psql -h $DB_HOST -U $DB_USER -d $DB_NAME -c "SELECT 1"
|
|
50
|
+
|
|
51
|
+
# Environment variables (missing or wrong?)
|
|
52
|
+
env | grep -i "DB_\|API_\|SECRET_" | sort
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 3. Narrow Down
|
|
56
|
+
|
|
57
|
+
| Symptom | Check First |
|
|
58
|
+
|---------|-------------|
|
|
59
|
+
| 500 errors | Stack trace in logs → find the throwing line |
|
|
60
|
+
| 404 errors | Route registration → is the controller loaded? |
|
|
61
|
+
| 401/403 errors | Auth config → is @Secured correct? Token valid? |
|
|
62
|
+
| Slow response | Database → run EXPLAIN on the slow query |
|
|
63
|
+
| Timeout | External service → is the downstream API responding? |
|
|
64
|
+
| Data missing | Soft delete → is `deleted_at` set? Wrong query filter? |
|
|
65
|
+
| Service won't start | Bean creation → check @Factory and @Singleton wiring |
|
|
66
|
+
|
|
67
|
+
### 4. Reproduce
|
|
68
|
+
|
|
69
|
+
- Can you trigger the bug locally?
|
|
70
|
+
- What's the minimal request that fails?
|
|
71
|
+
- Does it fail consistently or intermittently?
|
|
72
|
+
|
|
73
|
+
### 5. Find Root Cause
|
|
74
|
+
|
|
75
|
+
Use git bisect if it's a regression:
|
|
76
|
+
```bash
|
|
77
|
+
git bisect start
|
|
78
|
+
git bisect bad HEAD
|
|
79
|
+
git bisect good <last-known-good-commit>
|
|
80
|
+
# Test each commit until you find the one that broke it
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Use grep to find related code:
|
|
84
|
+
```bash
|
|
85
|
+
# Find where the error message comes from
|
|
86
|
+
grep -r "error message text" --include="*.kt" src/
|
|
87
|
+
|
|
88
|
+
# Find all callers of a broken function
|
|
89
|
+
grep -r "functionName" --include="*.kt" src/
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### 6. Fix and Verify
|
|
93
|
+
|
|
94
|
+
1. Write a test that reproduces the bug (red)
|
|
95
|
+
2. Fix the code (green)
|
|
96
|
+
3. Run full test suite
|
|
97
|
+
4. Test manually if it's a user-facing issue
|
|
98
|
+
|
|
99
|
+
> See `common-issues.md` for a catalog of frequently seen bugs and their fixes.
|
|
100
|
+
|
|
101
|
+
## Gotchas
|
|
102
|
+
|
|
103
|
+
- **Don't fix the symptom, fix the cause.** Adding a null check that hides a data issue means the data issue will bite you later.
|
|
104
|
+
- **Check the deploy log before blaming the code.** Config changes, environment variable updates, and infra changes cause more outages than code bugs.
|
|
105
|
+
- **"It works on my machine" usually means environment difference.** Compare local env vars, database state, and service versions with the target environment.
|
|
106
|
+
- **Intermittent failures are usually race conditions.** If it fails 1 in 10 times, look for concurrent access, shared mutable state, or connection pool exhaustion.
|
|
107
|
+
- **Don't restart the service as your first debugging step.** You'll lose the state that helps you diagnose. Read logs first, then restart if needed.
|
|
108
|
+
- **Soft-deleted records are the #1 "data missing" cause.** Always check `deleted_at IS NULL` in your queries.
|
|
109
|
+
|
|
110
|
+
## Rules
|
|
111
|
+
|
|
112
|
+
- Always gather symptoms before changing code
|
|
113
|
+
- Write a failing test before fixing
|
|
114
|
+
- Check recent git history — most bugs are regressions
|
|
115
|
+
- Don't deploy a fix without understanding the root cause
|
|
116
|
+
- Document the incident if it affected users
|