@heyai-rules/pilo-masterkit 1.2.2
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/agents/PILO_MASTER.md +77 -0
- package/.agent/agents/architect.md +211 -0
- package/.agent/agents/backend-specialist.md +263 -0
- package/.agent/agents/build-error-resolver.md +114 -0
- package/.agent/agents/chief-of-staff.md +151 -0
- package/.agent/agents/code-archaeologist.md +106 -0
- package/.agent/agents/code-reviewer.md +237 -0
- package/.agent/agents/cpp-build-resolver.md +90 -0
- package/.agent/agents/cpp-reviewer.md +72 -0
- package/.agent/agents/database-architect.md +226 -0
- package/.agent/agents/database-reviewer.md +91 -0
- package/.agent/agents/debugger.md +225 -0
- package/.agent/agents/devops-engineer.md +242 -0
- package/.agent/agents/doc-updater.md +107 -0
- package/.agent/agents/docs-lookup.md +68 -0
- package/.agent/agents/documentation-writer.md +104 -0
- package/.agent/agents/e2e-runner.md +107 -0
- package/.agent/agents/explorer-agent.md +73 -0
- package/.agent/agents/flutter-reviewer.md +243 -0
- package/.agent/agents/frontend-specialist.md +593 -0
- package/.agent/agents/game-developer.md +162 -0
- package/.agent/agents/go-build-resolver.md +94 -0
- package/.agent/agents/go-reviewer.md +76 -0
- package/.agent/agents/harness-optimizer.md +35 -0
- package/.agent/agents/java-build-resolver.md +153 -0
- package/.agent/agents/java-reviewer.md +92 -0
- package/.agent/agents/kotlin-build-resolver.md +118 -0
- package/.agent/agents/kotlin-reviewer.md +159 -0
- package/.agent/agents/loop-operator.md +36 -0
- package/.agent/agents/mobile-developer.md +377 -0
- package/.agent/agents/orchestrator.md +416 -0
- package/.agent/agents/penetration-tester.md +188 -0
- package/.agent/agents/performance-optimizer.md +187 -0
- package/.agent/agents/planner.md +212 -0
- package/.agent/agents/product-manager.md +112 -0
- package/.agent/agents/product-owner.md +95 -0
- package/.agent/agents/project-planner.md +406 -0
- package/.agent/agents/python-reviewer.md +98 -0
- package/.agent/agents/pytorch-build-resolver.md +120 -0
- package/.agent/agents/qa-automation-engineer.md +103 -0
- package/.agent/agents/refactor-cleaner.md +85 -0
- package/.agent/agents/rust-build-resolver.md +148 -0
- package/.agent/agents/rust-reviewer.md +94 -0
- package/.agent/agents/security-auditor.md +170 -0
- package/.agent/agents/security-reviewer.md +108 -0
- package/.agent/agents/seo-specialist.md +111 -0
- package/.agent/agents/tdd-guide.md +91 -0
- package/.agent/agents/test-engineer.md +158 -0
- package/.agent/agents/typescript-reviewer.md +112 -0
- package/.agent/rules/ARCHITECTURAL_BLUEPRINTS.md +62 -0
- package/.agent/rules/CODE_CRAFTSMANSHIP.md +69 -0
- package/.agent/rules/CORE_RULES.md +72 -0
- package/.agent/rules/PROJECT_MAP.md +58 -0
- package/.agent/rules/QUALITY_ASSURANCE.md +54 -0
- package/.agent/rules/SECURITY_ARMOR.md +44 -0
- package/.agent/rules/VERSION_ORCHESTRATION.md +64 -0
- package/.agent/rules/WORKFLOW_ORCHESTRATION.md +55 -0
- package/.agent/scripts/auto_preview.py +148 -0
- package/.agent/scripts/checklist.py +217 -0
- package/.agent/scripts/session_manager.py +120 -0
- package/.agent/scripts/verify_all.py +327 -0
- package/.agent/skills/api-patterns/SKILL.md +81 -0
- package/.agent/skills/api-patterns/api-style.md +42 -0
- package/.agent/skills/api-patterns/auth.md +24 -0
- package/.agent/skills/api-patterns/documentation.md +26 -0
- package/.agent/skills/api-patterns/graphql.md +41 -0
- package/.agent/skills/api-patterns/rate-limiting.md +31 -0
- package/.agent/skills/api-patterns/response.md +37 -0
- package/.agent/skills/api-patterns/rest.md +40 -0
- package/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
- package/.agent/skills/api-patterns/security-testing.md +122 -0
- package/.agent/skills/api-patterns/trpc.md +41 -0
- package/.agent/skills/api-patterns/versioning.md +22 -0
- package/.agent/skills/app-builder/SKILL.md +75 -0
- package/.agent/skills/app-builder/agent-coordination.md +71 -0
- package/.agent/skills/app-builder/feature-building.md +53 -0
- package/.agent/skills/app-builder/project-detection.md +34 -0
- package/.agent/skills/app-builder/scaffolding.md +118 -0
- package/.agent/skills/app-builder/tech-stack.md +41 -0
- package/.agent/skills/app-builder/templates/SKILL.md +39 -0
- package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
- package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
- package/.agent/skills/architecture/SKILL.md +55 -0
- package/.agent/skills/architecture/context-discovery.md +43 -0
- package/.agent/skills/architecture/examples.md +94 -0
- package/.agent/skills/architecture/pattern-selection.md +68 -0
- package/.agent/skills/architecture/patterns-reference.md +50 -0
- package/.agent/skills/architecture/trade-off-analysis.md +77 -0
- package/.agent/skills/bash-linux/SKILL.md +199 -0
- package/.agent/skills/behavioral-modes/SKILL.md +242 -0
- package/.agent/skills/brainstorming/SKILL.md +163 -0
- package/.agent/skills/brainstorming/dynamic-questioning.md +350 -0
- package/.agent/skills/clean-code/SKILL.md +201 -0
- package/.agent/skills/code-review-checklist/SKILL.md +109 -0
- package/.agent/skills/database-design/SKILL.md +52 -0
- package/.agent/skills/database-design/database-selection.md +43 -0
- package/.agent/skills/database-design/indexing.md +39 -0
- package/.agent/skills/database-design/migrations.md +48 -0
- package/.agent/skills/database-design/optimization.md +36 -0
- package/.agent/skills/database-design/orm-selection.md +30 -0
- package/.agent/skills/database-design/schema-design.md +56 -0
- package/.agent/skills/database-design/scripts/schema_validator.py +172 -0
- package/.agent/skills/deployment-procedures/SKILL.md +241 -0
- package/.agent/skills/doc.md +177 -0
- package/.agent/skills/documentation-templates/SKILL.md +194 -0
- package/.agent/skills/frontend-design/SKILL.md +452 -0
- package/.agent/skills/frontend-design/animation-guide.md +331 -0
- package/.agent/skills/frontend-design/color-system.md +311 -0
- package/.agent/skills/frontend-design/decision-trees.md +418 -0
- package/.agent/skills/frontend-design/motion-graphics.md +306 -0
- package/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/.agent/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/.agent/skills/frontend-design/typography-system.md +345 -0
- package/.agent/skills/frontend-design/ux-psychology.md +1116 -0
- package/.agent/skills/frontend-design/visual-effects.md +383 -0
- package/.agent/skills/game-development/2d-games/SKILL.md +119 -0
- package/.agent/skills/game-development/3d-games/SKILL.md +135 -0
- package/.agent/skills/game-development/SKILL.md +167 -0
- package/.agent/skills/game-development/game-art/SKILL.md +185 -0
- package/.agent/skills/game-development/game-audio/SKILL.md +190 -0
- package/.agent/skills/game-development/game-design/SKILL.md +129 -0
- package/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
- package/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
- package/.agent/skills/game-development/pc-games/SKILL.md +144 -0
- package/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
- package/.agent/skills/game-development/web-games/SKILL.md +150 -0
- package/.agent/skills/geo-fundamentals/SKILL.md +156 -0
- package/.agent/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/.agent/skills/i18n-localization/SKILL.md +154 -0
- package/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/.agent/skills/intelligent-routing/SKILL.md +335 -0
- package/.agent/skills/lint-and-validate/SKILL.md +45 -0
- package/.agent/skills/lint-and-validate/scripts/lint_runner.py +184 -0
- package/.agent/skills/lint-and-validate/scripts/type_coverage.py +173 -0
- package/.agent/skills/mcp-builder/SKILL.md +176 -0
- package/.agent/skills/mobile-design/SKILL.md +394 -0
- package/.agent/skills/mobile-design/decision-trees.md +516 -0
- package/.agent/skills/mobile-design/mobile-backend.md +491 -0
- package/.agent/skills/mobile-design/mobile-color-system.md +420 -0
- package/.agent/skills/mobile-design/mobile-debugging.md +122 -0
- package/.agent/skills/mobile-design/mobile-design-thinking.md +357 -0
- package/.agent/skills/mobile-design/mobile-navigation.md +458 -0
- package/.agent/skills/mobile-design/mobile-performance.md +767 -0
- package/.agent/skills/mobile-design/mobile-testing.md +356 -0
- package/.agent/skills/mobile-design/mobile-typography.md +433 -0
- package/.agent/skills/mobile-design/platform-android.md +666 -0
- package/.agent/skills/mobile-design/platform-ios.md +561 -0
- package/.agent/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/.agent/skills/mobile-design/touch-psychology.md +537 -0
- package/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +351 -0
- package/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
- package/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
- package/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
- package/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
- package/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
- package/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
- package/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
- package/.agent/skills/nextjs-react-expert/9-cache-components.md +103 -0
- package/.agent/skills/nextjs-react-expert/SKILL.md +293 -0
- package/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
- package/.agent/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
- package/.agent/skills/nodejs-best-practices/SKILL.md +333 -0
- package/.agent/skills/parallel-agents/SKILL.md +175 -0
- package/.agent/skills/performance-profiling/SKILL.md +143 -0
- package/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/.agent/skills/plan-writing/SKILL.md +152 -0
- package/.agent/skills/powershell-windows/SKILL.md +167 -0
- package/.agent/skills/python-patterns/SKILL.md +441 -0
- package/.agent/skills/red-team-tactics/SKILL.md +199 -0
- package/.agent/skills/rust-pro/SKILL.md +176 -0
- package/.agent/skills/seo-fundamentals/SKILL.md +129 -0
- package/.agent/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/.agent/skills/server-management/SKILL.md +161 -0
- package/.agent/skills/systematic-debugging/SKILL.md +109 -0
- package/.agent/skills/tailwind-patterns/SKILL.md +269 -0
- package/.agent/skills/tdd-workflow/SKILL.md +149 -0
- package/.agent/skills/testing-patterns/SKILL.md +178 -0
- package/.agent/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/.agent/skills/ui-ux-pro-max/SKILL.md +292 -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/__pycache__/core.cpython-314.pyc +0 -0
- package/.agent/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-314.pyc +0 -0
- package/.agent/skills/ui-ux-pro-max/scripts/__pycache__/search.cpython-314.pyc +0 -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/vulnerability-scanner/SKILL.md +276 -0
- package/.agent/skills/vulnerability-scanner/checklists.md +121 -0
- package/.agent/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/.agent/skills/web-design-guidelines/SKILL.md +57 -0
- package/.agent/skills/webapp-testing/SKILL.md +187 -0
- package/.agent/skills/webapp-testing/scripts/playwright_runner.py +173 -0
- package/.agent/tasks/lessons.md +40 -0
- package/.agent/tasks/todo.md +33 -0
- package/.agent/workflows/aside.md +164 -0
- package/.agent/workflows/brainstorm.md +113 -0
- package/.agent/workflows/build-fix.md +62 -0
- package/.agent/workflows/checkpoint.md +74 -0
- package/.agent/workflows/claw.md +51 -0
- package/.agent/workflows/code-review.md +40 -0
- package/.agent/workflows/context-budget.md +29 -0
- package/.agent/workflows/cpp-build.md +173 -0
- package/.agent/workflows/cpp-review.md +132 -0
- package/.agent/workflows/cpp-test.md +251 -0
- package/.agent/workflows/create.md +59 -0
- package/.agent/workflows/debug.md +103 -0
- package/.agent/workflows/deploy.md +176 -0
- package/.agent/workflows/devfleet.md +92 -0
- package/.agent/workflows/docs.md +31 -0
- package/.agent/workflows/e2e.md +365 -0
- package/.agent/workflows/enhance.md +63 -0
- package/.agent/workflows/eval.md +120 -0
- package/.agent/workflows/evolve.md +178 -0
- package/.agent/workflows/go-build.md +183 -0
- package/.agent/workflows/go-review.md +148 -0
- package/.agent/workflows/go-test.md +268 -0
- package/.agent/workflows/gradle-build.md +70 -0
- package/.agent/workflows/harness-audit.md +71 -0
- package/.agent/workflows/init-docs.md +46 -0
- package/.agent/workflows/instinct-export.md +66 -0
- package/.agent/workflows/instinct-import.md +114 -0
- package/.agent/workflows/instinct-status.md +59 -0
- package/.agent/workflows/kotlin-build.md +174 -0
- package/.agent/workflows/kotlin-review.md +140 -0
- package/.agent/workflows/kotlin-test.md +312 -0
- package/.agent/workflows/learn-eval.md +116 -0
- package/.agent/workflows/learn.md +70 -0
- package/.agent/workflows/loop-start.md +32 -0
- package/.agent/workflows/loop-status.md +24 -0
- package/.agent/workflows/model-route.md +26 -0
- package/.agent/workflows/multi-backend.md +158 -0
- package/.agent/workflows/multi-execute.md +315 -0
- package/.agent/workflows/multi-frontend.md +158 -0
- package/.agent/workflows/multi-plan.md +268 -0
- package/.agent/workflows/multi-workflow.md +191 -0
- package/.agent/workflows/orchestrate.md +231 -0
- package/.agent/workflows/plan.md +115 -0
- package/.agent/workflows/pm2.md +272 -0
- package/.agent/workflows/preview.md +81 -0
- package/.agent/workflows/projects.md +39 -0
- package/.agent/workflows/promote.md +41 -0
- package/.agent/workflows/prompt-optimize.md +38 -0
- package/.agent/workflows/prune.md +31 -0
- package/.agent/workflows/python-review.md +297 -0
- package/.agent/workflows/quality-gate.md +29 -0
- package/.agent/workflows/refactor-clean.md +80 -0
- package/.agent/workflows/resume-session.md +156 -0
- package/.agent/workflows/rules-distill.md +11 -0
- package/.agent/workflows/rust-build.md +187 -0
- package/.agent/workflows/rust-review.md +142 -0
- package/.agent/workflows/rust-test.md +308 -0
- package/.agent/workflows/save-session.md +275 -0
- package/.agent/workflows/sessions.md +333 -0
- package/.agent/workflows/setup-pm.md +80 -0
- package/.agent/workflows/skill-create.md +174 -0
- package/.agent/workflows/skill-health.md +54 -0
- package/.agent/workflows/status.md +86 -0
- package/.agent/workflows/tdd.md +328 -0
- package/.agent/workflows/test-coverage.md +69 -0
- package/.agent/workflows/test.md +144 -0
- package/.agent/workflows/ui-ux-pro-max.md +296 -0
- package/.agent/workflows/update-codemaps.md +72 -0
- package/.agent/workflows/update-docs.md +84 -0
- package/.agent/workflows/verify.md +59 -0
- package/LICENSE +176 -0
- package/README.md +136 -0
- package/RELEASE.md +36 -0
- package/package.json +79 -0
- package/scripts/release-check.js +55 -0
- package/src/bin/cli.js +78 -0
- package/src/lib/installer.js +140 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Enforce TDD workflow for Go. Write table-driven tests first, then implement. Verify 80%+ coverage with go test -cover.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Go TDD Command
|
|
6
|
+
|
|
7
|
+
This command enforces test-driven development methodology for Go code using idiomatic Go testing patterns.
|
|
8
|
+
|
|
9
|
+
## What This Command Does
|
|
10
|
+
|
|
11
|
+
1. **Define Types/Interfaces**: Scaffold function signatures first
|
|
12
|
+
2. **Write Table-Driven Tests**: Create comprehensive test cases (RED)
|
|
13
|
+
3. **Run Tests**: Verify tests fail for the right reason
|
|
14
|
+
4. **Implement Code**: Write minimal code to pass (GREEN)
|
|
15
|
+
5. **Refactor**: Improve while keeping tests green
|
|
16
|
+
6. **Check Coverage**: Ensure 80%+ coverage
|
|
17
|
+
|
|
18
|
+
## When to Use
|
|
19
|
+
|
|
20
|
+
Use `/go-test` when:
|
|
21
|
+
- Implementing new Go functions
|
|
22
|
+
- Adding test coverage to existing code
|
|
23
|
+
- Fixing bugs (write failing test first)
|
|
24
|
+
- Building critical business logic
|
|
25
|
+
- Learning TDD workflow in Go
|
|
26
|
+
|
|
27
|
+
## TDD Cycle
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
RED → Write failing table-driven test
|
|
31
|
+
GREEN → Implement minimal code to pass
|
|
32
|
+
REFACTOR → Improve code, tests stay green
|
|
33
|
+
REPEAT → Next test case
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Example Session
|
|
37
|
+
|
|
38
|
+
````
|
|
39
|
+
User: /go-test I need a function to validate email addresses
|
|
40
|
+
|
|
41
|
+
Agent:
|
|
42
|
+
# TDD Session: Email Validator
|
|
43
|
+
|
|
44
|
+
## Step 1: Define Interface
|
|
45
|
+
|
|
46
|
+
```go
|
|
47
|
+
// validator/email.go
|
|
48
|
+
package validator
|
|
49
|
+
|
|
50
|
+
// ValidateEmail checks if the given string is a valid email address.
|
|
51
|
+
// Returns nil if valid, error describing the issue otherwise.
|
|
52
|
+
func ValidateEmail(email string) error {
|
|
53
|
+
panic("not implemented")
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Step 2: Write Table-Driven Tests (RED)
|
|
58
|
+
|
|
59
|
+
```go
|
|
60
|
+
// validator/email_test.go
|
|
61
|
+
package validator
|
|
62
|
+
|
|
63
|
+
import (
|
|
64
|
+
"testing"
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
func TestValidateEmail(t *testing.T) {
|
|
68
|
+
tests := []struct {
|
|
69
|
+
name string
|
|
70
|
+
email string
|
|
71
|
+
wantErr bool
|
|
72
|
+
}{
|
|
73
|
+
// Valid emails
|
|
74
|
+
{"simple email", "user@example.com", false},
|
|
75
|
+
{"with subdomain", "user@mail.example.com", false},
|
|
76
|
+
{"with plus", "user+tag@example.com", false},
|
|
77
|
+
{"with dots", "first.last@example.com", false},
|
|
78
|
+
|
|
79
|
+
// Invalid emails
|
|
80
|
+
{"empty string", "", true},
|
|
81
|
+
{"no at sign", "userexample.com", true},
|
|
82
|
+
{"no domain", "user@", true},
|
|
83
|
+
{"no local part", "@example.com", true},
|
|
84
|
+
{"double at", "user@@example.com", true},
|
|
85
|
+
{"spaces", "user @example.com", true},
|
|
86
|
+
{"no tld", "user@example", true},
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
for _, tt := range tests {
|
|
90
|
+
t.Run(tt.name, func(t *testing.T) {
|
|
91
|
+
err := ValidateEmail(tt.email)
|
|
92
|
+
if tt.wantErr && err == nil {
|
|
93
|
+
t.Errorf("ValidateEmail(%q) = nil; want error", tt.email)
|
|
94
|
+
}
|
|
95
|
+
if !tt.wantErr && err != nil {
|
|
96
|
+
t.Errorf("ValidateEmail(%q) = %v; want nil", tt.email, err)
|
|
97
|
+
}
|
|
98
|
+
})
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Step 3: Run Tests - Verify FAIL
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
$ go test ./validator/...
|
|
107
|
+
|
|
108
|
+
--- FAIL: TestValidateEmail (0.00s)
|
|
109
|
+
--- FAIL: TestValidateEmail/simple_email (0.00s)
|
|
110
|
+
panic: not implemented
|
|
111
|
+
|
|
112
|
+
FAIL
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
✓ Tests fail as expected (panic).
|
|
116
|
+
|
|
117
|
+
## Step 4: Implement Minimal Code (GREEN)
|
|
118
|
+
|
|
119
|
+
```go
|
|
120
|
+
// validator/email.go
|
|
121
|
+
package validator
|
|
122
|
+
|
|
123
|
+
import (
|
|
124
|
+
"errors"
|
|
125
|
+
"regexp"
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
var emailRegex = regexp.MustCompile(`^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`)
|
|
129
|
+
|
|
130
|
+
var (
|
|
131
|
+
ErrEmailEmpty = errors.New("email cannot be empty")
|
|
132
|
+
ErrEmailInvalid = errors.New("email format is invalid")
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
func ValidateEmail(email string) error {
|
|
136
|
+
if email == "" {
|
|
137
|
+
return ErrEmailEmpty
|
|
138
|
+
}
|
|
139
|
+
if !emailRegex.MatchString(email) {
|
|
140
|
+
return ErrEmailInvalid
|
|
141
|
+
}
|
|
142
|
+
return nil
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Step 5: Run Tests - Verify PASS
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
$ go test ./validator/...
|
|
150
|
+
|
|
151
|
+
PASS
|
|
152
|
+
ok project/validator 0.003s
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
✓ All tests passing!
|
|
156
|
+
|
|
157
|
+
## Step 6: Check Coverage
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
$ go test -cover ./validator/...
|
|
161
|
+
|
|
162
|
+
PASS
|
|
163
|
+
coverage: 100.0% of statements
|
|
164
|
+
ok project/validator 0.003s
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
✓ Coverage: 100%
|
|
168
|
+
|
|
169
|
+
## TDD Complete!
|
|
170
|
+
````
|
|
171
|
+
|
|
172
|
+
## Test Patterns
|
|
173
|
+
|
|
174
|
+
### Table-Driven Tests
|
|
175
|
+
```go
|
|
176
|
+
tests := []struct {
|
|
177
|
+
name string
|
|
178
|
+
input InputType
|
|
179
|
+
want OutputType
|
|
180
|
+
wantErr bool
|
|
181
|
+
}{
|
|
182
|
+
{"case 1", input1, want1, false},
|
|
183
|
+
{"case 2", input2, want2, true},
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
for _, tt := range tests {
|
|
187
|
+
t.Run(tt.name, func(t *testing.T) {
|
|
188
|
+
got, err := Function(tt.input)
|
|
189
|
+
// assertions
|
|
190
|
+
})
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Parallel Tests
|
|
195
|
+
```go
|
|
196
|
+
for _, tt := range tests {
|
|
197
|
+
tt := tt // Capture
|
|
198
|
+
t.Run(tt.name, func(t *testing.T) {
|
|
199
|
+
t.Parallel()
|
|
200
|
+
// test body
|
|
201
|
+
})
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Test Helpers
|
|
206
|
+
```go
|
|
207
|
+
func setupTestDB(t *testing.T) *sql.DB {
|
|
208
|
+
t.Helper()
|
|
209
|
+
db := createDB()
|
|
210
|
+
t.Cleanup(func() { db.Close() })
|
|
211
|
+
return db
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Coverage Commands
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
# Basic coverage
|
|
219
|
+
go test -cover ./...
|
|
220
|
+
|
|
221
|
+
# Coverage profile
|
|
222
|
+
go test -coverprofile=coverage.out ./...
|
|
223
|
+
|
|
224
|
+
# View in browser
|
|
225
|
+
go tool cover -html=coverage.out
|
|
226
|
+
|
|
227
|
+
# Coverage by function
|
|
228
|
+
go tool cover -func=coverage.out
|
|
229
|
+
|
|
230
|
+
# With race detection
|
|
231
|
+
go test -race -cover ./...
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Coverage Targets
|
|
235
|
+
|
|
236
|
+
| Code Type | Target |
|
|
237
|
+
|-----------|--------|
|
|
238
|
+
| Critical business logic | 100% |
|
|
239
|
+
| Public APIs | 90%+ |
|
|
240
|
+
| General code | 80%+ |
|
|
241
|
+
| Generated code | Exclude |
|
|
242
|
+
|
|
243
|
+
## TDD Best Practices
|
|
244
|
+
|
|
245
|
+
**DO:**
|
|
246
|
+
- Write test FIRST, before any implementation
|
|
247
|
+
- Run tests after each change
|
|
248
|
+
- Use table-driven tests for comprehensive coverage
|
|
249
|
+
- Test behavior, not implementation details
|
|
250
|
+
- Include edge cases (empty, nil, max values)
|
|
251
|
+
|
|
252
|
+
**DON'T:**
|
|
253
|
+
- Write implementation before tests
|
|
254
|
+
- Skip the RED phase
|
|
255
|
+
- Test private functions directly
|
|
256
|
+
- Use `time.Sleep` in tests
|
|
257
|
+
- Ignore flaky tests
|
|
258
|
+
|
|
259
|
+
## Related Commands
|
|
260
|
+
|
|
261
|
+
- `/go-build` - Fix build errors
|
|
262
|
+
- `/go-review` - Review code after implementation
|
|
263
|
+
- `/verify` - Run full verification loop
|
|
264
|
+
|
|
265
|
+
## Related
|
|
266
|
+
|
|
267
|
+
- Skill: `skills/golang-testing/`
|
|
268
|
+
- Skill: `skills/tdd-workflow/`
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Fix Gradle build errors for Android and KMP projects
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Gradle Build Fix
|
|
6
|
+
|
|
7
|
+
Incrementally fix Gradle build and compilation errors for Android and Kotlin Multiplatform projects.
|
|
8
|
+
|
|
9
|
+
## Step 1: Detect Build Configuration
|
|
10
|
+
|
|
11
|
+
Identify the project type and run the appropriate build:
|
|
12
|
+
|
|
13
|
+
| Indicator | Build Command |
|
|
14
|
+
|-----------|---------------|
|
|
15
|
+
| `build.gradle.kts` + `composeApp/` (KMP) | `./gradlew composeApp:compileKotlinMetadata 2>&1` |
|
|
16
|
+
| `build.gradle.kts` + `app/` (Android) | `./gradlew app:compileDebugKotlin 2>&1` |
|
|
17
|
+
| `settings.gradle.kts` with modules | `./gradlew assemble 2>&1` |
|
|
18
|
+
| Detekt configured | `./gradlew detekt 2>&1` |
|
|
19
|
+
|
|
20
|
+
Also check `gradle.properties` and `local.properties` for configuration.
|
|
21
|
+
|
|
22
|
+
## Step 2: Parse and Group Errors
|
|
23
|
+
|
|
24
|
+
1. Run the build command and capture output
|
|
25
|
+
2. Separate Kotlin compilation errors from Gradle configuration errors
|
|
26
|
+
3. Group by module and file path
|
|
27
|
+
4. Sort: configuration errors first, then compilation errors by dependency order
|
|
28
|
+
|
|
29
|
+
## Step 3: Fix Loop
|
|
30
|
+
|
|
31
|
+
For each error:
|
|
32
|
+
|
|
33
|
+
1. **Read the file** — Full context around the error line
|
|
34
|
+
2. **Diagnose** — Common categories:
|
|
35
|
+
- Missing import or unresolved reference
|
|
36
|
+
- Type mismatch or incompatible types
|
|
37
|
+
- Missing dependency in `build.gradle.kts`
|
|
38
|
+
- Expect/actual mismatch (KMP)
|
|
39
|
+
- Compose compiler error
|
|
40
|
+
3. **Fix minimally** — Smallest change that resolves the error
|
|
41
|
+
4. **Re-run build** — Verify fix and check for new errors
|
|
42
|
+
5. **Continue** — Move to next error
|
|
43
|
+
|
|
44
|
+
## Step 4: Guardrails
|
|
45
|
+
|
|
46
|
+
Stop and ask the user if:
|
|
47
|
+
- Fix introduces more errors than it resolves
|
|
48
|
+
- Same error persists after 3 attempts
|
|
49
|
+
- Error requires adding new dependencies or changing module structure
|
|
50
|
+
- Gradle sync itself fails (configuration-phase error)
|
|
51
|
+
- Error is in generated code (Room, SQLDelight, KSP)
|
|
52
|
+
|
|
53
|
+
## Step 5: Summary
|
|
54
|
+
|
|
55
|
+
Report:
|
|
56
|
+
- Errors fixed (module, file, description)
|
|
57
|
+
- Errors remaining
|
|
58
|
+
- New errors introduced (should be zero)
|
|
59
|
+
- Suggested next steps
|
|
60
|
+
|
|
61
|
+
## Common Gradle/KMP Fixes
|
|
62
|
+
|
|
63
|
+
| Error | Fix |
|
|
64
|
+
|-------|-----|
|
|
65
|
+
| Unresolved reference in `commonMain` | Check if the dependency is in `commonMain.dependencies {}` |
|
|
66
|
+
| Expect declaration without actual | Add `actual` implementation in each platform source set |
|
|
67
|
+
| Compose compiler version mismatch | Align Kotlin and Compose compiler versions in `libs.versions.toml` |
|
|
68
|
+
| Duplicate class | Check for conflicting dependencies with `./gradlew dependencies` |
|
|
69
|
+
| KSP error | Run `./gradlew kspCommonMainKotlinMetadata` to regenerate |
|
|
70
|
+
| Configuration cache issue | Check for non-serializable task inputs |
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Harness Audit Command
|
|
2
|
+
|
|
3
|
+
Run a deterministic repository harness audit and return a prioritized scorecard.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
`/harness-audit [scope] [--format text|json]`
|
|
8
|
+
|
|
9
|
+
- `scope` (optional): `repo` (default), `hooks`, `skills`, `commands`, `agents`
|
|
10
|
+
- `--format`: output style (`text` default, `json` for automation)
|
|
11
|
+
|
|
12
|
+
## Deterministic Engine
|
|
13
|
+
|
|
14
|
+
Always run:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
node scripts/harness-audit.js <scope> --format <text|json>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
This script is the source of truth for scoring and checks. Do not invent additional dimensions or ad-hoc points.
|
|
21
|
+
|
|
22
|
+
Rubric version: `2026-03-16`.
|
|
23
|
+
|
|
24
|
+
The script computes 7 fixed categories (`0-10` normalized each):
|
|
25
|
+
|
|
26
|
+
1. Tool Coverage
|
|
27
|
+
2. Context Efficiency
|
|
28
|
+
3. Quality Gates
|
|
29
|
+
4. Memory Persistence
|
|
30
|
+
5. Eval Coverage
|
|
31
|
+
6. Security Guardrails
|
|
32
|
+
7. Cost Efficiency
|
|
33
|
+
|
|
34
|
+
Scores are derived from explicit file/rule checks and are reproducible for the same commit.
|
|
35
|
+
|
|
36
|
+
## Output Contract
|
|
37
|
+
|
|
38
|
+
Return:
|
|
39
|
+
|
|
40
|
+
1. `overall_score` out of `max_score` (70 for `repo`; smaller for scoped audits)
|
|
41
|
+
2. Category scores and concrete findings
|
|
42
|
+
3. Failed checks with exact file paths
|
|
43
|
+
4. Top 3 actions from the deterministic output (`top_actions`)
|
|
44
|
+
5. Suggested ECC skills to apply next
|
|
45
|
+
|
|
46
|
+
## Checklist
|
|
47
|
+
|
|
48
|
+
- Use script output directly; do not rescore manually.
|
|
49
|
+
- If `--format json` is requested, return the script JSON unchanged.
|
|
50
|
+
- If text is requested, summarize failing checks and top actions.
|
|
51
|
+
- Include exact file paths from `checks[]` and `top_actions[]`.
|
|
52
|
+
|
|
53
|
+
## Example Result
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
Harness Audit (repo): 66/70
|
|
57
|
+
- Tool Coverage: 10/10 (10/10 pts)
|
|
58
|
+
- Context Efficiency: 9/10 (9/10 pts)
|
|
59
|
+
- Quality Gates: 10/10 (10/10 pts)
|
|
60
|
+
|
|
61
|
+
Top 3 Actions:
|
|
62
|
+
1) [Security Guardrails] Add prompt/tool preflight security guards in hooks/hooks.json. (hooks/hooks.json)
|
|
63
|
+
2) [Tool Coverage] Sync commands/harness-audit.md and .opencode/commands/harness-audit.md. (.opencode/commands/harness-audit.md)
|
|
64
|
+
3) [Eval Coverage] Increase automated test coverage across scripts/hooks/lib. (tests/)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Arguments
|
|
68
|
+
|
|
69
|
+
$ARGUMENTS:
|
|
70
|
+
- `repo|hooks|skills|commands|agents` (optional scope)
|
|
71
|
+
- `--format text|json` (optional output format)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Tự động khởi tạo cấu trúc thư mục tài liệu cho dự án Pilo Masterkit.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Workflow: Khởi tạo Thư mục Tài liệu (Documentation Init)
|
|
6
|
+
|
|
7
|
+
Quy trình này tự động tạo các thư mục cần thiết để quản lý tài liệu, báo cáo và nhiệm vụ theo chuẩn Pilo Masterkit.
|
|
8
|
+
|
|
9
|
+
## Các bước thực hiện:
|
|
10
|
+
|
|
11
|
+
1. **Kiểm tra và Tạo Thư mục**:
|
|
12
|
+
Tạo thư mục `docs/` ở thư mục gốc của dự án (nếu chưa có), sau đó tạo 8 thư mục con bên trong `docs/`:
|
|
13
|
+
- `docs/lessons/`: Lưu trữ bài học kinh nghiệm.
|
|
14
|
+
- `docs/reports/`: Lưu trữ báo cáo tiến độ và audit.
|
|
15
|
+
- `docs/plans/`: Lưu trữ kế hoạch triển khai.
|
|
16
|
+
- `docs/status/`: Lưu trữ trạng thái dự án.
|
|
17
|
+
- `docs/tasks/`: Lưu trữ danh sách nhiệm vụ chi tiết.
|
|
18
|
+
- `docs/logs/`: Lưu trữ nhật ký hoạt động của Agent.
|
|
19
|
+
- `docs/walkthroughs/`: Lưu trữ hướng dẫn thực hiện.
|
|
20
|
+
- `docs/producs/`: Lưu trữ đặc tả sản phẩm (specs, PRD).
|
|
21
|
+
|
|
22
|
+
2. **Khởi tạo File mẫu (Tùy chọn)**:
|
|
23
|
+
Trong mỗi thư mục, tạo một file `README.md` ngắn gọn mô tả mục đích của thư mục đó.
|
|
24
|
+
|
|
25
|
+
## Lệnh thực thi (Dành cho Agent):
|
|
26
|
+
|
|
27
|
+
// turbo
|
|
28
|
+
```pwsh
|
|
29
|
+
$docsDir = "docs"
|
|
30
|
+
if (-not (Test-Path $docsDir)) {
|
|
31
|
+
New-Item -ItemType Directory -Path $docsDir -Force
|
|
32
|
+
Write-Host "Created base directory: $docsDir"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
$dirs = @("lessons", "reports", "plans", "status", "tasks", "logs", "walkthroughs", "producs")
|
|
36
|
+
foreach ($dir in $dirs) {
|
|
37
|
+
$targetPath = Join-Path $docsDir $dir
|
|
38
|
+
if (-not (Test-Path $targetPath)) {
|
|
39
|
+
New-Item -ItemType Directory -Path $targetPath -Force
|
|
40
|
+
Write-Host "Created directory: $targetPath"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Báo cáo kết quả:
|
|
46
|
+
Sau khi hoàn thành, báo cáo danh sách các thư mục đã được khởi tạo thành công.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: instinct-export
|
|
3
|
+
description: Export instincts from project/global scope to a file
|
|
4
|
+
command: /instinct-export
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Instinct Export Command
|
|
8
|
+
|
|
9
|
+
Exports instincts to a shareable format. Perfect for:
|
|
10
|
+
- Sharing with teammates
|
|
11
|
+
- Transferring to a new machine
|
|
12
|
+
- Contributing to project conventions
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
/instinct-export # Export all personal instincts
|
|
18
|
+
/instinct-export --domain testing # Export only testing instincts
|
|
19
|
+
/instinct-export --min-confidence 0.7 # Only export high-confidence instincts
|
|
20
|
+
/instinct-export --output team-instincts.yaml
|
|
21
|
+
/instinct-export --scope project --output project-instincts.yaml
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## What to Do
|
|
25
|
+
|
|
26
|
+
1. Detect current project context
|
|
27
|
+
2. Load instincts by selected scope:
|
|
28
|
+
- `project`: current project only
|
|
29
|
+
- `global`: global only
|
|
30
|
+
- `all`: project + global merged (default)
|
|
31
|
+
3. Apply filters (`--domain`, `--min-confidence`)
|
|
32
|
+
4. Write YAML-style export to file (or stdout if no output path provided)
|
|
33
|
+
|
|
34
|
+
## Output Format
|
|
35
|
+
|
|
36
|
+
Creates a YAML file:
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
# Instincts Export
|
|
40
|
+
# Generated: 2025-01-22
|
|
41
|
+
# Source: personal
|
|
42
|
+
# Count: 12 instincts
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
id: prefer-functional-style
|
|
46
|
+
trigger: "when writing new functions"
|
|
47
|
+
confidence: 0.8
|
|
48
|
+
domain: code-style
|
|
49
|
+
source: session-observation
|
|
50
|
+
scope: project
|
|
51
|
+
project_id: a1b2c3d4e5f6
|
|
52
|
+
project_name: my-app
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
# Prefer Functional Style
|
|
56
|
+
|
|
57
|
+
## Action
|
|
58
|
+
Use functional patterns over classes.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Flags
|
|
62
|
+
|
|
63
|
+
- `--domain <name>`: Export only specified domain
|
|
64
|
+
- `--min-confidence <n>`: Minimum confidence threshold
|
|
65
|
+
- `--output <file>`: Output file path (prints to stdout when omitted)
|
|
66
|
+
- `--scope <project|global|all>`: Export scope (default: `all`)
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: instinct-import
|
|
3
|
+
description: Import instincts from file or URL into project/global scope
|
|
4
|
+
command: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Instinct Import Command
|
|
8
|
+
|
|
9
|
+
## Implementation
|
|
10
|
+
|
|
11
|
+
Run the instinct CLI using the plugin root path:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
python3 "${CLAUDE_PLUGIN_ROOT}/skills/continuous-learning-v2/scripts/instinct-cli.py" import <file-or-url> [--dry-run] [--force] [--min-confidence 0.7] [--scope project|global]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or if `CLAUDE_PLUGIN_ROOT` is not set (manual installation):
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py import <file-or-url>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Import instincts from local file paths or HTTP(S) URLs.
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
/instinct-import team-instincts.yaml
|
|
29
|
+
/instinct-import https://github.com/org/repo/instincts.yaml
|
|
30
|
+
/instinct-import team-instincts.yaml --dry-run
|
|
31
|
+
/instinct-import team-instincts.yaml --scope global --force
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## What to Do
|
|
35
|
+
|
|
36
|
+
1. Fetch the instinct file (local path or URL)
|
|
37
|
+
2. Parse and validate the format
|
|
38
|
+
3. Check for duplicates with existing instincts
|
|
39
|
+
4. Merge or add new instincts
|
|
40
|
+
5. Save to inherited instincts directory:
|
|
41
|
+
- Project scope: `~/.claude/homunculus/projects/<project-id>/instincts/inherited/`
|
|
42
|
+
- Global scope: `~/.claude/homunculus/instincts/inherited/`
|
|
43
|
+
|
|
44
|
+
## Import Process
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
📥 Importing instincts from: team-instincts.yaml
|
|
48
|
+
================================================
|
|
49
|
+
|
|
50
|
+
Found 12 instincts to import.
|
|
51
|
+
|
|
52
|
+
Analyzing conflicts...
|
|
53
|
+
|
|
54
|
+
## New Instincts (8)
|
|
55
|
+
These will be added:
|
|
56
|
+
✓ use-zod-validation (confidence: 0.7)
|
|
57
|
+
✓ prefer-named-exports (confidence: 0.65)
|
|
58
|
+
✓ test-async-functions (confidence: 0.8)
|
|
59
|
+
...
|
|
60
|
+
|
|
61
|
+
## Duplicate Instincts (3)
|
|
62
|
+
Already have similar instincts:
|
|
63
|
+
⚠️ prefer-functional-style
|
|
64
|
+
Local: 0.8 confidence, 12 observations
|
|
65
|
+
Import: 0.7 confidence
|
|
66
|
+
→ Keep local (higher confidence)
|
|
67
|
+
|
|
68
|
+
⚠️ test-first-workflow
|
|
69
|
+
Local: 0.75 confidence
|
|
70
|
+
Import: 0.9 confidence
|
|
71
|
+
→ Update to import (higher confidence)
|
|
72
|
+
|
|
73
|
+
Import 8 new, update 1?
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Merge Behavior
|
|
77
|
+
|
|
78
|
+
When importing an instinct with an existing ID:
|
|
79
|
+
- Higher-confidence import becomes an update candidate
|
|
80
|
+
- Equal/lower-confidence import is skipped
|
|
81
|
+
- User confirms unless `--force` is used
|
|
82
|
+
|
|
83
|
+
## Source Tracking
|
|
84
|
+
|
|
85
|
+
Imported instincts are marked with:
|
|
86
|
+
```yaml
|
|
87
|
+
source: inherited
|
|
88
|
+
scope: project
|
|
89
|
+
imported_from: "team-instincts.yaml"
|
|
90
|
+
project_id: "a1b2c3d4e5f6"
|
|
91
|
+
project_name: "my-project"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Flags
|
|
95
|
+
|
|
96
|
+
- `--dry-run`: Preview without importing
|
|
97
|
+
- `--force`: Skip confirmation prompt
|
|
98
|
+
- `--min-confidence <n>`: Only import instincts above threshold
|
|
99
|
+
- `--scope <project|global>`: Select target scope (default: `project`)
|
|
100
|
+
|
|
101
|
+
## Output
|
|
102
|
+
|
|
103
|
+
After import:
|
|
104
|
+
```
|
|
105
|
+
✅ Import complete!
|
|
106
|
+
|
|
107
|
+
Added: 8 instincts
|
|
108
|
+
Updated: 1 instinct
|
|
109
|
+
Skipped: 3 instincts (equal/higher confidence already exists)
|
|
110
|
+
|
|
111
|
+
New instincts saved to: ~/.claude/homunculus/instincts/inherited/
|
|
112
|
+
|
|
113
|
+
Run /instinct-status to see all instincts.
|
|
114
|
+
```
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: instinct-status
|
|
3
|
+
description: Show learned instincts (project + global) with confidence
|
|
4
|
+
command: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Instinct Status Command
|
|
8
|
+
|
|
9
|
+
Shows learned instincts for the current project plus global instincts, grouped by domain.
|
|
10
|
+
|
|
11
|
+
## Implementation
|
|
12
|
+
|
|
13
|
+
Run the instinct CLI using the plugin root path:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
python3 "${CLAUDE_PLUGIN_ROOT}/skills/continuous-learning-v2/scripts/instinct-cli.py" status
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or if `CLAUDE_PLUGIN_ROOT` is not set (manual installation), use:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
python3 ~/.claude/skills/continuous-learning-v2/scripts/instinct-cli.py status
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
/instinct-status
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## What to Do
|
|
32
|
+
|
|
33
|
+
1. Detect current project context (git remote/path hash)
|
|
34
|
+
2. Read project instincts from `~/.claude/homunculus/projects/<project-id>/instincts/`
|
|
35
|
+
3. Read global instincts from `~/.claude/homunculus/instincts/`
|
|
36
|
+
4. Merge with precedence rules (project overrides global when IDs collide)
|
|
37
|
+
5. Display grouped by domain with confidence bars and observation stats
|
|
38
|
+
|
|
39
|
+
## Output Format
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
============================================================
|
|
43
|
+
INSTINCT STATUS - 12 total
|
|
44
|
+
============================================================
|
|
45
|
+
|
|
46
|
+
Project: my-app (a1b2c3d4e5f6)
|
|
47
|
+
Project instincts: 8
|
|
48
|
+
Global instincts: 4
|
|
49
|
+
|
|
50
|
+
## PROJECT-SCOPED (my-app)
|
|
51
|
+
### WORKFLOW (3)
|
|
52
|
+
███████░░░ 70% grep-before-edit [project]
|
|
53
|
+
trigger: when modifying code
|
|
54
|
+
|
|
55
|
+
## GLOBAL (apply to all projects)
|
|
56
|
+
### SECURITY (2)
|
|
57
|
+
█████████░ 85% validate-user-input [global]
|
|
58
|
+
trigger: when handling user input
|
|
59
|
+
```
|