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,30 @@
1
+ # Product
2
+
3
+ ## Project context
4
+
5
+ - Classification: `{{greenfield|brownfield}}`
6
+ - Evidence: {{CLASSIFICATION_EVIDENCE}}
7
+
8
+ ## Name and summary
9
+
10
+ {{PROJECT_NAME_AND_SUMMARY}}
11
+
12
+ ## Users and problems
13
+
14
+ {{USERS_AND_PROBLEMS}}
15
+
16
+ ## Outcomes and success measures
17
+
18
+ {{OUTCOMES_AND_MEASURES}}
19
+
20
+ ## Scope boundaries
21
+
22
+ {{SCOPE_BOUNDARIES}}
23
+
24
+ ## Domain language
25
+
26
+ {{DOMAIN_LANGUAGE}}
27
+
28
+ ## Open questions
29
+
30
+ {{OPEN_QUESTIONS}}
@@ -0,0 +1,27 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "runtimeVersion": "{{RUNTIME_VERSION}}",
4
+ "templateSetVersion": "{{TEMPLATE_SET_VERSION}}",
5
+ "project": {
6
+ "name": "{{PROJECT_NAME}}",
7
+ "context": "{{greenfield|brownfield}}"
8
+ },
9
+ "setup": {
10
+ "status": "in_progress",
11
+ "checkpoint": "approved",
12
+ "commit": null,
13
+ "artifactProgress": [],
14
+ "operation": {
15
+ "action": "create",
16
+ "baseCommit": "{{BASE_COMMIT_OR_NULL}}",
17
+ "expectedCommit": "cadre(create): initialize project harness",
18
+ "repositoryRoot": "{{PROJECT_ROOT}}",
19
+ "gitDisposition": "{{existing|initialize}}",
20
+ "approvedArtifacts": [],
21
+ "approvedArtifactHashes": [],
22
+ "approvedAt": "{{APPROVED_AT}}"
23
+ }
24
+ },
25
+ "lastRefresh": null,
26
+ "history": []
27
+ }
@@ -0,0 +1,14 @@
1
+ # General Coding Styleguide
2
+
3
+ - Read every existing file and directly relevant context before editing it.
4
+ - Prefer the smallest cohesive change that satisfies the approved plan task.
5
+ - Preserve established repository conventions unless an approved revision changes them.
6
+ - Make invalid states difficult to represent; validate at boundaries.
7
+ - Handle errors deliberately and keep failure messages actionable.
8
+ - Test externally visible behavior, failure paths, and meaningful edge cases.
9
+ - Keep comments focused on intent and tradeoffs rather than restating code.
10
+ - Avoid unrelated cleanup in delivery commits.
11
+
12
+ ## Project-specific additions
13
+
14
+ {{GENERAL_STYLE_ADDITIONS}}
@@ -0,0 +1,21 @@
1
+ # {{LANGUAGE_OR_FRAMEWORK}} Styleguide
2
+
3
+ ## Versions and conventions
4
+
5
+ {{VERSIONS_AND_CONVENTIONS}}
6
+
7
+ ## Structure and naming
8
+
9
+ {{STRUCTURE_AND_NAMING}}
10
+
11
+ ## Error handling and safety
12
+
13
+ {{ERROR_HANDLING_AND_SAFETY}}
14
+
15
+ ## Testing and tooling
16
+
17
+ {{TESTING_AND_TOOLING}}
18
+
19
+ ## Avoid
20
+
21
+ {{PROJECT_SPECIFIC_ANTI_PATTERNS}}
@@ -0,0 +1,21 @@
1
+ # Technology Stack
2
+
3
+ ## Runtime and languages
4
+
5
+ {{RUNTIMES_AND_LANGUAGES}}
6
+
7
+ ## Frameworks and libraries
8
+
9
+ {{FRAMEWORKS_AND_LIBRARIES}}
10
+
11
+ ## Data and infrastructure
12
+
13
+ {{DATA_AND_INFRASTRUCTURE}}
14
+
15
+ ## Tooling
16
+
17
+ {{BUILD_TEST_FORMAT_TOOLS}}
18
+
19
+ ## Version constraints
20
+
21
+ {{VERSION_CONSTRAINTS}}
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,6 @@
1
+ # Tracks
2
+
3
+ Generated from track-local `state.json` files by the Cadre MCP server.
4
+
5
+ | Track | Type | Status | Revision |
6
+ | --- | --- | --- | ---: |
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,72 @@
1
+ # Cadre Workflow
2
+
3
+ This is the durable project-level Cadre contract. Installed skills supply command procedure; stop and present any conflict with this file.
4
+
5
+ ## Authority and project boundaries
6
+
7
+ - The installed Cadre MCP server is the authoritative runtime and immutable template provider.
8
+ - `.cadre/` contains approved mutable context, lifecycle state, and history only. Runtime code and template catalogs stay in the installed plugin.
9
+ - Read every existing artifact and its relevant repository context before editing it. Never reconstruct state or file content from memory.
10
+ - Resolve the exact repository root before mutation. Never create a nested repository or operate outside the approved root.
11
+ - A missing required MCP capability blocks stateful work; do not recreate it with shell or filesystem logic.
12
+
13
+ ## Human governance
14
+
15
+ - Semantic content, scope, selection, and material consequences remain proposals until the human explicitly approves them.
16
+ - Combine related decisions into one complete authorization envelope when their exact artifacts, focused diffs, consequences, and verification evidence are available together.
17
+ - Named deterministic consequences—validation, indexes, transitions, commits, and provenance—need no additional approval.
18
+ - Changed content, scope, selection, digest, or material consequences require a corrected proposal and approval.
19
+ - An MCP `approval_required` result is not approval. Call its adaptive command again in `apply` mode only after the human approves the unchanged digest-bound proposal.
20
+ - Host security permission is separate from Cadre approval and never approves product content, commits, merges, or lifecycle state.
21
+
22
+ ## Candidate artifacts
23
+
24
+ - Write unapproved artifact bodies only beneath `<project-root>/.cadre/stage/<candidate-id>/` at their eventual `.cadre/`-relative paths.
25
+ - Never place unapproved files in canonical `.cadre/` and never transport candidate bodies through MCP when a candidate command exists.
26
+ - Inspect the complete exact candidate set before approval. Approval binds its paths and SHA-256 hashes to one digest.
27
+ - Candidate paths must be relative and traversal-free. Stages reject symbolic links, unexpected files, and size-limit violations.
28
+ - After approval, journal the digest and manifest, promote only matching bytes, verify hashes, and retain the stage through commit recording.
29
+ - `.cadre/stage/` is never committed. A changed candidate requires fresh inspection and approval.
30
+
31
+ ## Resumability and Git safety
32
+
33
+ - Every multi-step mutation records an operation journal after approval and before canonical writes or Git mutation.
34
+ - On resume, reconcile the journal, candidate hashes, canonical files, Git status, expected commit, and recorded checkpoint. Continue only the first incomplete deterministic step.
35
+ - If an expected commit already exists with the correct base relationship and content, record it instead of repeating it.
36
+ - Stop on any journal, hash, path, worktree, branch, or history mismatch. Never reset, discard, force-delete, rewrite public history, or guess a repair.
37
+ - Use additive Git history and focused Conventional Commits. Do not include unrelated files or runtime-only worktrees.
38
+ - Reuse passing verification while product files, test inputs, and verification policy are unchanged. Cadre-only bookkeeping does not invalidate product verification.
39
+
40
+ ## Sources of truth
41
+
42
+ - `spec.md` defines approved scope, requirements, and acceptance criteria.
43
+ - `plan.md` defines phase/task identity, dependencies, verification barriers, completion markers, and commit provenance.
44
+ - Track `state.json` defines identity, lifecycle status, dependencies, revision, checkpoints, active operation, execution pointer, review cycles, and history.
45
+ - Execution journals define live scheduling and provenance; do not duplicate active node state.
46
+ - `project.json` defines project identity plus setup and refresh history; it does not duplicate track records.
47
+ - `tracks.md` is a generated summary. Never hand-edit it or use it as dependency state.
48
+ - Git is implementation history. Completion claims require reachable recorded commits.
49
+
50
+ ## Lifecycle and mutation rules
51
+
52
+ ```text
53
+ drafting-spec -> drafting-plan -> planned -> in_progress -> ready_for_review
54
+ | | | |
55
+ +-- revise ---+-------------+ +-- revise --> in_progress/planned
56
+ | | +-- approved bugs --> in_progress
57
+ +-------------+ +-- clean review --> completed --> archived
58
+ ```
59
+
60
+ - Only `review` may mark a track `completed`; only `archive` may mark it `archived`.
61
+ - Completed or archived intent changes create successor work rather than rewriting terminal history.
62
+ - Track dependencies are read from track state and must be completed or archived before dependent execution.
63
+ - Every delivery phase ends in a derived `User Manual Verification` barrier. The final phase is the track-level manual-verification barrier.
64
+ - An `implement` invocation authorizes the approved plan under its persisted approval mode. `phase` is the default; `governed` adds regular-task and integration decisions; `autonomous` still requires track-level manual verification.
65
+ - Deterministic MCP operations use one call. Approval-aware operations use `prepare`, pause for the human, then `apply` with the unchanged token.
66
+
67
+ ## Context reuse
68
+
69
+ - Inspect project status once at command entry using the narrowest applicable view. Use separate full validation only for final mutation gates or diagnostics.
70
+ - Read each required file once and reuse unchanged content by path and Git hash. Continue truncated reads from the first unread line.
71
+ - Fetch known immutable templates in one bundle and retain them through the decision. Do not rediscover known IDs through the catalog.
72
+ - Present concise status and focused diffs. Identify large unchanged defaults by version, path, and hash unless requested.
@@ -0,0 +1,19 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "action": "archive",
4
+ "batchId": "archive-{{ARCHIVE_TS}}",
5
+ "status": "in_progress",
6
+ "checkpoint": "approved",
7
+ "baseCommit": "{{BASE_COMMIT}}",
8
+ "expectedCommit": "{{EXPECTED_COMMIT}}",
9
+ "selectedTracks": ["{{TRACK_ID}}"],
10
+ "completedTracks": [],
11
+ "approvedArtifacts": ["{{APPROVED_ARTIFACT}}"],
12
+ "approvalDigest": "{{APPROVAL_DIGEST}}",
13
+ "approvedArtifactHashes": [
14
+ { "path": "{{APPROVED_ARTIFACT}}", "sha256": "{{ARTIFACT_SHA256}}" }
15
+ ],
16
+ "artifactProgress": [],
17
+ "approvedAt": "{{APPROVED_AT}}",
18
+ "archiveCommit": null
19
+ }
@@ -0,0 +1,20 @@
1
+ # Pattern: {{PATTERN_NAME}}
2
+
3
+ ## Use when
4
+
5
+ {{APPLICABILITY}}
6
+
7
+ ## Guidance
8
+
9
+ {{GUIDANCE}}
10
+
11
+ ## Tradeoffs and limits
12
+
13
+ {{TRADEOFFS}}
14
+
15
+ ## Provenance
16
+
17
+ - Track: `{{TRACK_ID}}`
18
+ - Phase/task: `{{PHASE_TASK}}`
19
+ - Commits: {{COMMITS}}
20
+ - Archived at: {{TIMESTAMP}}
@@ -0,0 +1,18 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "action": "refresh",
4
+ "operationId": "refresh-{{REFRESH_TS}}",
5
+ "status": "in_progress",
6
+ "checkpoint": "approved",
7
+ "baseCommit": "{{BASE_COMMIT}}",
8
+ "expectedCommit": "cadre(refresh): update project context",
9
+ "refreshPath": "refreshes/refresh-{{REFRESH_TS}}.md",
10
+ "approvedArtifacts": ["refreshes/refresh-{{REFRESH_TS}}.md"],
11
+ "approvalDigest": "{{APPROVAL_DIGEST}}",
12
+ "approvedArtifactHashes": [
13
+ { "path": "{{APPROVED_ARTIFACT}}", "sha256": "{{ARTIFACT_SHA256}}" }
14
+ ],
15
+ "artifactProgress": [],
16
+ "approvedAt": "{{APPROVED_AT}}",
17
+ "refreshCommit": null
18
+ }
@@ -0,0 +1,21 @@
1
+ # Refresh {{REFRESH_TS}}
2
+
3
+ - Status: proposed
4
+ - Previous refresh/setup commit: `{{BASE_COMMIT}}`
5
+ - Refresh commit: pending
6
+
7
+ ## Inputs and evidence
8
+
9
+ {{INPUTS_AND_COMMIT_RANGE}}
10
+
11
+ ## Proposed context changes
12
+
13
+ {{PROPOSED_CHANGES}}
14
+
15
+ ## Active-track impact
16
+
17
+ {{TRACK_IMPACT}}
18
+
19
+ ## Approval
20
+
21
+ {{APPROVAL_RECORD}}
@@ -0,0 +1,27 @@
1
+ # Dart Styleguide
2
+
3
+ Apply `general.md` first and use Effective Dart as the language baseline.
4
+
5
+ ## Idiomatic defaults
6
+
7
+ - Format with `dart format`; do not hand-align code against formatter output.
8
+ - Use `UpperCamelCase` for types/extensions, `lowerCamelCase` for other identifiers, and `lowercase_with_underscores` for files/directories/packages.
9
+ - Order `dart:` imports before `package:` imports and relative imports; keep exports in their own section.
10
+ - Prefer concise, readable language features without compressing multiple responsibilities together.
11
+ - Use sound null safety; model absence explicitly and avoid `!` unless an invariant is proven.
12
+ - Choose one consistent local-variable policy for `final`/`var`; favor immutable fields and top-level values.
13
+ - Avoid storing derivable state and expose one source of truth.
14
+ - Use `async`/`await` deliberately; return/await futures, handle stream subscriptions, and propagate useful errors.
15
+ - Design public APIs for clear call sites, consistent terminology, and minimal surprising behavior.
16
+ - Document public APIs with `///` comments and keep implementation comments focused on intent.
17
+
18
+ ## Verification
19
+
20
+ - Run `dart format --output=none --set-exit-if-changed .`, `dart analyze`, and `dart test` or project equivalents.
21
+ - Test null/error/async paths and public package APIs.
22
+
23
+ ## Sources
24
+
25
+ - [Effective Dart](https://dart.dev/effective-dart)
26
+ - [Effective Dart: Usage](https://dart.dev/effective-dart/usage)
27
+ - [Effective Dart: Design](https://dart.dev/effective-dart/design)
@@ -0,0 +1,27 @@
1
+ # Flutter Styleguide
2
+
3
+ Apply `general.md` and `dart.md` first. Adapt architecture recommendations to the approved app size and existing brownfield structure.
4
+
5
+ ## Flutter defaults
6
+
7
+ - Separate UI and data responsibilities. Keep business/data logic out of widget build methods.
8
+ - Give views/widgets presentation responsibility; place UI state/transformation in an approved state-holder or ViewModel pattern.
9
+ - Isolate external data access behind repositories/services with clear interfaces and dependency injection.
10
+ - Use unidirectional data flow and immutable models where practical.
11
+ - Keep widgets small and composable; use `const` constructors whenever inputs are compile-time constants.
12
+ - Keep transient UI state local and lift/share it only when multiple consumers need the same source of truth.
13
+ - Use stable keys where widget identity matters; do not use keys indiscriminately.
14
+ - Model loading, empty, error, offline, and success states explicitly.
15
+ - Build responsive/adaptive layouts from constraints and platform behavior, not device-name checks.
16
+ - Include semantics, keyboard/focus behavior, text scaling, and contrast in Definition of Done.
17
+
18
+ ## Verification
19
+
20
+ - Run `dart format`, `flutter analyze`, unit tests for services/repositories/state holders, widget tests for views, and targeted integration tests.
21
+ - Test lifecycle/disposal, navigation, dependency injection, platform differences, golden output when appropriate, and accessibility.
22
+
23
+ ## Sources
24
+
25
+ - [Flutter architecture recommendations](https://docs.flutter.dev/app-architecture/recommendations)
26
+ - [Flutter app architecture guide](https://docs.flutter.dev/app-architecture/guide)
27
+ - [Flutter testing](https://docs.flutter.dev/testing/overview)
@@ -0,0 +1,29 @@
1
+ # Go Styleguide
2
+
3
+ Apply `general.md` first. Repository formatter/linter configuration takes precedence when explicitly approved.
4
+
5
+ ## Idiomatic defaults
6
+
7
+ - Format all source with `gofmt`; use `goimports` when the project adopts it.
8
+ - Use short, lowercase, single-word package names. Avoid catch-all packages such as `util`, `common`, or `misc`.
9
+ - Keep exported names purposeful; avoid repeating the package name in identifiers.
10
+ - Write doc comments for exported packages, types, functions, methods, and variables. Begin declaration comments with the declared name when natural.
11
+ - Accept interfaces at the consumer boundary and return concrete types unless abstraction is required.
12
+ - Keep interfaces small and define them near their consumers.
13
+ - Handle every error deliberately. Add useful context without obscuring the original error; use `errors.Is`/`errors.As` for semantic checks.
14
+ - Reserve `panic` for unrecoverable programmer/invariant failures, not routine error handling.
15
+ - Pass `context.Context` explicitly as the first parameter for request-scoped cancellation/deadlines; do not store it in structs.
16
+ - Make goroutine ownership, cancellation, and shutdown explicit. Avoid goroutine/channel leaks.
17
+ - Prefer simple control flow, early returns, and zero-value-useful types.
18
+
19
+ ## Verification
20
+
21
+ - Run `gofmt`/`goimports`, `go vet ./...`, and `go test ./...`.
22
+ - Prefer table-driven tests for repeated behavior and include failure/edge cases.
23
+ - Run the race detector for concurrency-sensitive changes when practical.
24
+
25
+ ## Sources
26
+
27
+ - [Effective Go](https://go.dev/doc/effective_go)
28
+ - [Go Code Review Comments](https://go.dev/wiki/CodeReviewComments)
29
+ - [Go Doc Comments](https://go.dev/doc/comment)
@@ -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/)