cadre-ai 3.7.1 → 3.9.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 (110) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +66 -1
  4. package/README.md +42 -6
  5. package/agents/cadre-phase-worker.md +5 -1
  6. package/agents/cadre-task-worker.md +5 -1
  7. package/dist/cadre-cli.mjs +6 -3
  8. package/dist/cadre-mcp.mjs +3192 -2079
  9. package/package.json +1 -1
  10. package/skills/archive/SKILL.md +18 -4
  11. package/skills/create/SKILL.md +15 -3
  12. package/skills/implement/SKILL.md +39 -13
  13. package/skills/implement/agents/openai.yaml +1 -1
  14. package/skills/implement/references/conflict-handling.md +1 -1
  15. package/skills/implement/references/parallel-workers.md +4 -0
  16. package/skills/implement/references/resume-recovery.md +6 -0
  17. package/skills/refresh/SKILL.md +28 -5
  18. package/skills/revert/SKILL.md +20 -2
  19. package/skills/review/SKILL.md +87 -11
  20. package/skills/revise/SKILL.md +18 -5
  21. package/skills/status/SKILL.md +4 -0
  22. package/skills/track/SKILL.md +19 -9
  23. package/skills/wisp/SKILL.md +4 -0
  24. package/templates/v4/init/archive/.gitkeep +1 -0
  25. package/templates/v4/init/gitignore.template +8 -0
  26. package/templates/v4/init/guidelines.md +25 -0
  27. package/templates/v4/init/operations/.gitkeep +1 -0
  28. package/templates/v4/init/patterns/index.md +8 -0
  29. package/templates/v4/init/product.md +30 -0
  30. package/templates/v4/init/project.json +27 -0
  31. package/templates/v4/init/refreshes/.gitkeep +1 -0
  32. package/templates/v4/init/styleguides/general.md +14 -0
  33. package/templates/v4/init/styleguides/language.md +21 -0
  34. package/templates/v4/init/tech-stack.md +21 -0
  35. package/templates/v4/init/tracks/.gitkeep +1 -0
  36. package/templates/v4/init/tracks.md +6 -0
  37. package/templates/v4/init/wisps/.gitkeep +1 -0
  38. package/templates/v4/init/workflow.md +91 -0
  39. package/templates/v4/project/archive-operation.json +19 -0
  40. package/templates/v4/project/pattern.md +20 -0
  41. package/templates/v4/project/refresh-operation.json +18 -0
  42. package/templates/v4/project/refresh.md +21 -0
  43. package/templates/v4/styleguides/dart.md +27 -0
  44. package/templates/v4/styleguides/flutter.md +27 -0
  45. package/templates/v4/styleguides/go.md +29 -0
  46. package/templates/v4/styleguides/gradle.md +28 -0
  47. package/templates/v4/styleguides/html-css.md +39 -0
  48. package/templates/v4/styleguides/index.md +27 -0
  49. package/templates/v4/styleguides/java.md +27 -0
  50. package/templates/v4/styleguides/javascript.md +27 -0
  51. package/templates/v4/styleguides/kotlin.md +26 -0
  52. package/templates/v4/styleguides/maven.md +28 -0
  53. package/templates/v4/styleguides/python.md +27 -0
  54. package/templates/v4/styleguides/react.md +28 -0
  55. package/templates/v4/styleguides/swift.md +27 -0
  56. package/templates/v4/styleguides/swiftui.md +27 -0
  57. package/templates/v4/styleguides/typescript.md +26 -0
  58. package/templates/v4/track/bug.md +14 -0
  59. package/templates/v4/track/execution.json +20 -0
  60. package/templates/v4/track/learning.md +45 -0
  61. package/templates/v4/track/plan.md +39 -0
  62. package/templates/v4/track/revert-operation.json +17 -0
  63. package/templates/v4/track/revise-operation.json +18 -0
  64. package/templates/v4/track/revision.md +36 -0
  65. package/templates/v4/track/spec.md +38 -0
  66. package/templates/v4/track/state.json +31 -0
  67. package/templates/v5/init/archive/.gitkeep +1 -0
  68. package/templates/v5/init/gitignore.template +9 -0
  69. package/templates/v5/init/guidelines.md +25 -0
  70. package/templates/v5/init/operations/.gitkeep +1 -0
  71. package/templates/v5/init/patterns/index.md +8 -0
  72. package/templates/v5/init/product.md +30 -0
  73. package/templates/v5/init/project.json +27 -0
  74. package/templates/v5/init/refreshes/.gitkeep +1 -0
  75. package/templates/v5/init/styleguides/general.md +14 -0
  76. package/templates/v5/init/styleguides/language.md +21 -0
  77. package/templates/v5/init/tech-stack.md +21 -0
  78. package/templates/v5/init/tracks/.gitkeep +1 -0
  79. package/templates/v5/init/tracks.md +6 -0
  80. package/templates/v5/init/wisps/.gitkeep +1 -0
  81. package/templates/v5/init/workflow.md +103 -0
  82. package/templates/v5/project/archive-operation.json +19 -0
  83. package/templates/v5/project/pattern.md +20 -0
  84. package/templates/v5/project/refresh-operation.json +18 -0
  85. package/templates/v5/project/refresh.md +21 -0
  86. package/templates/v5/styleguides/dart.md +27 -0
  87. package/templates/v5/styleguides/flutter.md +27 -0
  88. package/templates/v5/styleguides/go.md +29 -0
  89. package/templates/v5/styleguides/gradle.md +28 -0
  90. package/templates/v5/styleguides/html-css.md +39 -0
  91. package/templates/v5/styleguides/index.md +27 -0
  92. package/templates/v5/styleguides/java.md +27 -0
  93. package/templates/v5/styleguides/javascript.md +27 -0
  94. package/templates/v5/styleguides/kotlin.md +26 -0
  95. package/templates/v5/styleguides/maven.md +28 -0
  96. package/templates/v5/styleguides/python.md +27 -0
  97. package/templates/v5/styleguides/react.md +28 -0
  98. package/templates/v5/styleguides/swift.md +27 -0
  99. package/templates/v5/styleguides/swiftui.md +27 -0
  100. package/templates/v5/styleguides/typescript.md +26 -0
  101. package/templates/v5/track/bug.md +14 -0
  102. package/templates/v5/track/dependency-context.json +9 -0
  103. package/templates/v5/track/execution.json +21 -0
  104. package/templates/v5/track/learning.md +45 -0
  105. package/templates/v5/track/plan.md +42 -0
  106. package/templates/v5/track/revert-operation.json +17 -0
  107. package/templates/v5/track/revise-operation.json +18 -0
  108. package/templates/v5/track/revision.md +36 -0
  109. package/templates/v5/track/spec.md +38 -0
  110. package/templates/v5/track/state.json +19 -0
@@ -0,0 +1,28 @@
1
+ # Gradle Build Styleguide
2
+
3
+ Apply `general.md` and the applicable JVM/Android language guide first.
4
+
5
+ ## Build defaults
6
+
7
+ - Use the Gradle Wrapper and run builds through `./gradlew`.
8
+ - Prefer Kotlin DSL for new builds; preserve an established Groovy DSL unless migration is explicitly approved.
9
+ - Declare plugins with the `plugins` block and name the root project in `settings.gradle(.kts)`.
10
+ - Keep production source out of the root project; split modules along cohesive product/build boundaries.
11
+ - Encapsulate shared build logic in convention plugins, preferably in an included `build-logic` build.
12
+ - Avoid broad `allprojects`/`subprojects`, `afterEvaluate`, internal APIs, and configuration-time I/O.
13
+ - Register/configure tasks lazily and declare inputs/outputs so caching and incremental execution remain correct.
14
+ - Centralize dependency coordinates/versions with version catalogs or approved dependency-management mechanisms.
15
+ - Keep repositories centralized and intentional; never embed credentials in build scripts.
16
+ - Preserve configuration-cache/build-cache compatibility where the project enables them.
17
+
18
+ ## Verification
19
+
20
+ - Run the relevant `./gradlew check`/build tasks with the project warning policy.
21
+ - For build-logic changes, test representative modules plus configuration-cache behavior when enabled.
22
+ - Review dependency insight, verification/locking, and generated artifacts for dependency changes.
23
+
24
+ ## Sources
25
+
26
+ - [Gradle general best practices](https://docs.gradle.org/current/userguide/best_practices_general.html)
27
+ - [Gradle build-structure best practices](https://docs.gradle.org/current/userguide/best_practices_structuring_builds.html)
28
+ - [Organizing Gradle projects](https://docs.gradle.org/current/userguide/organizing_gradle_projects.html)
@@ -0,0 +1,39 @@
1
+ # HTML and CSS Styleguide
2
+
3
+ Apply `general.md` first. Preserve the repository's approved formatter, CSS architecture, design tokens, component conventions, and supported-browser policy.
4
+
5
+ ## HTML defaults
6
+
7
+ - Produce conforming HTML with `<!doctype html>`, UTF-8, a document language, and the responsive viewport metadata for complete documents.
8
+ - Use the native element that matches the content or interaction. Prefer semantic landmarks, headings, links, buttons, lists, forms, and tables over generic containers or custom roles.
9
+ - Keep heading levels and DOM/source order logical. Do not use CSS to disguise an incorrect content hierarchy.
10
+ - Give controls programmatic labels, images appropriate text alternatives, links descriptive text, and data tables scoped headers.
11
+ - Preserve native keyboard behavior. Use links for navigation and buttons for actions; do not make a `div` or `span` imitate either.
12
+ - Use ARIA only when native HTML cannot express the required semantics, and keep names, roles, values, and states accurate.
13
+ - Keep structure in HTML and presentation in CSS. Avoid presentational elements, inline style attributes, and duplicated markup used only for layout.
14
+ - Treat untrusted markup as hostile; never insert it without an approved sanitization boundary.
15
+
16
+ ## CSS defaults
17
+
18
+ - Build layouts from content outward using normal flow, Flexbox, and Grid. Prefer fluid sizing and intentional breakpoints over fixed device-specific dimensions.
19
+ - Use the cascade deliberately: keep selectors simple and specificity low, scope component rules predictably, and avoid `!important` except for an approved, documented override layer.
20
+ - Use classes for reusable styling and semantic, consistently named hooks. Do not couple styles to fragile DOM depth or use IDs for routine styling.
21
+ - Centralize repeated design decisions as custom properties or approved design tokens. Name tokens by purpose when their meaning is shared.
22
+ - Prefer relative and logical sizing/spacing where it improves zoom, localization, writing-mode, and responsive behavior; follow the supported-browser policy.
23
+ - Preserve visible focus, sufficient contrast, legible text, and usable target sizes. Do not communicate meaning through color alone.
24
+ - Keep motion purposeful and honor `prefers-reduced-motion`; never make essential information depend only on animation.
25
+ - Organize declarations and files according to the repository formatter and architecture. Remove obsolete rules and avoid unexplained magic numbers.
26
+
27
+ ## Verification
28
+
29
+ - Run the repository HTML/CSS formatter, HTML conformance checks, Stylelint or the approved linter, tests, and production build.
30
+ - Check supported viewport widths, zoom/text resizing, overflow, long/localized content, print or forced-colors modes when applicable, and the supported browser matrix.
31
+ - Exercise the page with a keyboard and project accessibility tooling; verify focus order, accessible names, landmarks, contrast, and reduced-motion behavior.
32
+
33
+ ## Sources
34
+
35
+ - [WHATWG HTML Living Standard](https://html.spec.whatwg.org/)
36
+ - [MDN: Semantic HTML](https://developer.mozilla.org/en-US/curriculum/core/semantic-html/)
37
+ - [MDN: HTML accessibility](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Accessibility/HTML)
38
+ - [MDN: CSS and JavaScript accessibility best practices](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Accessibility/CSS_and_JavaScript)
39
+ - [W3C: How to Meet WCAG](https://www.w3.org/WAI/WCAG22/quickref/)
@@ -0,0 +1,27 @@
1
+ # Default Styleguide Catalog
2
+
3
+ Use this catalog during `create`. Always propose the project template's `styleguides/general.md`, then select defaults from the approved technology stack. Present every selected guide for human approval; copy a default only when the human accepts it. The human may amend a default or provide a complete replacement.
4
+
5
+ | Tech-stack evidence | Default guides to propose |
6
+ | --- | --- |
7
+ | Go | `go.md` |
8
+ | Java | `java.md`, plus `maven.md` or `gradle.md` when used |
9
+ | Kotlin | `kotlin.md`, plus `gradle.md` or `maven.md` when used |
10
+ | Maven | `maven.md` |
11
+ | Gradle | `gradle.md` |
12
+ | HTML, CSS, or HTML/CSS | `html-css.md` |
13
+ | JavaScript | `javascript.md` |
14
+ | TypeScript | `javascript.md` and `typescript.md` |
15
+ | Browser JavaScript | `html-css.md` and `javascript.md` |
16
+ | Browser TypeScript | `html-css.md`, `javascript.md`, and `typescript.md` |
17
+ | React for the web with JavaScript | `html-css.md`, `javascript.md`, and `react.md` |
18
+ | React for the web with TypeScript | `html-css.md`, `javascript.md`, `typescript.md`, and `react.md` |
19
+ | Dart | `dart.md` |
20
+ | Flutter | `dart.md` and `flutter.md` |
21
+ | Swift | `swift.md` |
22
+ | SwiftUI | `swift.md` and `swiftui.md` |
23
+ | Python | `python.md` |
24
+
25
+ If the stack is not represented, derive a project guide from `styleguides/language.md`, official ecosystem guidance, repository evidence, and user input. Do not invent conventions when a material choice is unclear.
26
+
27
+ For brownfield projects, inspect formatter/linter/build configuration and representative source before proposing defaults. Existing automated conventions win unless the human explicitly approves a change.
@@ -0,0 +1,27 @@
1
+ # Java Styleguide
2
+
3
+ Apply `general.md` first. Use the repository's formatter if configured; otherwise propose `google-java-format` and Google Java Style.
4
+
5
+ ## Idiomatic defaults
6
+
7
+ - Encode source as UTF-8. Keep one top-level type per ordinary source file and match its file name.
8
+ - Use `UpperCamelCase` for types, `lowerCamelCase` for methods/fields/locals, and `UPPER_SNAKE_CASE` for constants.
9
+ - Use lowercase package names organized by stable domain ownership.
10
+ - Do not use wildcard imports. Remove unused imports and keep deterministic ordering.
11
+ - Prefer immutable state, constructor-injected required dependencies, and narrow visibility.
12
+ - Program to focused abstractions where multiple implementations or test seams are real; avoid interface-per-class ceremony.
13
+ - Validate public-boundary inputs and model invalid states explicitly.
14
+ - Do not swallow caught exceptions. Preserve causes and add actionable domain context.
15
+ - Use try-with-resources for `AutoCloseable` values.
16
+ - Use `@Override` whenever legal and document public APIs where intent/contracts are not obvious.
17
+ - Avoid finalizers and hidden global mutable state.
18
+
19
+ ## Verification
20
+
21
+ - Run the approved formatter, compiler warnings/static analysis, and the repository's unit/integration tests.
22
+ - Test public behavior, exceptions, boundary values, concurrency, and resource cleanup where relevant.
23
+
24
+ ## Sources
25
+
26
+ - [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html)
27
+ - [Java language documentation](https://docs.oracle.com/en/java/)
@@ -0,0 +1,27 @@
1
+ # JavaScript Styleguide
2
+
3
+ Apply `general.md` first. Preserve the repository's approved formatter, semicolon, quote, and module settings.
4
+
5
+ ## Idiomatic defaults
6
+
7
+ - Use ECMAScript modules for new code when the runtime/toolchain supports them; keep imports at the top and dependencies explicit.
8
+ - Declare with `const` by default and `let` only when reassignment is required. Do not use `var` in modern targets.
9
+ - Use strict equality (`===`/`!==`) except for an intentional, documented nullish check.
10
+ - Keep functions focused, minimize shared mutable state, and prefer data transformations with clear ownership.
11
+ - Use `async`/`await` or deliberate Promise composition; always handle rejection and preserve useful error context.
12
+ - Use braces for control flow and avoid implicit behavior that reduces readability.
13
+ - Validate untrusted values at external boundaries before use.
14
+ - Do not use `eval`, dynamic `Function`, or unsafe DOM injection.
15
+ - Prefer standard platform APIs and explicit feature/runtime compatibility over non-standard behavior.
16
+ - Write comments/JSDoc for contracts and intent, not restatements of syntax.
17
+
18
+ ## Verification
19
+
20
+ - Run the repository formatter, ESLint (or approved linter), tests, and target-specific build/type checks.
21
+ - Test asynchronous failure paths, cleanup/cancellation behavior, serialization boundaries, and supported runtimes.
22
+
23
+ ## Sources
24
+
25
+ - [MDN JavaScript Guide](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide)
26
+ - [MDN JavaScript modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules)
27
+ - [Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html)
@@ -0,0 +1,26 @@
1
+ # Kotlin Styleguide
2
+
3
+ Apply `general.md` first. Use the official Kotlin coding conventions and the repository's configured formatter/linter.
4
+
5
+ ## Idiomatic defaults
6
+
7
+ - Use four spaces, no tabs, Kotlin brace style, and omit semicolons.
8
+ - Use lowercase package names, `UpperCamelCase` for classes/objects, and `lowerCamelCase` for functions/properties/locals.
9
+ - Name files for their primary declaration or cohesive purpose; avoid catch-all `Util` files.
10
+ - Prefer `val` and immutable collection interfaces. Use mutation only when it makes ownership and behavior clearer.
11
+ - Use nullable types deliberately, safe calls, Elvis operators, and early validation; avoid `!!` except for proven invariants with explanation.
12
+ - Prefer expression-oriented constructs and exhaustive `when` expressions when they improve clarity.
13
+ - Use data classes for data semantics, sealed hierarchies for closed variants, and extension functions near their domain/consumer.
14
+ - Keep visibility as narrow as practical. Specify public API return/property types and document public library APIs with KDoc.
15
+ - Use structured concurrency; make coroutine scope, dispatcher choice, cancellation, and exception ownership explicit.
16
+ - Avoid translating Java patterns mechanically when Kotlin provides a clearer language construct.
17
+
18
+ ## Verification
19
+
20
+ - Run the approved formatter/linter, compiler with project warnings policy, and all relevant tests.
21
+ - Test coroutine cancellation/error paths and Java interoperability boundaries when applicable.
22
+
23
+ ## Sources
24
+
25
+ - [Kotlin coding conventions](https://kotlinlang.org/docs/coding-conventions.html)
26
+ - [Kotlin code-quality tools](https://kotlinlang.org/docs/jvm-code-analysis.html)
@@ -0,0 +1,28 @@
1
+ # Maven Build Styleguide
2
+
3
+ Apply `general.md` and the applicable JVM language guide first.
4
+
5
+ ## Build defaults
6
+
7
+ - Follow Maven's standard directory layout; override it only for an evidenced project constraint.
8
+ - Use the Maven Wrapper when the project adopts it and run builds through `./mvnw`.
9
+ - Keep `pom.xml` declarative and readable. Prefer lifecycle/plugin configuration over shell-driven build steps.
10
+ - Pin plugin versions and define shared versions once in properties, `dependencyManagement`, or an imported BOM.
11
+ - Declare direct dependencies explicitly with the narrowest correct scope. Do not rely accidentally on transitive dependencies.
12
+ - Keep parent POM and multi-module relationships shallow and purposeful; modules follow the same standard layout.
13
+ - Put reusable build policy in parent/plugin management rather than duplicating it across modules.
14
+ - Avoid system-scoped dependencies, version ranges, hidden local-repository assumptions, and secrets in POMs/settings committed to Git.
15
+ - Configure reproducible outputs when publishing artifacts, including `project.build.outputTimestamp` and compatible plugin versions.
16
+ - Use profiles only for real environment/build variants; keep the default build deterministic.
17
+
18
+ ## Verification
19
+
20
+ - Run `./mvnw verify` (or the approved Maven command) from a clean checkout.
21
+ - Inspect dependency convergence/tree and plugin validation for dependency/build changes.
22
+ - Ensure generated output stays under `target/` and is not committed unless explicitly required.
23
+
24
+ ## Sources
25
+
26
+ - [Maven standard directory layout](https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html)
27
+ - [Maven dependency mechanism](https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html)
28
+ - [Maven reproducible builds](https://maven.apache.org/guides/mini/guide-reproducible-builds.html)
@@ -0,0 +1,27 @@
1
+ # Python Styleguide
2
+
3
+ Apply `general.md` first. Follow repository formatter/linter/type-checker configuration; otherwise use PEP 8 as the baseline.
4
+
5
+ ## Pythonic defaults
6
+
7
+ - Use four spaces, UTF-8, and automatic formatting. Keep imports at the top in standard-library, third-party, and local groups.
8
+ - Use `snake_case` for functions/variables/modules, `CapWords` for classes, and `UPPER_SNAKE_CASE` for constants.
9
+ - Prefer clear, direct Python constructs: comprehensions only when readable, context managers for resources, and iteration over manual indexing.
10
+ - Compare singleton sentinels such as `None` with `is`/`is not`.
11
+ - Use type annotations on public boundaries and non-obvious values; keep runtime validation at untrusted boundaries.
12
+ - Raise specific exceptions, preserve causes with `raise ... from ...`, and never use bare `except` for routine handling.
13
+ - Use immutable values/defaults where practical; never use a mutable object as a function default.
14
+ - Keep modules cohesive and public interfaces explicit. Use dataclasses/value objects where they clarify data semantics.
15
+ - Write docstrings for public modules, classes, functions, and methods; keep comments synchronized with behavior.
16
+ - Avoid hidden import-time side effects and global mutable state.
17
+
18
+ ## Verification
19
+
20
+ - Run the approved formatter, linter, type checker, and test suite.
21
+ - Test exceptions, boundary values, resource cleanup, async cancellation, and supported Python versions as applicable.
22
+
23
+ ## Sources
24
+
25
+ - [PEP 8 – Style Guide for Python Code](https://peps.python.org/pep-0008/)
26
+ - [PEP 257 – Docstring Conventions](https://peps.python.org/pep-0257/)
27
+ - [Python documentation](https://docs.python.org/3/)
@@ -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,20 @@
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
+ "approvalPolicyVersion": 2,
10
+ "approvalMode": "{{governed|phase|track|autonomous}}",
11
+ "maxWorkers": 3,
12
+ "planRevision": 1,
13
+ "planCommit": "{{PLAN_COMMIT}}",
14
+ "graphDigest": "{{GRAPH_DIGEST}}",
15
+ "baseCommit": "{{BASE_COMMIT}}",
16
+ "startedAt": "{{APPROVED_AT}}",
17
+ "completedAt": null,
18
+ "headCommit": null,
19
+ "nodes": {}
20
+ }
@@ -0,0 +1,45 @@
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
+ <!-- cadre:memory:start -->
9
+ {"schemaVersion":1,"specRevision":1,"planRevision":1,"patterns":[]}
10
+ <!-- cadre:memory:end -->
11
+
12
+ Record every applicable pattern as {"path":"patterns/<slug>.md","sha256":"<SHA-256 of exact approved bytes>"} in the patterns array. Keep the human-readable relevance and constraints below synchronized. An empty array means no existing pattern applies, never missing research.
13
+
14
+ - Spec revision: 1
15
+ - Plan revision: 1
16
+
17
+ | Pattern | Relevance to this track | Constraints to carry forward |
18
+ | --- | --- | --- |
19
+ | `{{PATTERN_PATH}}` | {{RELEVANCE}} | {{CONSTRAINTS}} |
20
+
21
+ If no existing pattern is relevant, state that explicitly rather than inventing guidance.
22
+ <!-- cadre:pattern-seed:end -->
23
+
24
+ ## Phase 1: {{PHASE_NAME}}
25
+
26
+ ### Inputs read
27
+
28
+ {{FILES_PATTERNS_DEPENDENCY_PHASE_LEARNING}}
29
+
30
+ ### Task observations
31
+
32
+ {{OBSERVATIONS_WITH_TASK_AND_COMMIT}}
33
+
34
+ ### Decisions and corrections
35
+
36
+ {{DECISIONS_AND_CORRECTIONS}}
37
+
38
+ ### Reusable pattern candidates
39
+
40
+ {{CANDIDATES_OR_NONE}}
41
+
42
+ ### Phase completion
43
+
44
+ - Commit: {{PHASE_COMPLETION_COMMIT}}
45
+ - 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
+ }
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,9 @@
1
+ # Cadre-managed temporary execution worktrees
2
+ /.worktrees/
3
+
4
+ # Disposable Wisp output
5
+ /wisps/
6
+
7
+ # Unapproved candidate artifacts
8
+ /stage/
9
+ /.build-cache/cadre/