@punks/cli 2.6.1 → 3.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 (105) hide show
  1. package/AGENTS.md +1 -1
  2. package/README.md +44 -24
  3. package/dist/BASELINE_CHANGELOG.md +57 -0
  4. package/dist/CHANGELOG.md +83 -0
  5. package/dist/data/scripts/harness-projection/adapters/claude.d.mts +3 -0
  6. package/dist/data/scripts/harness-projection/adapters/claude.mjs +124 -0
  7. package/dist/data/scripts/harness-projection/adapters/codex.d.mts +3 -0
  8. package/dist/data/scripts/harness-projection/adapters/codex.mjs +137 -0
  9. package/dist/data/scripts/harness-projection/adapters/cursor.d.mts +5 -0
  10. package/dist/data/scripts/harness-projection/adapters/cursor.mjs +106 -0
  11. package/dist/data/scripts/harness-projection/adapters/opencode.d.mts +5 -0
  12. package/dist/data/scripts/harness-projection/adapters/opencode.mjs +100 -0
  13. package/dist/data/scripts/harness-projection/apply.d.mts +12 -0
  14. package/dist/data/scripts/harness-projection/apply.mjs +96 -0
  15. package/dist/data/scripts/harness-projection/core.d.mts +8 -0
  16. package/dist/data/scripts/harness-projection/core.mjs +239 -0
  17. package/dist/data/scripts/harness-projection/test-fixtures/application-context-plan.json +27 -0
  18. package/dist/data/scripts/harness-projection/test-fixtures/claude/actions.json +109 -0
  19. package/dist/data/scripts/harness-projection/test-fixtures/claude/context-plan.json +150 -0
  20. package/dist/data/scripts/harness-projection/test-fixtures/claude/matrix.json +23 -0
  21. package/dist/data/scripts/harness-projection/test-fixtures/claude/traces.json +15 -0
  22. package/dist/data/scripts/harness-projection/test-fixtures/codex/actions.json +124 -0
  23. package/dist/data/scripts/harness-projection/test-fixtures/codex/context-plan.json +150 -0
  24. package/dist/data/scripts/harness-projection/test-fixtures/codex/matrix.json +23 -0
  25. package/dist/data/scripts/harness-projection/test-fixtures/codex/traces.json +15 -0
  26. package/dist/data/scripts/harness-projection/test-fixtures/cursor/compiler-input.json +93 -0
  27. package/dist/data/scripts/harness-projection/test-fixtures/cursor/context-plan.json +108 -0
  28. package/dist/data/scripts/harness-projection/test-fixtures/cursor/matrix.json +19 -0
  29. package/dist/data/scripts/harness-projection/test-fixtures/cursor/projection.json +54 -0
  30. package/dist/data/scripts/harness-projection/test-fixtures/mixed-context-plan.json +35 -0
  31. package/dist/data/scripts/harness-projection/test-fixtures/opencode/compiler-input.json +93 -0
  32. package/dist/data/scripts/harness-projection/test-fixtures/opencode/context-plan.json +108 -0
  33. package/dist/data/scripts/harness-projection/test-fixtures/opencode/matrix.json +19 -0
  34. package/dist/data/scripts/harness-projection/test-fixtures/opencode/projection.json +51 -0
  35. package/dist/data/scripts/sync-subagents.mjs +1113 -33
  36. package/dist/data/subagents/manifest.mjs +5 -6
  37. package/dist/index.js +1373 -62672
  38. package/dist/skills/agnostic/cli/hi-cli/SKILL.md +17 -121
  39. package/dist/skills/agnostic/cli/hi-cli/references/commands.md +32 -47
  40. package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +73 -62
  41. package/dist/skills/agnostic/docs/docs-onboarding/SKILL.md +1 -1
  42. package/dist/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +2 -2
  43. package/dist/skills/agnostic/planning/create-plan/SKILL.md +11 -10
  44. package/dist/skills/agnostic/planning/create-plan/references/grill-ambiguity.md +10 -31
  45. package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +2 -2
  46. package/dist/skills/agnostic/planning/create-spec/SKILL.md +3 -5
  47. package/dist/skills/agnostic/planning/create-spec/assets/SPEC-TEMPLATE.md +1 -0
  48. package/dist/skills/agnostic/planning/create-spec/references/backlog-sync.md +2 -2
  49. package/dist/skills/agnostic/planning/create-spec/references/grill-phase.md +4 -9
  50. package/dist/skills/agnostic/planning/create-spec/references/spec-quality-bar.md +1 -0
  51. package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +1 -1
  52. package/dist/skills/agnostic/requirements/grilling/LICENSE +21 -0
  53. package/dist/skills/agnostic/requirements/grilling/SKILL.md +6 -30
  54. package/dist/skills/agnostic/requirements/grilling/UPSTREAM.md +16 -0
  55. package/dist/skills/agnostic/requirements/requirements-grill/SKILL.md +3 -5
  56. package/dist/skills/agnostic/requirements/requirements-grill/references/artifact-output.md +40 -16
  57. package/dist/skills/agnostic/requirements/requirements-grill/references/grilling-flow.md +3 -16
  58. package/dist/skills/agnostic/requirements/write-backlog/REFERENCE.md +21 -15
  59. package/dist/skills/agnostic/requirements/write-backlog/SKILL.md +14 -14
  60. package/dist/skills/agnostic/requirements/write-backlog/assets/concepts/backlog-model.md +28 -9
  61. package/dist/skills/agnostic/requirements/write-backlog/assets/providers/azure-devops-create-payload.md +45 -5
  62. package/dist/skills/agnostic/requirements/write-backlog/assets/providers/github-projects-create-payload.md +48 -28
  63. package/dist/skills/agnostic/requirements/write-backlog/assets/providers/linear-create-payload.md +22 -6
  64. package/dist/skills/agnostic/requirements/write-backlog/assets/providers/monday-create-payload.md +47 -22
  65. package/dist/skills/frameworks/effect/effect/LICENSE +21 -0
  66. package/dist/skills/frameworks/effect/effect/SKILL.md +100 -0
  67. package/dist/skills/frameworks/effect/effect/UPSTREAM.md +11 -0
  68. package/dist/skills/frameworks/effect/effect/references/CACHING.md +76 -0
  69. package/dist/skills/frameworks/effect/effect/references/CONFIG.md +67 -0
  70. package/dist/skills/frameworks/effect/effect/references/HTTP_CLIENTS.md +101 -0
  71. package/dist/skills/frameworks/effect/{effect-authoring/references/otel-patterns.md → effect/references/OBSERVABILITY.md} +4 -29
  72. package/dist/skills/frameworks/effect/effect/references/SCHEDULING.md +135 -0
  73. package/dist/skills/frameworks/effect/effect/references/SCHEMA.md +130 -0
  74. package/dist/skills/frameworks/effect/effect/references/SERVICES_LAYERS.md +168 -0
  75. package/dist/skills/frameworks/effect/effect/references/STREAMS.md +135 -0
  76. package/dist/skills/frameworks/effect/effect/references/TESTING.md +118 -0
  77. package/dist/skills/frameworks/effect/effect-backend-structure/SKILL.md +7 -8
  78. package/dist/skills/frameworks/effect/effect-recoverable-actions/SKILL.md +1 -1
  79. package/dist/skills/frameworks/nestjs/nestjs-best-practices/.gitignore +29 -0
  80. package/dist/skills/misc/secrets-cli/SKILL.md +54 -0
  81. package/dist/skills/misc/secrets-cli/references/command-reference.md +107 -0
  82. package/dist/skills/misc/secrets-cli/references/safety-and-errors.md +54 -0
  83. package/dist/skills/misc/secrets-cli/references/workflows.md +106 -0
  84. package/dist/skills/phases/design-phase/phases/grill.md +1 -1
  85. package/dist/skills/phases/requirements-phase/SKILL.md +2 -4
  86. package/dist/skills/phases/review-phase/REFERENCE.md +13 -5
  87. package/dist/skills/phases/review-phase/SKILL.md +3 -2
  88. package/package.json +1 -1
  89. package/dist/skills/agnostic/planning/create-spec/references/handoff.md +0 -47
  90. package/dist/skills/frameworks/effect/effect-authoring/SKILL.md +0 -116
  91. package/dist/skills/frameworks/effect/effect-authoring/references/branded-types.md +0 -98
  92. package/dist/skills/frameworks/effect/effect-authoring/references/effect-primitives.md +0 -144
  93. package/dist/skills/frameworks/effect/effect-authoring/references/error-patterns.md +0 -156
  94. package/dist/skills/frameworks/effect/effect-authoring/references/test-patterns.md +0 -146
  95. package/dist/skills/frameworks/effect/effect-best-practices/SKILL.md +0 -517
  96. package/dist/skills/frameworks/effect/effect-best-practices/references/anti-patterns.md +0 -392
  97. package/dist/skills/frameworks/effect/effect-best-practices/references/effect-atom-patterns.md +0 -653
  98. package/dist/skills/frameworks/effect/effect-best-practices/references/error-patterns.md +0 -464
  99. package/dist/skills/frameworks/effect/effect-best-practices/references/language-server.md +0 -287
  100. package/dist/skills/frameworks/effect/effect-best-practices/references/layer-patterns.md +0 -495
  101. package/dist/skills/frameworks/effect/effect-best-practices/references/observability-patterns.md +0 -342
  102. package/dist/skills/frameworks/effect/effect-best-practices/references/rpc-cluster-patterns.md +0 -418
  103. package/dist/skills/frameworks/effect/effect-best-practices/references/schema-patterns.md +0 -353
  104. package/dist/skills/frameworks/effect/effect-best-practices/references/service-patterns.md +0 -299
  105. /package/dist/skills/frameworks/effect/{effect-authoring/references/effect-atom-patterns.md → effect/references/EFFECT_ATOM.md} +0 -0
@@ -1,156 +0,0 @@
1
- # Error Patterns Checklist
2
-
3
- ## 1. Schema.TaggedError With HTTP Annotations
4
-
5
- All errors reaching HTTP boundaries must use `Schema.TaggedError` with `HttpApiSchema.annotations`.
6
-
7
- ```typescript
8
- // GOOD
9
- export class ResourceNotFound extends Schema.TaggedError<ResourceNotFound>()(
10
- "@myorg/api/errors/ResourceNotFound",
11
- {
12
- type: Schema.optionalWith(ErrorType, { default: () => "invalid_request_error" as const }),
13
- code: Schema.optionalWith(ErrorCode, { default: () => "resource_missing" as const }),
14
- message: Schema.optionalWith(Schema.String, {
15
- default: () => "The requested resource was not found.",
16
- }),
17
- param: Schema.String.pipe(Schema.optional),
18
- resource_type: Schema.String.pipe(Schema.optional),
19
- resource_id: Schema.String.pipe(Schema.optional),
20
- },
21
- HttpApiSchema.annotations({ status: 404, title: "Resource Not Found" })
22
- ) {}
23
-
24
- // BAD
25
- class NotFoundError extends Error {
26
- constructor(message: string) { super(message) }
27
- }
28
- ```
29
-
30
- ## 2. Reverse Domain Notation for Tags
31
-
32
- Error tags should use reverse domain notation matching the package structure.
33
-
34
- ```typescript
35
- // GOOD
36
- "@myorg/api/errors/ResourceNotFound"
37
- "@myorg/subscriptions/errors/CheckoutInitiation"
38
-
39
- // BAD
40
- "ResourceNotFound"
41
- "NotFoundError"
42
- ```
43
-
44
- ## 3. Static Factory Methods
45
-
46
- Errors should have convenience constructors for common cases.
47
-
48
- ```typescript
49
- // GOOD
50
- export class ResourceNotFound extends Schema.TaggedError<ResourceNotFound>()(...) {
51
- static fromId(resourceType: string, id: string) {
52
- return new ResourceNotFound({
53
- message: `No such ${resourceType}: '${id}'`,
54
- param: "id",
55
- resource_type: resourceType,
56
- resource_id: id,
57
- })
58
- }
59
- }
60
-
61
- export class BadRequestError extends Schema.TaggedError<BadRequestError>()(...) {
62
- static invalidParam(param: string, message: string) {
63
- return new BadRequestError({ code: "parameter_invalid", message, param })
64
- }
65
- static missingParam(param: string) {
66
- return new BadRequestError({
67
- code: "parameter_missing",
68
- message: `Missing required parameter: ${param}`,
69
- param,
70
- })
71
- }
72
- }
73
- ```
74
-
75
- ## 4. Rich Context Fields
76
-
77
- Errors must include enough context for debugging. Never lose valuable information.
78
-
79
- ```typescript
80
- // GOOD - preserves context
81
- new PaymentProcessingError({
82
- message: `Failed to process payment for subscription ${subscriptionId}`,
83
- subscriptionId,
84
- provider,
85
- cause: originalError,
86
- })
87
-
88
- // BAD - loses info
89
- new PaymentProcessingError({ message: "Payment failed" })
90
- new Error("something went wrong")
91
- ```
92
-
93
- ## 5. catchTag/catchTags Only
94
-
95
- Never use `catchAll` or `mapError`. Always handle specific error tags.
96
-
97
- ```typescript
98
- // GOOD
99
- yield* effect.pipe(
100
- Effect.catchTag("DatabaseError", (e) =>
101
- Effect.fail(ResourceNotFound.fromId("paywall", String(id)))
102
- ),
103
- Effect.catchTag("ValidationError", (e) =>
104
- Effect.fail(BadRequestError.invalidParam("input", e.message))
105
- )
106
- )
107
-
108
- // BAD
109
- yield* effect.pipe(
110
- Effect.catchAll((e) => Effect.fail(new InternalError({ message: String(e) })))
111
- )
112
- yield* effect.pipe(
113
- Effect.mapError((e) => new InternalError({ message: "failed" }))
114
- )
115
- ```
116
-
117
- ## 6. Explicit Error Types
118
-
119
- Error types should be specific to the domain, not generic. The error channel should tell you exactly what went wrong.
120
-
121
- ```typescript
122
- // GOOD
123
- Effect<Paywall, PaywallNotFoundError | PaywallArchived | Unauthorized>
124
-
125
- // BAD
126
- Effect<Paywall, Error>
127
- Effect<Paywall, unknown>
128
- ```
129
-
130
- ## 7. Don't Catch HTTP-Annotated Errors
131
-
132
- Let errors with `HttpApiSchema.annotations` propagate to the HTTP layer for automatic status code mapping. Don't re-wrap them.
133
-
134
- ```typescript
135
- // GOOD - let ResourceNotFound propagate
136
- yield* paywallRepo.findById(id)
137
-
138
- // BAD - catching and re-wrapping
139
- yield* paywallRepo.findById(id).pipe(
140
- Effect.catchTag("ResourceNotFound", () =>
141
- Effect.fail(new GenericError({ message: "not found" }))
142
- )
143
- )
144
- ```
145
-
146
- ## 8. Fire-and-Forget for Non-Critical Operations
147
-
148
- For operations that shouldn't fail the request, use `Effect.tapError` + `Effect.ignore`:
149
-
150
- ```typescript
151
- // GOOD
152
- yield* db.execute(...).pipe(
153
- Effect.tapError((e) => Effect.logWarning("Failed to update", { error: e })),
154
- Effect.ignore
155
- )
156
- ```
@@ -1,146 +0,0 @@
1
- # Test Patterns Checklist
2
-
3
- ## 1. Use @effect/vitest
4
-
5
- Always import from `@effect/vitest`, never plain `vitest`. It re-exports all standard vitest functions.
6
-
7
- ```typescript
8
- // GOOD
9
- import { it, describe, expect } from "@effect/vitest"
10
-
11
- // BAD
12
- import { it, describe, expect } from "vitest"
13
- ```
14
-
15
- ## 2. it.layer() for Test Setup
16
-
17
- Use `it.layer(TestLayer)((it) => { ... })` for providing test dependencies. Never use `beforeAll`/`afterAll` for Effect service setup.
18
-
19
- ```typescript
20
- // GOOD
21
- const TestLayer = Layer.mergeAll(DatabaseTest, ServiceTest)
22
-
23
- it.layer(TestLayer)((it) => {
24
- describe("findById", () => {
25
- it.scoped("returns project when found", () =>
26
- Effect.gen(function* () {
27
- const service = yield* MyService
28
- // ...
29
- })
30
- )
31
- })
32
- })
33
-
34
- // BAD
35
- let service: MyService
36
- beforeAll(async () => {
37
- service = await setupService()
38
- })
39
- afterAll(async () => {
40
- await teardown()
41
- })
42
- ```
43
-
44
- ## 3. it.scoped for Individual Tests
45
-
46
- Inside an `it.layer()` block, use `it.scoped` for tests that need automatic resource cleanup.
47
-
48
- ```typescript
49
- // GOOD
50
- it.scoped("creates and cleans up", () =>
51
- Effect.gen(function* () {
52
- const org = yield* createTestOrganization()
53
- // org cleanup happens automatically via scope
54
- })
55
- )
56
- ```
57
-
58
- ## 4. Effect.either for Error Testing
59
-
60
- Use `Effect.either` + `Either.isLeft()` to test error cases. Never use try/catch or `.catch()`.
61
-
62
- ```typescript
63
- // GOOD
64
- it.scoped("fails for invalid id", () =>
65
- Effect.gen(function* () {
66
- const result = yield* service.findById(invalidId).pipe(Effect.either)
67
- expect(Either.isLeft(result)).toBe(true)
68
- if (Either.isLeft(result)) {
69
- expect(result.left._tag).toBe("ResourceNotFound")
70
- }
71
- })
72
- )
73
-
74
- // BAD
75
- it("fails for invalid id", async () => {
76
- try {
77
- await service.findById(invalidId)
78
- fail("should have thrown")
79
- } catch (e) {
80
- expect(e).toBeInstanceOf(NotFoundError)
81
- }
82
- })
83
- ```
84
-
85
- ## 5. Factory Functions for Test Data
86
-
87
- Use factory functions from `test/testFactories.ts` or local helpers. Don't inline large object literals.
88
-
89
- ```typescript
90
- // GOOD
91
- const org = yield* createTestOrganization()
92
- const app = yield* createTestApplication(org.id)
93
- const paywall = yield* createTestPaywall(app.id)
94
-
95
- // BAD
96
- const org = { id: 1, name: "test", createdAt: new Date(), ... }
97
- ```
98
-
99
- ## 6. it.scoped.each for Parameterized Tests
100
-
101
- Use `.each` for testing multiple cases with the same logic.
102
-
103
- ```typescript
104
- // GOOD
105
- it.scoped.each([
106
- { platform: "ios", expected: "IOS" },
107
- { platform: "android", expected: "ANDROID" },
108
- ])("maps $platform correctly", ({ platform, expected }) =>
109
- Effect.gen(function* () {
110
- const result = yield* mapPlatform(platform)
111
- expect(result).toBe(expected)
112
- })
113
- )
114
- ```
115
-
116
- ## 7. Test Layer Composition
117
-
118
- Use `DefaultWithoutDependencies` or `.Default.pipe(Layer.provide(...))` for test layers. Replace dependencies by providing alternate layers, not by mocking imports.
119
-
120
- ```typescript
121
- // GOOD
122
- const TestLayer = MyService.Default.pipe(
123
- Layer.provide(MockRepository.Test),
124
- Layer.provide(DatabaseTest)
125
- )
126
-
127
- // Also GOOD
128
- const TestLayer = Layer.mergeAll(
129
- MyService.Default,
130
- MockRepository.Test
131
- ).pipe(Layer.provide(DatabaseTest))
132
- ```
133
-
134
- ```typescript
135
- // BAD
136
- vi.mock("../repositories/user", () => ({ findById: vi.fn() }))
137
- ```
138
-
139
- ## 8. Coverage Assessment
140
-
141
- When reviewing, check:
142
- - New service methods have corresponding test cases
143
- - Error paths are tested (not just happy path)
144
- - Edge cases are covered (empty arrays, null values, boundary conditions)
145
- - New error types are tested with `Effect.either` pattern
146
- - Both success and failure scenarios for each public method