cadre-ai 2.2.0 → 3.0.1
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.
- package/.claude-plugin/plugin.json +10 -0
- package/.codex-plugin/plugin.json +19 -0
- package/.mcp.codex.json +9 -0
- package/.mcp.json +8 -0
- package/LICENSE +21 -202
- package/README.md +357 -134
- package/agents/cadre-phase-worker.md +17 -0
- package/agents/cadre-task-worker.md +16 -0
- package/dist/cadre-cli.mjs +2883 -0
- package/dist/cadre-mcp.mjs +33736 -0
- package/marketplace/claude.json +16 -0
- package/marketplace/codex.json +20 -0
- package/package.json +36 -32
- package/skills/archive/SKILL.md +28 -0
- package/skills/archive/agents/openai.yaml +4 -0
- package/skills/create/SKILL.md +33 -0
- package/skills/create/agents/openai.yaml +4 -0
- package/skills/implement/SKILL.md +91 -0
- package/skills/implement/agents/openai.yaml +4 -0
- package/skills/refresh/SKILL.md +18 -0
- package/skills/refresh/agents/openai.yaml +4 -0
- package/skills/revert/SKILL.md +20 -0
- package/skills/revert/agents/openai.yaml +4 -0
- package/skills/review/SKILL.md +32 -0
- package/skills/review/agents/openai.yaml +4 -0
- package/skills/revise/SKILL.md +32 -0
- package/skills/revise/agents/openai.yaml +4 -0
- package/skills/status/SKILL.md +21 -0
- package/skills/status/agents/openai.yaml +4 -0
- package/skills/track/SKILL.md +33 -0
- package/skills/track/agents/openai.yaml +4 -0
- package/skills/wisp/SKILL.md +16 -0
- package/skills/wisp/agents/openai.yaml +4 -0
- package/templates/v1/init/archive/.gitkeep +1 -0
- package/templates/v1/init/gitignore.template +5 -0
- package/templates/v1/init/guidelines.md +25 -0
- package/templates/v1/init/operations/.gitkeep +1 -0
- package/templates/v1/init/patterns/index.md +6 -0
- package/templates/v1/init/product.md +30 -0
- package/templates/v1/init/project.json +26 -0
- package/templates/v1/init/refreshes/.gitkeep +1 -0
- package/templates/v1/init/styleguides/general.md +14 -0
- package/templates/v1/init/styleguides/language.md +21 -0
- package/templates/v1/init/tech-stack.md +21 -0
- package/templates/v1/init/tracks/.gitkeep +1 -0
- package/templates/v1/init/tracks.md +6 -0
- package/templates/v1/init/wisps/.gitkeep +1 -0
- package/templates/v1/init/workflow.md +163 -0
- package/templates/v1/project/archive-operation.json +15 -0
- package/templates/v1/project/pattern.md +20 -0
- package/templates/v1/project/refresh-operation.json +14 -0
- package/templates/v1/project/refresh.md +21 -0
- package/templates/v1/styleguides/dart.md +27 -0
- package/templates/v1/styleguides/flutter.md +27 -0
- package/templates/v1/styleguides/go.md +29 -0
- package/templates/v1/styleguides/gradle.md +28 -0
- package/templates/v1/styleguides/html-css.md +39 -0
- package/templates/v1/styleguides/index.md +27 -0
- package/templates/v1/styleguides/java.md +27 -0
- package/templates/v1/styleguides/javascript.md +27 -0
- package/templates/v1/styleguides/kotlin.md +26 -0
- package/templates/v1/styleguides/maven.md +28 -0
- package/templates/v1/styleguides/python.md +27 -0
- package/templates/v1/styleguides/react.md +28 -0
- package/templates/v1/styleguides/swift.md +27 -0
- package/templates/v1/styleguides/swiftui.md +27 -0
- package/templates/v1/styleguides/typescript.md +26 -0
- package/templates/v1/track/bug.md +14 -0
- package/templates/v1/track/execution.json +18 -0
- package/templates/v1/track/learning.md +39 -0
- package/templates/v1/track/plan.md +39 -0
- package/templates/v1/track/revert-operation.json +13 -0
- package/templates/v1/track/revise-operation.json +14 -0
- package/templates/v1/track/revision.md +36 -0
- package/templates/v1/track/spec.md +38 -0
- package/templates/v1/track/state.json +25 -0
- package/scripts/cadre-cli.js +0 -1076
- package/scripts/cadre-core.js +0 -15240
- package/scripts/cadre-lsp-review.js +0 -1194
- package/scripts/cadre-lsp-setup.js +0 -599
- package/scripts/mcp/cadre-server.js +0 -19013
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -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,26 @@
|
|
|
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
|
+
"approvedAt": "{{APPROVED_AT}}"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"lastRefresh": null,
|
|
25
|
+
"history": []
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -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 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Cadre Workflow
|
|
2
|
+
|
|
3
|
+
This file governs every Cadre command except that `wisp` does not mutate Cadre state. If a command-specific instruction conflicts with this file, stop and present the conflict to the human.
|
|
4
|
+
|
|
5
|
+
Cadre's plugin-scoped MCP server is the authoritative runtime and immutable template provider. Project-local `.cadre/` contains only approved mutable context, lifecycle artifacts, and history; it must not contain copied Cadre runtime code or template catalogs. Stateful commands fail closed when required Cadre MCP tools are unavailable.
|
|
6
|
+
|
|
7
|
+
## Non-negotiable operating rules
|
|
8
|
+
|
|
9
|
+
### Read before edit
|
|
10
|
+
|
|
11
|
+
Before editing an existing file, read the current file and its directly relevant context, including applicable repository instructions, callers, tests, types, and configuration. Before creating a file, inspect the target directory and nearby conventions. Never change a file by guessing its current contents. Record material evidence read in the task or review summary.
|
|
12
|
+
|
|
13
|
+
### Human governance
|
|
14
|
+
|
|
15
|
+
Treat every artifact and state transition as a proposal until the human reviews and explicitly approves it. Present exact content or a focused diff, consequences, unknowns, and verification evidence. Approval for one artifact or transition does not imply approval for later ones. Persist an approved checkpoint before pausing a multi-stage flow so another session can resume it.
|
|
16
|
+
|
|
17
|
+
Combine related decisions into one approval when their complete exact artifacts, state transitions, consequences, and verification are available together. In particular, do not split finding disposition from an already-prepared remediation proposal, reject-all risk acceptance from clean-review completion, or a uniquely determined archive selection from its full batch proposal. A combined response must unambiguously approve every included consequence. Any changed content, selection, digest, or newly discovered consequence requires a corrected proposal and new approval.
|
|
18
|
+
|
|
19
|
+
### Clarification gate
|
|
20
|
+
|
|
21
|
+
Inspect available files, history, state, and approved artifacts before asking. If a material choice remains ambiguous and different answers would change scope, requirements, acceptance criteria, dependencies, compatibility, architecture, plans, or cascading state, ask the human a concise targeted question and pause that branch of work. Do not guess, choose a convenient default, or treat silence as approval. Continue without asking only when evidence resolves the choice or the assumption is immaterial and is explicitly disclosed.
|
|
22
|
+
|
|
23
|
+
`create` must explicitly classify the repository as `greenfield` or `brownfield`. Greenfield means no substantive existing product implementation/history; brownfield means existing implementation, behavior, users, data, interfaces, or delivery history must be understood and preserved or intentionally changed. If evidence is mixed or insufficient, ask which classification to use before drafting Cadre artifacts. Persist the approved classification in `project.json` and `product.md`.
|
|
24
|
+
|
|
25
|
+
`track`, `revise`, and `refresh` must apply this gate before drafting and again whenever later analysis reveals a new material ambiguity.
|
|
26
|
+
|
|
27
|
+
### Create-time workflow and styleguide acceptance
|
|
28
|
+
|
|
29
|
+
During `create`, present this default workflow as its own approval item and ask whether it is acceptable or should be changed. Do not infer workflow acceptance from approval of product, stack, or other setup artifacts. Apply requested changes, present the revised workflow, and obtain explicit acceptance before writing it.
|
|
30
|
+
|
|
31
|
+
Always propose `styleguides/general.md`. Match the approved tech stack against the bundled default catalog, then propose the applicable language, framework, and build-tool guides. For each guide, let the human choose the bundled default, an amended default, or a user-provided replacement. Framework/tool guides supplement their language guide: HTML/CSS underpins browser UI; TypeScript supplements JavaScript; React for the web supplements HTML/CSS plus JavaScript or TypeScript; Flutter supplements Dart; SwiftUI supplements Swift; Maven or Gradle supplements Java/Kotlin. Copy only the approved set. In brownfield projects, existing enforced conventions take precedence unless the human explicitly approves replacing them.
|
|
32
|
+
|
|
33
|
+
### Interruption-safe operations
|
|
34
|
+
|
|
35
|
+
At command entry, call `project_status` once and use its embedded structured validation. Reserve a separate `state_validate` call for final mutation gates or focused diagnostics; do not perform redundant full-project validation scans. Derived-state warnings such as a stale generated `tracks.md` are resumable drift, not canonical corruption. Present and repair them through the approved MCP render gate before a final commit.
|
|
36
|
+
|
|
37
|
+
Within one command flow, inventory required context once and reuse content whose Git path/hash is unchanged. Continue truncated reads from the first unread line instead of restarting them. Do not run line-count or repeated path-discovery passes before known reads. Consecutive reviews reread the current lifecycle artifacts and changed implementation range while reusing unchanged project guidance. Archive reads selected evidence and provenance in one bounded pass. Fetch known immutable template IDs directly with `template_get_many`; do not call the catalog merely to rediscover them.
|
|
38
|
+
|
|
39
|
+
For every multi-step state mutation—and specifically `create`, both spec/plan stages of `track`, `implement`, finding-bearing `review`, `revise`, `refresh`, `revert`, and archive batches—write an operation journal immediately after approval and before artifact writes or Git mutations. Use `project.json.setup.operation` for create, track `state.json.operation` plus `executions/execution-<ts>.json` for implementation, track `state.json.operation` for other track-local flows including revert, and a versioned operation file under `.cadre/operations/` for refresh and archive batches. Record the action, durable checkpoint, base commit, expected commit message, approved artifact paths, and per-artifact progress.
|
|
40
|
+
|
|
41
|
+
On every command entry, reconcile an existing journal before starting new work:
|
|
42
|
+
|
|
43
|
+
1. If the journal exists and matching files are dirty, resume the first incomplete artifact/checkpoint, validate, and create the expected commit.
|
|
44
|
+
2. If the journal exists, the worktree is clean, and HEAD matches its expected message and base relationship, the artifact commit already succeeded; record HEAD instead of repeating work.
|
|
45
|
+
3. If the artifact SHA is recorded and only the approved state bookkeeping is dirty, finish its `cadre(...): record ...` commit.
|
|
46
|
+
4. If files, journal, approval record, Git status, or HEAD disagree, stop and present the mismatch. Never reset, discard, reconstruct from guesses, or restart the flow.
|
|
47
|
+
|
|
48
|
+
Advance the checkpoint after each durable artifact write. Once the artifact commit is identified, append it to history, clear the operation, advance the lifecycle checkpoint, and commit the state record. This protocol makes interruption before a commit, after a commit, or before its follow-up state commit resumable.
|
|
49
|
+
|
|
50
|
+
During `create`, detect an existing worktree with `git rev-parse --show-toplevel` and never initialize a nested repository. If no worktree exists, record the approved project root and `initialize` disposition through the MCP initialization preview/apply gate before running `git init` there. Verify the resulting root and record that checkpoint before the setup commit. Resume a pending initialization from the journal; stop if the observed repository conflicts with the recorded disposition or root.
|
|
51
|
+
|
|
52
|
+
For deterministic MCP mutations, call the read-only preview immediately before apply, show the exact proposal to the human, and pass its digest unchanged. A changed digest requires a new proposal and approval. The MCP never grants approval or replaces required repository inspection. Its Git surface is limited to constrained, digest-gated Cadre worktree creation, integration, and safe cleanup; it accepts no arbitrary command, path, force deletion, or automatic conflict resolution.
|
|
53
|
+
|
|
54
|
+
Resuming an already-approved operation is the narrow exception to another human approval: the operation journal must contain the same approval/content digest and the newly previewed final artifacts must be identical to the approved proposal, with only recorded checkpoint progress changed. Any content, selection, consequence, or approval-digest mismatch requires a corrected proposal and new approval.
|
|
55
|
+
|
|
56
|
+
When a command skill explicitly instructs direct writes for approved Cadre artifacts and no corresponding MCP mutation tool is declared, those direct writes are intentional. Do not search the global tool list for an undeclared operation. Journal the change first, use the available MCP validation and derived-render gates, and stop if the resulting state does not match the approved proposal.
|
|
57
|
+
|
|
58
|
+
### Sources of truth
|
|
59
|
+
|
|
60
|
+
- `plan.md` is the execution source of truth for phase/task identities, dependencies, verification barriers, completion, and commit provenance. Display order is only a deterministic scheduling tie-breaker.
|
|
61
|
+
- `spec.md` is the scope and acceptance source of truth.
|
|
62
|
+
- Each track's `state.json` is the canonical source for its identity, title, type, status, track dependencies, revision, checkpoints, operation pointer, completed execution, and history; it must agree with the approved spec and plan. Active execution nodes are derived from the execution journal, never duplicated as singular active phase/task fields.
|
|
63
|
+
- Track location is derived: non-archived state lives at `tracks/<track-id>` and archived state at `archive/<track-id>`. Never persist a track path field.
|
|
64
|
+
- `project.json` contains project/setup/refresh history only; it does not duplicate track records.
|
|
65
|
+
- `tracks.md` is a generated lifecycle summary discovered from track-local state. It intentionally omits dependencies and paths; never hand-edit it.
|
|
66
|
+
- Templates are immutable plugin resources addressed by logical IDs such as `track/spec`; they are rendered into approved artifacts but are never copied into `.cadre/`.
|
|
67
|
+
- Git is the implementation history. Do not claim completion without recorded commits.
|
|
68
|
+
- `.cadre/.gitignore` keeps `.worktrees/` and `wisps/` out of Git. Worktree and Wisp contents are runtime-only and never Cadre history.
|
|
69
|
+
|
|
70
|
+
## Lifecycle
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
drafting-spec -> drafting-plan -> planned -> in_progress -> ready_for_review
|
|
74
|
+
| | | |
|
|
75
|
+
+-- revise ---+-------------+ +-- revise --> in_progress/planned
|
|
76
|
+
| | +-- approved bugs --> in_progress
|
|
77
|
+
+-------------+ +-- clean review --> completed --> archived
|
|
78
|
+
|
|
79
|
+
completed/archived -- changed intent --> successor track
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Legal track statuses are `drafting-spec`, `drafting-plan`, `planned`, `in_progress`, `ready_for_review`, `completed`, and `archived`. The `revise` command may be invoked in any status, but it routes according to the approved-baseline rules below; it does not make completed or archived history mutable. Only review can mark `completed`; only archive can mark `archived`.
|
|
83
|
+
|
|
84
|
+
## Track construction
|
|
85
|
+
|
|
86
|
+
- Track type is exactly `feature` or `bug`.
|
|
87
|
+
- A spec contains functional requirements, non-functional requirements, acceptance criteria, additional information, dependencies, and impact.
|
|
88
|
+
- A plan is an acyclic graph. Every regular phase explicitly declares phase dependencies; every regular task explicitly declares same-phase task dependencies. Missing declarations, unknown references, self-dependencies, cross-phase task dependencies, and cycles are invalid.
|
|
89
|
+
- Every delivery/remediation phase ends with a task named `User Manual Verification`; its dependencies are derived as every sibling delivery task and must not be repeated in the plan.
|
|
90
|
+
- The final phase is named `Track-level User Manual Verification`, contains only `User Manual Verification`, and implicitly depends on every preceding phase. Those dependencies are derived and must not be repeated.
|
|
91
|
+
- A track may start implementation only when every declared dependency is completed or archived after completion.
|
|
92
|
+
- After spec and plan approval, populate the marked Pattern Seed section at the top of `learning.md` only from relevant, existing patterns and cite the source pattern paths. Do not create a separate seed file.
|
|
93
|
+
|
|
94
|
+
## Implementation scheduling and discipline
|
|
95
|
+
|
|
96
|
+
`implement` defaults to parallel mode unless the human explicitly requests sequential execution. Persist the requested and effective mode in the execution journal. Parallel mode is permission to schedule ready work concurrently, not a requirement to create workers: when fewer than two safe executable nodes are ready, execute in the main agent without worker overhead. Bound workers by the minimum of ready nodes, host capacity, and the approved workflow maximum of 3.
|
|
97
|
+
|
|
98
|
+
The main agent is the only scheduler and operational owner of every phase integration worktree. Workers never spawn workers, mutate `.cadre/**`, merge, resolve integration conflicts, delete worktrees, or record human approval. Treat the track as a hierarchical DAG: phase dependencies determine active phases, task dependencies determine ready tasks inside each running phase, and main allocates the global worker bound across all ready work. Different phases may run different modes concurrently. Inside one phase, use direct main execution for one ready task, a temporary phase-worker lease for a tightly coupled sequential chain when delegation is justified, or task-worker fan-out for two or more independent ready tasks.
|
|
99
|
+
|
|
100
|
+
A phase has one mutating execution mode at a time but may switch modes at a clean, journaled checkpoint. Before fan-out, the phase worker finishes and records the current task, verifies the phase worktree is clean, reports its HEAD, releases its lease through a `running`-to-`running` phase update with `workerId: null`, and remains inactive. Main creates each task worktree from that recorded phase HEAD and integrates approved branches one at a time. Only after every active task worker is completed and its integration/cleanup recorded may main assign a phase worker again. A phase/task worker edits product files only in its assigned absolute worktree, runs focused verification, returns a structured diff/evidence/learning summary, and waits for main-agent human approval before creating Conventional Commits.
|
|
101
|
+
|
|
102
|
+
Before creating workers, main performs a host-permission preflight from the approved plan, repository scripts, lockfiles, and likely checks. Host security permission and Cadre lifecycle approval are separate: a shell, network, listener, or filesystem prompt does not approve an artifact, commit, merge, verification result, or journal transition. Reuse already-approved commands and prefixes; centralize shared installs, registry access, image pulls, and code generation; use locked/offline worker commands where supported; and request a new permission only for one exact necessary operation with a narrow reusable prefix. Do not chain unrelated privilege levels, repeat equivalent commands, or use scaffolding modes that create nested repositories requiring destructive cleanup. A worker that encounters an unexpected permission stops and reports the exact command to main.
|
|
103
|
+
|
|
104
|
+
Cadre worktrees use sibling namespaces because one worktree cannot safely contain another:
|
|
105
|
+
|
|
106
|
+
```text
|
|
107
|
+
.cadre/.worktrees/<track>/<execution>/phases/P1
|
|
108
|
+
.cadre/.worktrees/<track>/<execution>/tasks/P1--t1-1
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Git ancestry comes from the recorded base commit, not directory nesting. All independent task workers in one dependency wave branch from the same clean phase HEAD; after their approved merges, the next wave branches from the updated phase HEAD. A task-worker branch merges without squashing into the registered phase integration worktree when one exists. Direct canonical integration is reserved for an explicitly main-coordinated single-task phase; multi-task or phase-verified delivery creates a phase integration worktree first. Tasks executed internally by a phase worker are already on that phase branch and do not get a redundant task merge. Phase branches merge without squashing, one at a time, into the canonical branch. The main agent performs every preview/apply gate and journal transition. A worker commit is recorded immediately in the execution journal; the plan task becomes complete only after canonical integration and records that reachable worker commit SHA.
|
|
112
|
+
|
|
113
|
+
1. Load this workflow and the full current track. Validate the DAG and reconcile the execution journal, Git worktrees, branch tips, dirty files, and recent commits before scheduling.
|
|
114
|
+
2. Root phases read the marked Pattern Seed. Every other phase reads learning from all declared dependency phases; parallel sibling phases do not assume each other's learning.
|
|
115
|
+
3. Derive ready phases and tasks from completed dependencies, combine ready tasks from every running phase into one global queue, and allocate workers by the critical path, downstream work unblocked, then plan order. When one approved decision yields multiple transitions that are already valid, use the ordered `execution_nodes_preview`/`execution_nodes_apply` batch. Never batch across a human approval, commit, verification, integration, conflict resolution, or other external evidence boundary.
|
|
116
|
+
4. Follow read-before-edit and keep every worker limited to its assigned node and worktree.
|
|
117
|
+
5. Write/update tests and documentation required by the spec and Definition of Done.
|
|
118
|
+
6. Run focused checks per task, combined phase checks after task integration, and the relevant broader suite after conflict resolution, phase integration, and before track verification.
|
|
119
|
+
7. Present every worker diff and evidence through the main agent. A worker commits only after explicit human approval. A phase worker checkpoints one regular task at a time: it returns that task's uncommitted diff, then creates only that task's Conventional Commit after approval and waits for main to record the distinct SHA before starting the next task. Manual-verification nodes may reuse approved phase-head or merge evidence instead of creating empty commits.
|
|
120
|
+
8. Resolve task conflicts in the phase integration worktree and phase conflicts in the canonical worktree. Present the resolution and rerun combined verification; never let the leaf worker silently resolve integration conflicts.
|
|
121
|
+
9. Phase-level manual verification becomes ready only after every sibling task is integrated. Run its technical evidence in the phase worktree through the phase worker when present, otherwise through main; the human approval is always mediated and recorded by main before phase integration. A phase remains `running` until all sibling tasks and this barrier are `completed`; journal-gated integration and cleanup must not run early.
|
|
122
|
+
10. Track-level manual verification becomes ready only after every phase is integrated and is executed entirely by the main agent in the canonical worktree.
|
|
123
|
+
11. Remove a worktree with `git worktree remove` and delete its branch without force only after clean, recorded integration. Never delete dirty, conflicted, unintegrated, or mismatched work.
|
|
124
|
+
12. Append dependency-aware phase learning. Do not overwrite earlier learning.
|
|
125
|
+
|
|
126
|
+
## Definition of Done
|
|
127
|
+
|
|
128
|
+
A task is done when its approved outcome exists, relevant tests cover success/failure/edge cases, checks pass or documented exceptions are approved, formatting and repository conventions are satisfied, docs are updated, no unrelated changes are included, artifacts were shown to the human, and commit provenance is recorded.
|
|
129
|
+
|
|
130
|
+
A phase is done when all tasks are integrated, phase learning is recorded, combined verification passes, and its final User Manual Verification is explicitly approved. A track is ready for review only after all execution nodes are complete, all worker branches are integrated, all worktrees are removed, the journal is finalized, and track-level manual verification is approved in main. It is completed only after an approved clean review bound to the current execution ID, plan revision, graph digest, and reviewed HEAD.
|
|
131
|
+
|
|
132
|
+
## Review and remediation
|
|
133
|
+
|
|
134
|
+
Review acceptance criteria, non-functional requirements, diffs, callers, tests, security, compatibility, error paths, and learning claims. Present findings before recording them. Approved findings go in `bugs/bug-<review-ts>.md`; insert dependency-aware remediation phases before the single final track-level verification phase, ending each with manual verification. Reset the final barrier to pending while preserving its prior evidence in the review cycle and completed execution journal. A replacement execution carries already-completed plan nodes forward from their commit provenance and schedules only pending work. Set the track back to `in_progress`. A clean cycle records the current execution ID, plan revision, graph digest, and reviewed HEAD. Repeat implement/review until a clean review is approved.
|
|
135
|
+
|
|
136
|
+
## Revisions, refreshes, and cascading impact
|
|
137
|
+
|
|
138
|
+
`revise` is callable at any point, with these state-specific semantics:
|
|
139
|
+
|
|
140
|
+
- In `drafting-spec`, continue the interrupted or active `track` specification flow. There is no approved baseline yet, so do not create a revision entry.
|
|
141
|
+
- In `drafting-plan`, a change to the approved specification is a revision; a change only to the unapproved plan continues the `track` planning flow.
|
|
142
|
+
- In `planned`, revise the approved baseline and remain `planned`.
|
|
143
|
+
- In `in_progress`, first reconcile any operation and active or dirty task work. Preserve completed tasks and commits, supersede rather than erase affected work, and remain `in_progress` when all dependencies are satisfied. Return to `planned` when a newly approved dependency is incomplete.
|
|
144
|
+
- In `ready_for_review`, use `review` for defects against the approved specification. Use `revise` for a changed desired outcome, scope, requirement, or acceptance criterion; invalidate review readiness, append the necessary delivery and manual-verification work, and return to `in_progress`, or `planned` when an approved dependency is incomplete.
|
|
145
|
+
- In `completed` or `archived`, keep the track immutable and propose a successor feature or bug track that references it. Do not reopen it or rewrite its clean-review history.
|
|
146
|
+
|
|
147
|
+
A semantic revision requires an approved specification baseline and no unresolved non-revision operation. Reconcile a matching revision journal before doing new work. If active implementation or dirty work overlaps the revision, present its exact state and obtain approval to complete, preserve as superseded, or revert it before applying the revision.
|
|
148
|
+
|
|
149
|
+
Every approved semantic revision gets `revisions/revision-<ts>.md` and a track-local `operation.action` of `revise` before artifact mutation. Increment the track revision once per approved revision; increment the specification revision only when the specification changes and the plan revision only when the plan changes. A revision must record its source and target status, base commit, affected phases/tasks, treatment of completed and partial work, review-readiness impact, and transitive dependency impact. Preserve completed-work provenance and append replacement work rather than erasing history.
|
|
150
|
+
|
|
151
|
+
Every project refresh gets `refreshes/refresh-<ts>.md`. Assess transitive dependent tracks whenever a spec, acceptance criterion, dependency, workflow, pattern, tech-stack, or styleguide change may affect them. Present all cascading changes for approval before mutation. Preserve superseded content and completed-work provenance rather than erasing history.
|
|
152
|
+
|
|
153
|
+
## Archival and learning
|
|
154
|
+
|
|
155
|
+
Archive one or more selected completed tracks in one approved batch. Require `completed` status and clean centralized state validation; do not recompute the DAG, manual-verification barriers, or review evidence inside archive. Validate the whole selection before mutation, distill the selected learning as one corpus into patterns with source track/task/commit provenance, reconcile it with existing patterns, then propose relevant reseeding for all active tracks. Journal the ordered selection and per-track/artifact progress, move each full track directory to `archive/`, validate once, and commit the batch together. Never discard history or start another archive batch while one is incomplete.
|
|
156
|
+
|
|
157
|
+
## Git safety and commits
|
|
158
|
+
|
|
159
|
+
- Use Conventional Commits for product work.
|
|
160
|
+
- Cadre-only state commits use `cadre(<command>): <description>`.
|
|
161
|
+
- Do not mix unrelated work into a task commit.
|
|
162
|
+
- Prefer additive `git revert` commits. Do not rewrite shared history or use destructive reset/checkout as the default revert mechanism.
|
|
163
|
+
- Do not overwrite dirty user changes. Stop and explain overlap.
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
"artifactProgress": [],
|
|
13
|
+
"approvedAt": "{{APPROVED_AT}}",
|
|
14
|
+
"archiveCommit": null
|
|
15
|
+
}
|
|
@@ -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,14 @@
|
|
|
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
|
+
"artifactProgress": [],
|
|
12
|
+
"approvedAt": "{{APPROVED_AT}}",
|
|
13
|
+
"refreshCommit": null
|
|
14
|
+
}
|
|
@@ -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/)
|