claude-code-pilot 2.0.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 (257) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +151 -0
  3. package/bin/install.js +431 -0
  4. package/docs/agent-guides/architecture.md +107 -0
  5. package/ecc/agents/architect.md +211 -0
  6. package/ecc/agents/code-reviewer.md +237 -0
  7. package/ecc/agents/doc-updater.md +107 -0
  8. package/ecc/agents/e2e-runner.md +107 -0
  9. package/ecc/agents/security-reviewer.md +108 -0
  10. package/ecc/agents/tdd-guide.md +91 -0
  11. package/ecc/commands/checkpoint.md +74 -0
  12. package/ecc/commands/evolve.md +178 -0
  13. package/ecc/commands/learn.md +70 -0
  14. package/ecc/commands/model-route.md +26 -0
  15. package/ecc/commands/quality-gate.md +29 -0
  16. package/ecc/commands/resume-session.md +155 -0
  17. package/ecc/commands/save-session.md +275 -0
  18. package/ecc/commands/sessions.md +305 -0
  19. package/ecc/commands/verify.md +59 -0
  20. package/ecc/contexts/dev.md +20 -0
  21. package/ecc/contexts/research.md +26 -0
  22. package/ecc/contexts/review.md +22 -0
  23. package/ecc/examples/CLAUDE.md +100 -0
  24. package/ecc/examples/django-api-CLAUDE.md +308 -0
  25. package/ecc/examples/go-microservice-CLAUDE.md +267 -0
  26. package/ecc/examples/rust-api-CLAUDE.md +285 -0
  27. package/ecc/examples/saas-nextjs-CLAUDE.md +166 -0
  28. package/ecc/examples/user-CLAUDE.md +109 -0
  29. package/ecc/rules/common/agents.md +49 -0
  30. package/ecc/rules/common/coding-style.md +48 -0
  31. package/ecc/rules/common/development-workflow.md +37 -0
  32. package/ecc/rules/common/git-workflow.md +24 -0
  33. package/ecc/rules/common/hooks.md +30 -0
  34. package/ecc/rules/common/patterns.md +31 -0
  35. package/ecc/rules/common/performance.md +55 -0
  36. package/ecc/rules/common/security.md +29 -0
  37. package/ecc/rules/common/testing.md +29 -0
  38. package/ecc/rules/golang/coding-style.md +32 -0
  39. package/ecc/rules/golang/hooks.md +17 -0
  40. package/ecc/rules/golang/patterns.md +45 -0
  41. package/ecc/rules/golang/security.md +34 -0
  42. package/ecc/rules/golang/testing.md +31 -0
  43. package/ecc/rules/kotlin/coding-style.md +86 -0
  44. package/ecc/rules/kotlin/patterns.md +146 -0
  45. package/ecc/rules/kotlin/security.md +82 -0
  46. package/ecc/rules/kotlin/testing.md +128 -0
  47. package/ecc/rules/perl/coding-style.md +46 -0
  48. package/ecc/rules/perl/hooks.md +22 -0
  49. package/ecc/rules/perl/patterns.md +76 -0
  50. package/ecc/rules/perl/security.md +69 -0
  51. package/ecc/rules/perl/testing.md +54 -0
  52. package/ecc/rules/php/coding-style.md +35 -0
  53. package/ecc/rules/php/hooks.md +24 -0
  54. package/ecc/rules/php/patterns.md +32 -0
  55. package/ecc/rules/php/security.md +33 -0
  56. package/ecc/rules/php/testing.md +34 -0
  57. package/ecc/rules/python/coding-style.md +42 -0
  58. package/ecc/rules/python/hooks.md +19 -0
  59. package/ecc/rules/python/patterns.md +39 -0
  60. package/ecc/rules/python/security.md +30 -0
  61. package/ecc/rules/python/testing.md +38 -0
  62. package/ecc/rules/swift/coding-style.md +47 -0
  63. package/ecc/rules/swift/hooks.md +20 -0
  64. package/ecc/rules/swift/patterns.md +66 -0
  65. package/ecc/rules/swift/security.md +33 -0
  66. package/ecc/rules/swift/testing.md +45 -0
  67. package/ecc/rules/typescript/coding-style.md +199 -0
  68. package/ecc/rules/typescript/hooks.md +22 -0
  69. package/ecc/rules/typescript/patterns.md +52 -0
  70. package/ecc/rules/typescript/security.md +28 -0
  71. package/ecc/rules/typescript/testing.md +18 -0
  72. package/ecc/scripts/hooks/check-hook-enabled.js +12 -0
  73. package/ecc/scripts/hooks/evaluate-session.js +100 -0
  74. package/ecc/scripts/hooks/pre-compact.js +48 -0
  75. package/ecc/scripts/hooks/run-with-flags-shell.sh +32 -0
  76. package/ecc/scripts/hooks/run-with-flags.js +120 -0
  77. package/ecc/scripts/hooks/session-end-marker.js +15 -0
  78. package/ecc/scripts/hooks/session-end.js +258 -0
  79. package/ecc/scripts/hooks/session-start.js +97 -0
  80. package/ecc/scripts/hooks/suggest-compact.js +80 -0
  81. package/ecc/scripts/lib/hook-flags.js +74 -0
  82. package/ecc/scripts/lib/package-manager.d.ts +119 -0
  83. package/ecc/scripts/lib/package-manager.js +431 -0
  84. package/ecc/scripts/lib/project-detect.js +428 -0
  85. package/ecc/scripts/lib/resolve-formatter.js +185 -0
  86. package/ecc/scripts/lib/session-aliases.d.ts +136 -0
  87. package/ecc/scripts/lib/session-aliases.js +481 -0
  88. package/ecc/scripts/lib/session-manager.d.ts +131 -0
  89. package/ecc/scripts/lib/session-manager.js +444 -0
  90. package/ecc/scripts/lib/shell-split.js +86 -0
  91. package/ecc/scripts/lib/utils.d.ts +183 -0
  92. package/ecc/scripts/lib/utils.js +543 -0
  93. package/ecc/skills/continuous-learning-v2/SKILL.md +365 -0
  94. package/ecc/skills/continuous-learning-v2/agents/observer-loop.sh +144 -0
  95. package/ecc/skills/continuous-learning-v2/agents/observer.md +198 -0
  96. package/ecc/skills/continuous-learning-v2/agents/start-observer.sh +194 -0
  97. package/ecc/skills/continuous-learning-v2/config.json +8 -0
  98. package/ecc/skills/continuous-learning-v2/hooks/observe.sh +246 -0
  99. package/ecc/skills/continuous-learning-v2/scripts/detect-project.sh +218 -0
  100. package/ecc/skills/continuous-learning-v2/scripts/instinct-cli.py +1148 -0
  101. package/ecc/skills/continuous-learning-v2/scripts/test_parse_instinct.py +984 -0
  102. package/ecc/skills/strategic-compact/SKILL.md +103 -0
  103. package/ecc/skills/strategic-compact/suggest-compact.sh +54 -0
  104. package/ecc/skills/verification-loop-SKILL.md +126 -0
  105. package/gsd/LICENSE +21 -0
  106. package/gsd/agents/gsd-codebase-mapper.md +772 -0
  107. package/gsd/agents/gsd-debugger.md +1257 -0
  108. package/gsd/agents/gsd-executor.md +489 -0
  109. package/gsd/agents/gsd-integration-checker.md +445 -0
  110. package/gsd/agents/gsd-nyquist-auditor.md +178 -0
  111. package/gsd/agents/gsd-phase-researcher.md +555 -0
  112. package/gsd/agents/gsd-plan-checker.md +708 -0
  113. package/gsd/agents/gsd-planner.md +1309 -0
  114. package/gsd/agents/gsd-project-researcher.md +631 -0
  115. package/gsd/agents/gsd-research-synthesizer.md +249 -0
  116. package/gsd/agents/gsd-roadmapper.md +652 -0
  117. package/gsd/agents/gsd-verifier.md +581 -0
  118. package/gsd/commands-gsd/add-phase.md +43 -0
  119. package/gsd/commands-gsd/add-tests.md +41 -0
  120. package/gsd/commands-gsd/add-todo.md +47 -0
  121. package/gsd/commands-gsd/audit-milestone.md +36 -0
  122. package/gsd/commands-gsd/check-todos.md +45 -0
  123. package/gsd/commands-gsd/cleanup.md +18 -0
  124. package/gsd/commands-gsd/complete-milestone.md +136 -0
  125. package/gsd/commands-gsd/debug.md +168 -0
  126. package/gsd/commands-gsd/discuss-phase.md +90 -0
  127. package/gsd/commands-gsd/execute-phase.md +41 -0
  128. package/gsd/commands-gsd/health.md +22 -0
  129. package/gsd/commands-gsd/help.md +22 -0
  130. package/gsd/commands-gsd/insert-phase.md +32 -0
  131. package/gsd/commands-gsd/join-discord.md +18 -0
  132. package/gsd/commands-gsd/list-phase-assumptions.md +46 -0
  133. package/gsd/commands-gsd/map-codebase.md +71 -0
  134. package/gsd/commands-gsd/new-milestone.md +44 -0
  135. package/gsd/commands-gsd/new-project.md +42 -0
  136. package/gsd/commands-gsd/pause-work.md +38 -0
  137. package/gsd/commands-gsd/plan-milestone-gaps.md +34 -0
  138. package/gsd/commands-gsd/plan-phase.md +45 -0
  139. package/gsd/commands-gsd/progress.md +24 -0
  140. package/gsd/commands-gsd/quick.md +45 -0
  141. package/gsd/commands-gsd/reapply-patches.md +123 -0
  142. package/gsd/commands-gsd/remove-phase.md +31 -0
  143. package/gsd/commands-gsd/research-phase.md +190 -0
  144. package/gsd/commands-gsd/resume-work.md +40 -0
  145. package/gsd/commands-gsd/set-profile.md +34 -0
  146. package/gsd/commands-gsd/settings.md +36 -0
  147. package/gsd/commands-gsd/update.md +37 -0
  148. package/gsd/commands-gsd/validate-phase.md +35 -0
  149. package/gsd/commands-gsd/verify-work.md +38 -0
  150. package/gsd/get-shit-done/bin/gsd-tools.cjs +592 -0
  151. package/gsd/get-shit-done/bin/lib/commands.cjs +548 -0
  152. package/gsd/get-shit-done/bin/lib/config.cjs +169 -0
  153. package/gsd/get-shit-done/bin/lib/core.cjs +492 -0
  154. package/gsd/get-shit-done/bin/lib/frontmatter.cjs +299 -0
  155. package/gsd/get-shit-done/bin/lib/init.cjs +710 -0
  156. package/gsd/get-shit-done/bin/lib/milestone.cjs +241 -0
  157. package/gsd/get-shit-done/bin/lib/phase.cjs +901 -0
  158. package/gsd/get-shit-done/bin/lib/roadmap.cjs +298 -0
  159. package/gsd/get-shit-done/bin/lib/state.cjs +721 -0
  160. package/gsd/get-shit-done/bin/lib/template.cjs +222 -0
  161. package/gsd/get-shit-done/bin/lib/verify.cjs +820 -0
  162. package/gsd/get-shit-done/references/checkpoints.md +776 -0
  163. package/gsd/get-shit-done/references/continuation-format.md +249 -0
  164. package/gsd/get-shit-done/references/decimal-phase-calculation.md +65 -0
  165. package/gsd/get-shit-done/references/git-integration.md +248 -0
  166. package/gsd/get-shit-done/references/git-planning-commit.md +38 -0
  167. package/gsd/get-shit-done/references/model-profile-resolution.md +34 -0
  168. package/gsd/get-shit-done/references/model-profiles.md +93 -0
  169. package/gsd/get-shit-done/references/phase-argument-parsing.md +61 -0
  170. package/gsd/get-shit-done/references/planning-config.md +200 -0
  171. package/gsd/get-shit-done/references/questioning.md +162 -0
  172. package/gsd/get-shit-done/references/tdd.md +263 -0
  173. package/gsd/get-shit-done/references/ui-brand.md +160 -0
  174. package/gsd/get-shit-done/references/verification-patterns.md +612 -0
  175. package/gsd/get-shit-done/templates/DEBUG.md +164 -0
  176. package/gsd/get-shit-done/templates/UAT.md +247 -0
  177. package/gsd/get-shit-done/templates/VALIDATION.md +76 -0
  178. package/gsd/get-shit-done/templates/codebase/architecture.md +255 -0
  179. package/gsd/get-shit-done/templates/codebase/concerns.md +310 -0
  180. package/gsd/get-shit-done/templates/codebase/conventions.md +307 -0
  181. package/gsd/get-shit-done/templates/codebase/integrations.md +280 -0
  182. package/gsd/get-shit-done/templates/codebase/stack.md +186 -0
  183. package/gsd/get-shit-done/templates/codebase/structure.md +285 -0
  184. package/gsd/get-shit-done/templates/codebase/testing.md +480 -0
  185. package/gsd/get-shit-done/templates/config.json +37 -0
  186. package/gsd/get-shit-done/templates/context.md +297 -0
  187. package/gsd/get-shit-done/templates/continue-here.md +78 -0
  188. package/gsd/get-shit-done/templates/debug-subagent-prompt.md +91 -0
  189. package/gsd/get-shit-done/templates/discovery.md +146 -0
  190. package/gsd/get-shit-done/templates/milestone-archive.md +123 -0
  191. package/gsd/get-shit-done/templates/milestone.md +115 -0
  192. package/gsd/get-shit-done/templates/phase-prompt.md +569 -0
  193. package/gsd/get-shit-done/templates/planner-subagent-prompt.md +117 -0
  194. package/gsd/get-shit-done/templates/project.md +184 -0
  195. package/gsd/get-shit-done/templates/requirements.md +231 -0
  196. package/gsd/get-shit-done/templates/research-project/ARCHITECTURE.md +204 -0
  197. package/gsd/get-shit-done/templates/research-project/FEATURES.md +147 -0
  198. package/gsd/get-shit-done/templates/research-project/PITFALLS.md +200 -0
  199. package/gsd/get-shit-done/templates/research-project/STACK.md +120 -0
  200. package/gsd/get-shit-done/templates/research-project/SUMMARY.md +170 -0
  201. package/gsd/get-shit-done/templates/research.md +552 -0
  202. package/gsd/get-shit-done/templates/retrospective.md +54 -0
  203. package/gsd/get-shit-done/templates/roadmap.md +202 -0
  204. package/gsd/get-shit-done/templates/state.md +176 -0
  205. package/gsd/get-shit-done/templates/summary-complex.md +59 -0
  206. package/gsd/get-shit-done/templates/summary-minimal.md +41 -0
  207. package/gsd/get-shit-done/templates/summary-standard.md +48 -0
  208. package/gsd/get-shit-done/templates/summary.md +248 -0
  209. package/gsd/get-shit-done/templates/user-setup.md +311 -0
  210. package/gsd/get-shit-done/templates/verification-report.md +322 -0
  211. package/gsd/get-shit-done/workflows/add-phase.md +112 -0
  212. package/gsd/get-shit-done/workflows/add-tests.md +351 -0
  213. package/gsd/get-shit-done/workflows/add-todo.md +158 -0
  214. package/gsd/get-shit-done/workflows/audit-milestone.md +332 -0
  215. package/gsd/get-shit-done/workflows/check-todos.md +177 -0
  216. package/gsd/get-shit-done/workflows/cleanup.md +152 -0
  217. package/gsd/get-shit-done/workflows/complete-milestone.md +764 -0
  218. package/gsd/get-shit-done/workflows/diagnose-issues.md +219 -0
  219. package/gsd/get-shit-done/workflows/discovery-phase.md +289 -0
  220. package/gsd/get-shit-done/workflows/discuss-phase.md +676 -0
  221. package/gsd/get-shit-done/workflows/execute-phase.md +459 -0
  222. package/gsd/get-shit-done/workflows/execute-plan.md +449 -0
  223. package/gsd/get-shit-done/workflows/health.md +159 -0
  224. package/gsd/get-shit-done/workflows/help.md +489 -0
  225. package/gsd/get-shit-done/workflows/insert-phase.md +130 -0
  226. package/gsd/get-shit-done/workflows/list-phase-assumptions.md +178 -0
  227. package/gsd/get-shit-done/workflows/map-codebase.md +316 -0
  228. package/gsd/get-shit-done/workflows/new-milestone.md +384 -0
  229. package/gsd/get-shit-done/workflows/new-project.md +1111 -0
  230. package/gsd/get-shit-done/workflows/pause-work.md +122 -0
  231. package/gsd/get-shit-done/workflows/plan-milestone-gaps.md +274 -0
  232. package/gsd/get-shit-done/workflows/plan-phase.md +560 -0
  233. package/gsd/get-shit-done/workflows/progress.md +382 -0
  234. package/gsd/get-shit-done/workflows/quick.md +601 -0
  235. package/gsd/get-shit-done/workflows/remove-phase.md +155 -0
  236. package/gsd/get-shit-done/workflows/research-phase.md +74 -0
  237. package/gsd/get-shit-done/workflows/resume-project.md +307 -0
  238. package/gsd/get-shit-done/workflows/set-profile.md +81 -0
  239. package/gsd/get-shit-done/workflows/settings.md +214 -0
  240. package/gsd/get-shit-done/workflows/transition.md +544 -0
  241. package/gsd/get-shit-done/workflows/update.md +240 -0
  242. package/gsd/get-shit-done/workflows/validate-phase.md +167 -0
  243. package/gsd/get-shit-done/workflows/verify-phase.md +243 -0
  244. package/gsd/get-shit-done/workflows/verify-work.md +583 -0
  245. package/gsd/hooks/gsd-check-update.js +81 -0
  246. package/gsd/hooks/gsd-context-monitor.js +141 -0
  247. package/gsd/hooks/gsd-statusline.js +115 -0
  248. package/kit/CLAUDE.md +43 -0
  249. package/kit/commands/kit/update.md +46 -0
  250. package/kit/commands/setup-refresh.md +50 -0
  251. package/kit/commands/setup.md +579 -0
  252. package/kit/commands/tool-guide.md +44 -0
  253. package/kit/hooks/kit-check-update.js +54 -0
  254. package/kit/mcp.json +10 -0
  255. package/kit/rules/code-style.md +24 -0
  256. package/manifest.json +30 -0
  257. package/package.json +36 -0
@@ -0,0 +1,38 @@
1
+ ---
2
+ paths:
3
+ - "**/*.py"
4
+ - "**/*.pyi"
5
+ ---
6
+ # Python Testing
7
+
8
+ > This file extends [common/testing.md](../common/testing.md) with Python specific content.
9
+
10
+ ## Framework
11
+
12
+ Use **pytest** as the testing framework.
13
+
14
+ ## Coverage
15
+
16
+ ```bash
17
+ pytest --cov=src --cov-report=term-missing
18
+ ```
19
+
20
+ ## Test Organization
21
+
22
+ Use `pytest.mark` for test categorization:
23
+
24
+ ```python
25
+ import pytest
26
+
27
+ @pytest.mark.unit
28
+ def test_calculate_total():
29
+ ...
30
+
31
+ @pytest.mark.integration
32
+ def test_database_connection():
33
+ ...
34
+ ```
35
+
36
+ ## Reference
37
+
38
+ See skill: `python-testing` for detailed pytest patterns and fixtures.
@@ -0,0 +1,47 @@
1
+ ---
2
+ paths:
3
+ - "**/*.swift"
4
+ - "**/Package.swift"
5
+ ---
6
+ # Swift Coding Style
7
+
8
+ > This file extends [common/coding-style.md](../common/coding-style.md) with Swift specific content.
9
+
10
+ ## Formatting
11
+
12
+ - **SwiftFormat** for auto-formatting, **SwiftLint** for style enforcement
13
+ - `swift-format` is bundled with Xcode 16+ as an alternative
14
+
15
+ ## Immutability
16
+
17
+ - Prefer `let` over `var` — define everything as `let` and only change to `var` if the compiler requires it
18
+ - Use `struct` with value semantics by default; use `class` only when identity or reference semantics are needed
19
+
20
+ ## Naming
21
+
22
+ Follow [Apple API Design Guidelines](https://www.swift.org/documentation/api-design-guidelines/):
23
+
24
+ - Clarity at the point of use — omit needless words
25
+ - Name methods and properties for their roles, not their types
26
+ - Use `static let` for constants over global constants
27
+
28
+ ## Error Handling
29
+
30
+ Use typed throws (Swift 6+) and pattern matching:
31
+
32
+ ```swift
33
+ func load(id: String) throws(LoadError) -> Item {
34
+ guard let data = try? read(from: path) else {
35
+ throw .fileNotFound(id)
36
+ }
37
+ return try decode(data)
38
+ }
39
+ ```
40
+
41
+ ## Concurrency
42
+
43
+ Enable Swift 6 strict concurrency checking. Prefer:
44
+
45
+ - `Sendable` value types for data crossing isolation boundaries
46
+ - Actors for shared mutable state
47
+ - Structured concurrency (`async let`, `TaskGroup`) over unstructured `Task {}`
@@ -0,0 +1,20 @@
1
+ ---
2
+ paths:
3
+ - "**/*.swift"
4
+ - "**/Package.swift"
5
+ ---
6
+ # Swift Hooks
7
+
8
+ > This file extends [common/hooks.md](../common/hooks.md) with Swift specific content.
9
+
10
+ ## PostToolUse Hooks
11
+
12
+ Configure in `~/.claude/settings.json`:
13
+
14
+ - **SwiftFormat**: Auto-format `.swift` files after edit
15
+ - **SwiftLint**: Run lint checks after editing `.swift` files
16
+ - **swift build**: Type-check modified packages after edit
17
+
18
+ ## Warning
19
+
20
+ Flag `print()` statements — use `os.Logger` or structured logging instead for production code.
@@ -0,0 +1,66 @@
1
+ ---
2
+ paths:
3
+ - "**/*.swift"
4
+ - "**/Package.swift"
5
+ ---
6
+ # Swift Patterns
7
+
8
+ > This file extends [common/patterns.md](../common/patterns.md) with Swift specific content.
9
+
10
+ ## Protocol-Oriented Design
11
+
12
+ Define small, focused protocols. Use protocol extensions for shared defaults:
13
+
14
+ ```swift
15
+ protocol Repository: Sendable {
16
+ associatedtype Item: Identifiable & Sendable
17
+ func find(by id: Item.ID) async throws -> Item?
18
+ func save(_ item: Item) async throws
19
+ }
20
+ ```
21
+
22
+ ## Value Types
23
+
24
+ - Use structs for data transfer objects and models
25
+ - Use enums with associated values to model distinct states:
26
+
27
+ ```swift
28
+ enum LoadState<T: Sendable>: Sendable {
29
+ case idle
30
+ case loading
31
+ case loaded(T)
32
+ case failed(Error)
33
+ }
34
+ ```
35
+
36
+ ## Actor Pattern
37
+
38
+ Use actors for shared mutable state instead of locks or dispatch queues:
39
+
40
+ ```swift
41
+ actor Cache<Key: Hashable & Sendable, Value: Sendable> {
42
+ private var storage: [Key: Value] = [:]
43
+
44
+ func get(_ key: Key) -> Value? { storage[key] }
45
+ func set(_ key: Key, value: Value) { storage[key] = value }
46
+ }
47
+ ```
48
+
49
+ ## Dependency Injection
50
+
51
+ Inject protocols with default parameters — production uses defaults, tests inject mocks:
52
+
53
+ ```swift
54
+ struct UserService {
55
+ private let repository: any UserRepository
56
+
57
+ init(repository: any UserRepository = DefaultUserRepository()) {
58
+ self.repository = repository
59
+ }
60
+ }
61
+ ```
62
+
63
+ ## References
64
+
65
+ See skill: `swift-actor-persistence` for actor-based persistence patterns.
66
+ See skill: `swift-protocol-di-testing` for protocol-based DI and testing.
@@ -0,0 +1,33 @@
1
+ ---
2
+ paths:
3
+ - "**/*.swift"
4
+ - "**/Package.swift"
5
+ ---
6
+ # Swift Security
7
+
8
+ > This file extends [common/security.md](../common/security.md) with Swift specific content.
9
+
10
+ ## Secret Management
11
+
12
+ - Use **Keychain Services** for sensitive data (tokens, passwords, keys) — never `UserDefaults`
13
+ - Use environment variables or `.xcconfig` files for build-time secrets
14
+ - Never hardcode secrets in source — decompilation tools extract them trivially
15
+
16
+ ```swift
17
+ let apiKey = ProcessInfo.processInfo.environment["API_KEY"]
18
+ guard let apiKey, !apiKey.isEmpty else {
19
+ fatalError("API_KEY not configured")
20
+ }
21
+ ```
22
+
23
+ ## Transport Security
24
+
25
+ - App Transport Security (ATS) is enforced by default — do not disable it
26
+ - Use certificate pinning for critical endpoints
27
+ - Validate all server certificates
28
+
29
+ ## Input Validation
30
+
31
+ - Sanitize all user input before display to prevent injection
32
+ - Use `URL(string:)` with validation rather than force-unwrapping
33
+ - Validate data from external sources (APIs, deep links, pasteboard) before processing
@@ -0,0 +1,45 @@
1
+ ---
2
+ paths:
3
+ - "**/*.swift"
4
+ - "**/Package.swift"
5
+ ---
6
+ # Swift Testing
7
+
8
+ > This file extends [common/testing.md](../common/testing.md) with Swift specific content.
9
+
10
+ ## Framework
11
+
12
+ Use **Swift Testing** (`import Testing`) for new tests. Use `@Test` and `#expect`:
13
+
14
+ ```swift
15
+ @Test("User creation validates email")
16
+ func userCreationValidatesEmail() throws {
17
+ #expect(throws: ValidationError.invalidEmail) {
18
+ try User(email: "not-an-email")
19
+ }
20
+ }
21
+ ```
22
+
23
+ ## Test Isolation
24
+
25
+ Each test gets a fresh instance — set up in `init`, tear down in `deinit`. No shared mutable state between tests.
26
+
27
+ ## Parameterized Tests
28
+
29
+ ```swift
30
+ @Test("Validates formats", arguments: ["json", "xml", "csv"])
31
+ func validatesFormat(format: String) throws {
32
+ let parser = try Parser(format: format)
33
+ #expect(parser.isValid)
34
+ }
35
+ ```
36
+
37
+ ## Coverage
38
+
39
+ ```bash
40
+ swift test --enable-code-coverage
41
+ ```
42
+
43
+ ## Reference
44
+
45
+ See skill: `swift-protocol-di-testing` for protocol-based dependency injection and mock patterns with Swift Testing.
@@ -0,0 +1,199 @@
1
+ ---
2
+ paths:
3
+ - "**/*.ts"
4
+ - "**/*.tsx"
5
+ - "**/*.js"
6
+ - "**/*.jsx"
7
+ ---
8
+ # TypeScript/JavaScript Coding Style
9
+
10
+ > This file extends [common/coding-style.md](../common/coding-style.md) with TypeScript/JavaScript specific content.
11
+
12
+ ## Types and Interfaces
13
+
14
+ Use types to make public APIs, shared models, and component props explicit, readable, and reusable.
15
+
16
+ ### Public APIs
17
+
18
+ - Add parameter and return types to exported functions, shared utilities, and public class methods
19
+ - Let TypeScript infer obvious local variable types
20
+ - Extract repeated inline object shapes into named types or interfaces
21
+
22
+ ```typescript
23
+ // WRONG: Exported function without explicit types
24
+ export function formatUser(user) {
25
+ return `${user.firstName} ${user.lastName}`
26
+ }
27
+
28
+ // CORRECT: Explicit types on public APIs
29
+ interface User {
30
+ firstName: string
31
+ lastName: string
32
+ }
33
+
34
+ export function formatUser(user: User): string {
35
+ return `${user.firstName} ${user.lastName}`
36
+ }
37
+ ```
38
+
39
+ ### Interfaces vs. Type Aliases
40
+
41
+ - Use `interface` for object shapes that may be extended or implemented
42
+ - Use `type` for unions, intersections, tuples, mapped types, and utility types
43
+ - Prefer string literal unions over `enum` unless an `enum` is required for interoperability
44
+
45
+ ```typescript
46
+ interface User {
47
+ id: string
48
+ email: string
49
+ }
50
+
51
+ type UserRole = 'admin' | 'member'
52
+ type UserWithRole = User & {
53
+ role: UserRole
54
+ }
55
+ ```
56
+
57
+ ### Avoid `any`
58
+
59
+ - Avoid `any` in application code
60
+ - Use `unknown` for external or untrusted input, then narrow it safely
61
+ - Use generics when a value's type depends on the caller
62
+
63
+ ```typescript
64
+ // WRONG: any removes type safety
65
+ function getErrorMessage(error: any) {
66
+ return error.message
67
+ }
68
+
69
+ // CORRECT: unknown forces safe narrowing
70
+ function getErrorMessage(error: unknown): string {
71
+ if (error instanceof Error) {
72
+ return error.message
73
+ }
74
+
75
+ return 'Unexpected error'
76
+ }
77
+ ```
78
+
79
+ ### React Props
80
+
81
+ - Define component props with a named `interface` or `type`
82
+ - Type callback props explicitly
83
+ - Do not use `React.FC` unless there is a specific reason to do so
84
+
85
+ ```typescript
86
+ interface User {
87
+ id: string
88
+ email: string
89
+ }
90
+
91
+ interface UserCardProps {
92
+ user: User
93
+ onSelect: (id: string) => void
94
+ }
95
+
96
+ function UserCard({ user, onSelect }: UserCardProps) {
97
+ return <button onClick={() => onSelect(user.id)}>{user.email}</button>
98
+ }
99
+ ```
100
+
101
+ ### JavaScript Files
102
+
103
+ - In `.js` and `.jsx` files, use JSDoc when types improve clarity and a TypeScript migration is not practical
104
+ - Keep JSDoc aligned with runtime behavior
105
+
106
+ ```javascript
107
+ /**
108
+ * @param {{ firstName: string, lastName: string }} user
109
+ * @returns {string}
110
+ */
111
+ export function formatUser(user) {
112
+ return `${user.firstName} ${user.lastName}`
113
+ }
114
+ ```
115
+
116
+ ## Immutability
117
+
118
+ Use spread operator for immutable updates:
119
+
120
+ ```typescript
121
+ interface User {
122
+ id: string
123
+ name: string
124
+ }
125
+
126
+ // WRONG: Mutation
127
+ function updateUser(user: User, name: string): User {
128
+ user.name = name // MUTATION!
129
+ return user
130
+ }
131
+
132
+ // CORRECT: Immutability
133
+ function updateUser(user: Readonly<User>, name: string): User {
134
+ return {
135
+ ...user,
136
+ name
137
+ }
138
+ }
139
+ ```
140
+
141
+ ## Error Handling
142
+
143
+ Use async/await with try-catch and narrow unknown errors safely:
144
+
145
+ ```typescript
146
+ interface User {
147
+ id: string
148
+ email: string
149
+ }
150
+
151
+ declare function riskyOperation(userId: string): Promise<User>
152
+
153
+ function getErrorMessage(error: unknown): string {
154
+ if (error instanceof Error) {
155
+ return error.message
156
+ }
157
+
158
+ return 'Unexpected error'
159
+ }
160
+
161
+ const logger = {
162
+ error: (message: string, error: unknown) => {
163
+ // Replace with your production logger (for example, pino or winston).
164
+ }
165
+ }
166
+
167
+ async function loadUser(userId: string): Promise<User> {
168
+ try {
169
+ const result = await riskyOperation(userId)
170
+ return result
171
+ } catch (error: unknown) {
172
+ logger.error('Operation failed', error)
173
+ throw new Error(getErrorMessage(error))
174
+ }
175
+ }
176
+ ```
177
+
178
+ ## Input Validation
179
+
180
+ Use Zod for schema-based validation and infer types from the schema:
181
+
182
+ ```typescript
183
+ import { z } from 'zod'
184
+
185
+ const userSchema = z.object({
186
+ email: z.string().email(),
187
+ age: z.number().int().min(0).max(150)
188
+ })
189
+
190
+ type UserInput = z.infer<typeof userSchema>
191
+
192
+ const validated: UserInput = userSchema.parse(input)
193
+ ```
194
+
195
+ ## Console.log
196
+
197
+ - No `console.log` statements in production code
198
+ - Use proper logging libraries instead
199
+ - See hooks for automatic detection
@@ -0,0 +1,22 @@
1
+ ---
2
+ paths:
3
+ - "**/*.ts"
4
+ - "**/*.tsx"
5
+ - "**/*.js"
6
+ - "**/*.jsx"
7
+ ---
8
+ # TypeScript/JavaScript Hooks
9
+
10
+ > This file extends [common/hooks.md](../common/hooks.md) with TypeScript/JavaScript specific content.
11
+
12
+ ## PostToolUse Hooks
13
+
14
+ Configure in `~/.claude/settings.json`:
15
+
16
+ - **Prettier**: Auto-format JS/TS files after edit
17
+ - **TypeScript check**: Run `tsc` after editing `.ts`/`.tsx` files
18
+ - **console.log warning**: Warn about `console.log` in edited files
19
+
20
+ ## Stop Hooks
21
+
22
+ - **console.log audit**: Check all modified files for `console.log` before session ends
@@ -0,0 +1,52 @@
1
+ ---
2
+ paths:
3
+ - "**/*.ts"
4
+ - "**/*.tsx"
5
+ - "**/*.js"
6
+ - "**/*.jsx"
7
+ ---
8
+ # TypeScript/JavaScript Patterns
9
+
10
+ > This file extends [common/patterns.md](../common/patterns.md) with TypeScript/JavaScript specific content.
11
+
12
+ ## API Response Format
13
+
14
+ ```typescript
15
+ interface ApiResponse<T> {
16
+ success: boolean
17
+ data?: T
18
+ error?: string
19
+ meta?: {
20
+ total: number
21
+ page: number
22
+ limit: number
23
+ }
24
+ }
25
+ ```
26
+
27
+ ## Custom Hooks Pattern
28
+
29
+ ```typescript
30
+ export function useDebounce<T>(value: T, delay: number): T {
31
+ const [debouncedValue, setDebouncedValue] = useState<T>(value)
32
+
33
+ useEffect(() => {
34
+ const handler = setTimeout(() => setDebouncedValue(value), delay)
35
+ return () => clearTimeout(handler)
36
+ }, [value, delay])
37
+
38
+ return debouncedValue
39
+ }
40
+ ```
41
+
42
+ ## Repository Pattern
43
+
44
+ ```typescript
45
+ interface Repository<T> {
46
+ findAll(filters?: Filters): Promise<T[]>
47
+ findById(id: string): Promise<T | null>
48
+ create(data: CreateDto): Promise<T>
49
+ update(id: string, data: UpdateDto): Promise<T>
50
+ delete(id: string): Promise<void>
51
+ }
52
+ ```
@@ -0,0 +1,28 @@
1
+ ---
2
+ paths:
3
+ - "**/*.ts"
4
+ - "**/*.tsx"
5
+ - "**/*.js"
6
+ - "**/*.jsx"
7
+ ---
8
+ # TypeScript/JavaScript Security
9
+
10
+ > This file extends [common/security.md](../common/security.md) with TypeScript/JavaScript specific content.
11
+
12
+ ## Secret Management
13
+
14
+ ```typescript
15
+ // NEVER: Hardcoded secrets
16
+ const apiKey = "sk-proj-xxxxx"
17
+
18
+ // ALWAYS: Environment variables
19
+ const apiKey = process.env.OPENAI_API_KEY
20
+
21
+ if (!apiKey) {
22
+ throw new Error('OPENAI_API_KEY not configured')
23
+ }
24
+ ```
25
+
26
+ ## Agent Support
27
+
28
+ - Use **security-reviewer** skill for comprehensive security audits
@@ -0,0 +1,18 @@
1
+ ---
2
+ paths:
3
+ - "**/*.ts"
4
+ - "**/*.tsx"
5
+ - "**/*.js"
6
+ - "**/*.jsx"
7
+ ---
8
+ # TypeScript/JavaScript Testing
9
+
10
+ > This file extends [common/testing.md](../common/testing.md) with TypeScript/JavaScript specific content.
11
+
12
+ ## E2E Testing
13
+
14
+ Use **Playwright** as the E2E testing framework for critical user flows.
15
+
16
+ ## Agent Support
17
+
18
+ - **e2e-runner** - Playwright E2E testing specialist
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { isHookEnabled } = require('../lib/hook-flags');
5
+
6
+ const [, , hookId, profilesCsv] = process.argv;
7
+ if (!hookId) {
8
+ process.stdout.write('yes');
9
+ process.exit(0);
10
+ }
11
+
12
+ process.stdout.write(isHookEnabled(hookId, { profiles: profilesCsv }) ? 'yes' : 'no');
@@ -0,0 +1,100 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Continuous Learning - Session Evaluator
4
+ *
5
+ * Cross-platform (Windows, macOS, Linux)
6
+ *
7
+ * Runs on Stop hook to extract reusable patterns from Claude Code sessions.
8
+ * Reads transcript_path from stdin JSON (Claude Code hook input).
9
+ *
10
+ * Why Stop hook instead of UserPromptSubmit:
11
+ * - Stop runs once at session end (lightweight)
12
+ * - UserPromptSubmit runs every message (heavy, adds latency)
13
+ */
14
+
15
+ const path = require('path');
16
+ const fs = require('fs');
17
+ const {
18
+ getLearnedSkillsDir,
19
+ ensureDir,
20
+ readFile,
21
+ countInFile,
22
+ log
23
+ } = require('../lib/utils');
24
+
25
+ // Read hook input from stdin (Claude Code provides transcript_path via stdin JSON)
26
+ const MAX_STDIN = 1024 * 1024;
27
+ let stdinData = '';
28
+ process.stdin.setEncoding('utf8');
29
+
30
+ process.stdin.on('data', chunk => {
31
+ if (stdinData.length < MAX_STDIN) {
32
+ const remaining = MAX_STDIN - stdinData.length;
33
+ stdinData += chunk.substring(0, remaining);
34
+ }
35
+ });
36
+
37
+ process.stdin.on('end', () => {
38
+ main().catch(err => {
39
+ console.error('[ContinuousLearning] Error:', err.message);
40
+ process.exit(0);
41
+ });
42
+ });
43
+
44
+ async function main() {
45
+ // Parse stdin JSON to get transcript_path
46
+ let transcriptPath = null;
47
+ try {
48
+ const input = JSON.parse(stdinData);
49
+ transcriptPath = input.transcript_path;
50
+ } catch {
51
+ // Fallback: try env var for backwards compatibility
52
+ transcriptPath = process.env.CLAUDE_TRANSCRIPT_PATH;
53
+ }
54
+
55
+ // Get script directory to find config
56
+ const scriptDir = __dirname;
57
+ const configFile = path.join(scriptDir, '..', '..', 'skills', 'continuous-learning', 'config.json');
58
+
59
+ // Default configuration
60
+ let minSessionLength = 10;
61
+ let learnedSkillsPath = getLearnedSkillsDir();
62
+
63
+ // Load config if exists
64
+ const configContent = readFile(configFile);
65
+ if (configContent) {
66
+ try {
67
+ const config = JSON.parse(configContent);
68
+ minSessionLength = config.min_session_length ?? 10;
69
+
70
+ if (config.learned_skills_path) {
71
+ // Handle ~ in path
72
+ learnedSkillsPath = config.learned_skills_path.replace(/^~/, require('os').homedir());
73
+ }
74
+ } catch (err) {
75
+ log(`[ContinuousLearning] Failed to parse config: ${err.message}, using defaults`);
76
+ }
77
+ }
78
+
79
+ // Ensure learned skills directory exists
80
+ ensureDir(learnedSkillsPath);
81
+
82
+ if (!transcriptPath || !fs.existsSync(transcriptPath)) {
83
+ process.exit(0);
84
+ }
85
+
86
+ // Count user messages in session (allow optional whitespace around colon)
87
+ const messageCount = countInFile(transcriptPath, /"type"\s*:\s*"user"/g);
88
+
89
+ // Skip short sessions
90
+ if (messageCount < minSessionLength) {
91
+ log(`[ContinuousLearning] Session too short (${messageCount} messages), skipping`);
92
+ process.exit(0);
93
+ }
94
+
95
+ // Signal to Claude that session should be evaluated for extractable patterns
96
+ log(`[ContinuousLearning] Session has ${messageCount} messages - evaluate for extractable patterns`);
97
+ log(`[ContinuousLearning] Save learned skills to: ${learnedSkillsPath}`);
98
+
99
+ process.exit(0);
100
+ }