cadre-ai 3.2.0 → 3.4.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 (63) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +127 -0
  4. package/README.md +20 -22
  5. package/dist/cadre-cli.mjs +2 -2
  6. package/dist/cadre-mcp.mjs +1510 -652
  7. package/package.json +1 -1
  8. package/skills/archive/SKILL.md +6 -6
  9. package/skills/create/SKILL.md +5 -4
  10. package/skills/implement/SKILL.md +34 -83
  11. package/skills/implement/references/conflict-handling.md +5 -0
  12. package/skills/implement/references/governed-mode.md +7 -0
  13. package/skills/implement/references/parallel-workers.md +9 -0
  14. package/skills/implement/references/resume-recovery.md +10 -0
  15. package/skills/refresh/SKILL.md +4 -4
  16. package/skills/revert/SKILL.md +6 -6
  17. package/skills/review/SKILL.md +7 -7
  18. package/skills/revise/SKILL.md +6 -6
  19. package/skills/status/SKILL.md +1 -1
  20. package/skills/track/SKILL.md +5 -5
  21. package/templates/v2/init/archive/.gitkeep +1 -0
  22. package/templates/v2/init/gitignore.template +8 -0
  23. package/templates/v2/init/guidelines.md +25 -0
  24. package/templates/v2/init/operations/.gitkeep +1 -0
  25. package/templates/v2/init/patterns/index.md +6 -0
  26. package/templates/v2/init/product.md +30 -0
  27. package/templates/v2/init/project.json +27 -0
  28. package/templates/v2/init/refreshes/.gitkeep +1 -0
  29. package/templates/v2/init/styleguides/general.md +14 -0
  30. package/templates/v2/init/styleguides/language.md +21 -0
  31. package/templates/v2/init/tech-stack.md +21 -0
  32. package/templates/v2/init/tracks/.gitkeep +1 -0
  33. package/templates/v2/init/tracks.md +6 -0
  34. package/templates/v2/init/wisps/.gitkeep +1 -0
  35. package/templates/v2/init/workflow.md +72 -0
  36. package/templates/v2/project/archive-operation.json +19 -0
  37. package/templates/v2/project/pattern.md +20 -0
  38. package/templates/v2/project/refresh-operation.json +18 -0
  39. package/templates/v2/project/refresh.md +21 -0
  40. package/templates/v2/styleguides/dart.md +27 -0
  41. package/templates/v2/styleguides/flutter.md +27 -0
  42. package/templates/v2/styleguides/go.md +29 -0
  43. package/templates/v2/styleguides/gradle.md +28 -0
  44. package/templates/v2/styleguides/html-css.md +39 -0
  45. package/templates/v2/styleguides/index.md +27 -0
  46. package/templates/v2/styleguides/java.md +27 -0
  47. package/templates/v2/styleguides/javascript.md +27 -0
  48. package/templates/v2/styleguides/kotlin.md +26 -0
  49. package/templates/v2/styleguides/maven.md +28 -0
  50. package/templates/v2/styleguides/python.md +27 -0
  51. package/templates/v2/styleguides/react.md +28 -0
  52. package/templates/v2/styleguides/swift.md +27 -0
  53. package/templates/v2/styleguides/swiftui.md +27 -0
  54. package/templates/v2/styleguides/typescript.md +26 -0
  55. package/templates/v2/track/bug.md +14 -0
  56. package/templates/v2/track/execution.json +19 -0
  57. package/templates/v2/track/learning.md +39 -0
  58. package/templates/v2/track/plan.md +39 -0
  59. package/templates/v2/track/revert-operation.json +17 -0
  60. package/templates/v2/track/revise-operation.json +18 -0
  61. package/templates/v2/track/revision.md +36 -0
  62. package/templates/v2/track/spec.md +38 -0
  63. package/templates/v2/track/state.json +31 -0
@@ -0,0 +1,28 @@
1
+ # React Styleguide
2
+
3
+ Apply `general.md` plus `javascript.md` or `typescript.md` first.
4
+
5
+ ## React defaults
6
+
7
+ - Write components and Hooks as pure functions: the same inputs produce the same render output.
8
+ - Treat props, state, context, and Hook arguments/return values as immutable snapshots.
9
+ - Call Hooks only at the top level of React components or custom Hooks; never conditionally or in ordinary functions.
10
+ - Use Effects only to synchronize with external systems. Derive render data during render instead of mirroring it into state.
11
+ - Keep state as local as practical and maintain one source of truth; lift it only to the closest common owner.
12
+ - Prefer composition and focused components over inheritance or large configurable components.
13
+ - Give list items stable domain keys, not array indexes when order/identity can change.
14
+ - Keep event-driven work in event handlers and render-driven synchronization in Effects; include complete dependencies.
15
+ - Make loading, empty, error, and success states explicit.
16
+ - Use semantic HTML, accessible names, keyboard behavior, and focus management.
17
+
18
+ ## Verification
19
+
20
+ - Enable the official React Hooks lint rules and the repository's formatter/linter.
21
+ - Test behavior through user-visible interactions; cover state transitions, errors, accessibility, and cleanup.
22
+ - Profile before adding memoization; treat `useMemo`/`useCallback` as optimizations, not correctness tools.
23
+
24
+ ## Sources
25
+
26
+ - [Rules of React](https://react.dev/reference/rules)
27
+ - [Keeping Components Pure](https://react.dev/learn/keeping-components-pure)
28
+ - [React documentation](https://react.dev/learn)
@@ -0,0 +1,27 @@
1
+ # Swift Styleguide
2
+
3
+ Apply `general.md` first. Preserve the repository's approved formatter and compiler-warning policy.
4
+
5
+ ## Idiomatic defaults
6
+
7
+ - Optimize names and APIs for clarity at the call site; clarity is more important than brevity.
8
+ - Use `UpperCamelCase` for types/protocols and `lowerCamelCase` for other declarations.
9
+ - Prefer `let` and value types for data with value semantics; use reference types when identity/lifecycle is intentional.
10
+ - Model domain states with enums and associated values; make switches exhaustive.
11
+ - Use optionals to represent absence, unwrap with `if let`/`guard let`, and avoid force unwraps except proven invariants.
12
+ - Prefer typed throws/results and actionable error context; do not discard errors with `try?` unless absence is the intended contract.
13
+ - Keep access control as narrow as possible and document public APIs with Swift Markdown/DocC comments.
14
+ - Use protocol abstractions for real substitutability/test seams, not automatically for every concrete type.
15
+ - Use structured concurrency (`async`/`await`, task groups, actors) and make actor isolation, cancellation, and `Sendable` boundaries explicit.
16
+ - Avoid shared mutable global state and detached tasks without clear ownership.
17
+
18
+ ## Verification
19
+
20
+ - Run the approved formatter/linter, build with warnings policy, and Swift Testing/XCTest suites.
21
+ - Test error paths, optionals, concurrency cancellation/isolation, public APIs, and supported Apple/Linux targets as applicable.
22
+
23
+ ## Sources
24
+
25
+ - [Swift API Design Guidelines](https://www.swift.org/documentation/api-design-guidelines/)
26
+ - [The Swift Programming Language](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/)
27
+ - [Swift documentation](https://www.swift.org/documentation/)
@@ -0,0 +1,27 @@
1
+ # SwiftUI Styleguide
2
+
3
+ Apply `general.md` and `swift.md` first.
4
+
5
+ ## SwiftUI defaults
6
+
7
+ - Keep `body` declarative, deterministic, and free of side effects.
8
+ - Compose small views around cohesive UI responsibilities; extract subviews when it clarifies data flow or identity.
9
+ - Maintain one source of truth for each value. Use local `@State` for view-owned transient state and `@Binding` for borrowed mutable state.
10
+ - Use Observation/observable models for reference model state and inject shared dependencies through explicit initializers or the environment as approved.
11
+ - Do not copy derived/model data into local state. Derive presentation values from source state.
12
+ - Trigger asynchronous lifecycle work with `.task` and respect cancellation; trigger user work from actions.
13
+ - Keep domain/business logic outside views and model transitions explicitly.
14
+ - Use stable identity in `ForEach` and navigation; do not use indexes when domain identity can change.
15
+ - Prefer semantic controls and modifiers over gesture-only replicas; support accessibility labels, Dynamic Type, focus, and platform conventions.
16
+ - Keep previews/examples deterministic and provide representative states when the project uses previews.
17
+
18
+ ## Verification
19
+
20
+ - Test model/view-model behavior independently and cover critical UI flows with the approved UI-testing strategy.
21
+ - Verify state restoration, navigation, task cancellation, accessibility, localization, Dynamic Type, and relevant device/platform layouts.
22
+
23
+ ## Sources
24
+
25
+ - [SwiftUI documentation](https://developer.apple.com/documentation/swiftui)
26
+ - [SwiftUI model data](https://developer.apple.com/documentation/swiftui/model-data)
27
+ - [SwiftUI apps overview](https://developer.apple.com/documentation/technologyoverviews/swiftui)
@@ -0,0 +1,26 @@
1
+ # TypeScript Styleguide
2
+
3
+ Apply `general.md` and `javascript.md` first. Preserve approved compiler/linter settings; enable strictness for greenfield code.
4
+
5
+ ## Idiomatic defaults
6
+
7
+ - Enable `strict` and the strongest practical project checks; do not weaken global settings to bypass a local issue.
8
+ - Use primitive types (`string`, `number`, `boolean`) rather than boxed types.
9
+ - Prefer `unknown` over `any`; narrow values through validation, type guards, or schema parsing.
10
+ - Model alternatives with discriminated unions and make switches exhaustive with `never` checks where useful.
11
+ - Prefer inference for obvious local values and explicit types for public boundaries, serialized data, and complex returns.
12
+ - Keep type assertions rare and local; never use assertion chains to silence an unresolved mismatch.
13
+ - Avoid non-null assertions unless an invariant is proven and documented.
14
+ - Use generics only when the type parameter expresses a real relationship.
15
+ - Keep runtime validation distinct from compile-time typing at network, storage, environment, and user-input boundaries.
16
+ - Use `satisfies` when validating a value's shape while retaining useful inference.
17
+
18
+ ## Verification
19
+
20
+ - Run the formatter, ESLint/type-aware lint rules, `tsc --noEmit`, tests, and the production build.
21
+ - Add compile-time tests for public generic/type utilities when their behavior is non-trivial.
22
+
23
+ ## Sources
24
+
25
+ - [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/intro.html)
26
+ - [TypeScript Do's and Don'ts](https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html)
@@ -0,0 +1,14 @@
1
+ # Review Bugs: {{TRACK_ID}} @ {{REVIEW_TS}}
2
+
3
+ - Review cycle: {{CYCLE}}
4
+ - Status: approved
5
+ - Reviewed commit range: `{{COMMIT_RANGE}}`
6
+
7
+ ## BUG-001: {{TITLE}}
8
+
9
+ - Severity: {{SEVERITY}}
10
+ - Evidence: {{FILE_LINE_OR_TEST}}
11
+ - Impact: {{IMPACT}}
12
+ - Reproduction: {{REPRODUCTION}}
13
+ - Approved remediation acceptance criteria: {{CRITERIA}}
14
+ - Human approval: {{APPROVAL_RECORD}}
@@ -0,0 +1,19 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "executionId": "{{EXECUTION_ID}}",
4
+ "trackId": "{{TRACK_ID}}",
5
+ "status": "in_progress",
6
+ "checkpoint": "approved",
7
+ "requestedMode": "{{parallel|sequential}}",
8
+ "effectiveMode": "{{parallel|sequential}}",
9
+ "approvalMode": "{{governed|phase|autonomous}}",
10
+ "maxWorkers": 3,
11
+ "planRevision": 1,
12
+ "planCommit": "{{PLAN_COMMIT}}",
13
+ "graphDigest": "{{GRAPH_DIGEST}}",
14
+ "baseCommit": "{{BASE_COMMIT}}",
15
+ "startedAt": "{{APPROVED_AT}}",
16
+ "completedAt": null,
17
+ "headCommit": null,
18
+ "nodes": {}
19
+ }
@@ -0,0 +1,39 @@
1
+ # Incremental Learning: {{TRACK_TITLE}}
2
+
3
+ Never overwrite an earlier phase. Each phase begins by reading the learning of every declared dependency phase. A root phase reads the marked Pattern Seed section below. Parallel sibling phases do not assume or consume each other's learning.
4
+
5
+ <!-- cadre:pattern-seed:start -->
6
+ ## Pattern Seed
7
+
8
+ - Spec revision: 1
9
+ - Plan revision: 1
10
+
11
+ | Pattern | Relevance to this track | Constraints to carry forward |
12
+ | --- | --- | --- |
13
+ | `{{PATTERN_PATH}}` | {{RELEVANCE}} | {{CONSTRAINTS}} |
14
+
15
+ If no existing pattern is relevant, state that explicitly rather than inventing guidance.
16
+ <!-- cadre:pattern-seed:end -->
17
+
18
+ ## Phase 1: {{PHASE_NAME}}
19
+
20
+ ### Inputs read
21
+
22
+ {{FILES_PATTERNS_DEPENDENCY_PHASE_LEARNING}}
23
+
24
+ ### Task observations
25
+
26
+ {{OBSERVATIONS_WITH_TASK_AND_COMMIT}}
27
+
28
+ ### Decisions and corrections
29
+
30
+ {{DECISIONS_AND_CORRECTIONS}}
31
+
32
+ ### Reusable pattern candidates
33
+
34
+ {{CANDIDATES_OR_NONE}}
35
+
36
+ ### Phase completion
37
+
38
+ - Commit: {{PHASE_COMPLETION_COMMIT}}
39
+ - Human verification: {{APPROVAL_RECORD}}
@@ -0,0 +1,39 @@
1
+ # Plan: {{TRACK_TITLE}}
2
+
3
+ - Track: `{{TRACK_ID}}`
4
+ - Spec revision: 1
5
+ - Plan revision: 1
6
+ - Status: proposed
7
+
8
+ ## Phase 1: {{DELIVERY_PHASE_NAME}}
9
+
10
+ - Phase dependencies: none
11
+
12
+ ### Outcome
13
+
14
+ {{PHASE_OUTCOME}}
15
+
16
+ - [ ] T1.1 {{IMPLEMENTATION_OR_VERIFICATION_TASK}}
17
+ - Task dependencies: none
18
+ - [ ] T1.2 User Manual Verification
19
+
20
+ - Phase completion commit: pending
21
+
22
+ ## Phase 2: Track-level User Manual Verification
23
+
24
+ ### Outcome
25
+
26
+ The human verifies the complete track against the approved specification and acceptance criteria.
27
+
28
+ - [ ] T2.1 User Manual Verification
29
+
30
+ - Phase completion commit: pending
31
+
32
+ ## Approval
33
+
34
+ {{APPROVAL_RECORD}}
35
+
36
+ <!-- Regular phases declare dependencies explicitly. Regular tasks declare same-phase dependencies explicitly. -->
37
+ <!-- Phase User Manual Verification implicitly depends on every sibling task. -->
38
+ <!-- Track-level User Manual Verification implicitly depends on every preceding phase. -->
39
+ <!-- For a completed task, append a commit marker containing the full hexadecimal SHA. -->
@@ -0,0 +1,17 @@
1
+ {
2
+ "action": "revert",
3
+ "checkpoint": "approved",
4
+ "baseCommit": "{{BASE_COMMIT}}",
5
+ "expectedCommit": "cadre(revert): reconcile {{TRACK_ID}}",
6
+ "approvedArtifacts": ["plan.md", "learning.md", "state.json"],
7
+ "approvalDigest": "{{APPROVAL_DIGEST}}",
8
+ "approvedArtifactHashes": [
9
+ { "path": "{{APPROVED_ARTIFACT}}", "sha256": "{{ARTIFACT_SHA256}}" }
10
+ ],
11
+ "artifactProgress": [],
12
+ "approvedAt": "{{APPROVED_AT}}",
13
+ "targetKind": "{{task|phase|track}}",
14
+ "targetId": "{{TARGET_ID}}",
15
+ "commits": ["{{COMMIT_SHA}}"],
16
+ "revertCommits": []
17
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "action": "revise",
3
+ "checkpoint": "approved",
4
+ "baseCommit": "{{BASE_COMMIT}}",
5
+ "expectedCommit": "cadre(revise): update {{TRACK_ID}}",
6
+ "approvedArtifacts": ["{{REVISION_PATH}}"],
7
+ "approvalDigest": "{{APPROVAL_DIGEST}}",
8
+ "approvedArtifactHashes": [
9
+ { "path": "{{APPROVED_ARTIFACT}}", "sha256": "{{ARTIFACT_SHA256}}" }
10
+ ],
11
+ "artifactProgress": [],
12
+ "approvedAt": "{{APPROVED_AT}}",
13
+ "sourceStatus": "{{SOURCE_STATUS}}",
14
+ "targetStatus": "{{TARGET_STATUS}}",
15
+ "revisionPath": "{{REVISION_PATH}}",
16
+ "previousRevision": 1,
17
+ "newRevision": 2
18
+ }
@@ -0,0 +1,36 @@
1
+ # Revision {{REVISION_TS}}: {{TRACK_ID}}
2
+
3
+ - Source status: {{SOURCE_STATUS}}
4
+ - Target status: {{TARGET_STATUS}}
5
+ - Base commit: {{BASE_COMMIT}}
6
+ - Previous track revision: {{OLD_TRACK_REVISION}}
7
+ - New track revision: {{NEW_TRACK_REVISION}}
8
+ - Previous spec revision: {{OLD_SPEC_REVISION}}
9
+ - New spec revision: {{NEW_SPEC_REVISION}}
10
+ - Previous plan revision: {{OLD_PLAN_REVISION}}
11
+ - New plan revision: {{NEW_PLAN_REVISION}}
12
+ - Revision commit: pending
13
+
14
+ ## Requested change
15
+
16
+ {{REQUEST}}
17
+
18
+ ## Proposed artifact changes
19
+
20
+ {{DIFF_SUMMARY}}
21
+
22
+ ## Affected work and provenance
23
+
24
+ {{AFFECTED_PHASES_TASKS_AND_COMMIT_DISPOSITION}}
25
+
26
+ ## Review and verification impact
27
+
28
+ {{REVIEW_READINESS_AND_MANUAL_VERIFICATION_IMPACT}}
29
+
30
+ ## Cascading dependency impact
31
+
32
+ {{TRANSITIVE_IMPACT}}
33
+
34
+ ## Approval
35
+
36
+ {{APPROVAL_RECORD}}
@@ -0,0 +1,38 @@
1
+ # Specification: {{TRACK_TITLE}}
2
+
3
+ - Track: `{{TRACK_ID}}`
4
+ - Type: `{{feature|bug}}`
5
+ - Revision: 1
6
+ - Status: proposed
7
+
8
+ ## Goal and scope
9
+
10
+ {{GOAL_SCOPE}}
11
+
12
+ ## Functional Requirements
13
+
14
+ - FR-001: {{REQUIREMENT}}
15
+
16
+ ## Non-Functional Requirements
17
+
18
+ - NFR-001: {{REQUIREMENT_AND_MEASURE}}
19
+
20
+ ## Acceptance Criteria
21
+
22
+ - AC-001: {{OBSERVABLE_ACCEPTANCE_CRITERION}}
23
+
24
+ ## Dependencies
25
+
26
+ {{TRACK_DEPENDENCIES_OR_NONE}}
27
+
28
+ ## Additional Information
29
+
30
+ {{CONSTRAINTS_RISKS_ASSUMPTIONS_REFERENCES}}
31
+
32
+ ## Dependent-track impact
33
+
34
+ {{KNOWN_OR_POTENTIAL_IMPACT}}
35
+
36
+ ## Approval
37
+
38
+ {{APPROVAL_RECORD}}
@@ -0,0 +1,31 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "trackId": "{{TRACK_ID}}",
4
+ "title": "{{TRACK_TITLE}}",
5
+ "type": "{{feature|bug}}",
6
+ "status": "drafting-plan",
7
+ "checkpoint": "spec-approved",
8
+ "revision": 1,
9
+ "dependencies": [],
10
+ "commits": {
11
+ "spec": null,
12
+ "plan": null
13
+ },
14
+ "artifactProgress": [],
15
+ "operation": {
16
+ "action": "specify",
17
+ "baseCommit": "{{BASE_COMMIT_OR_NULL}}",
18
+ "expectedCommit": "cadre(track): specify {{TRACK_ID}}",
19
+ "approvedArtifacts": ["spec.md", "plan.md", "learning.md"],
20
+ "approvalDigest": "{{APPROVAL_DIGEST}}",
21
+ "approvedArtifactHashes": [
22
+ { "path": "spec.md", "sha256": "{{SPEC_SHA256}}" },
23
+ { "path": "plan.md", "sha256": "{{PLAN_SHA256}}" },
24
+ { "path": "learning.md", "sha256": "{{LEARNING_SHA256}}" }
25
+ ],
26
+ "approvedAt": "{{APPROVED_AT}}"
27
+ },
28
+ "lastExecution": null,
29
+ "reviewCycles": [],
30
+ "history": []
31
+ }