compound-workflow 1.0.0 → 1.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/README.md CHANGED
@@ -131,7 +131,7 @@ Full detail: [src/AGENTS.md](src/AGENTS.md), [src/.agents/commands/](src/.agents
131
131
 
132
132
  Commands are the public API. Skills and agents are invoked by commands; you don’t call them directly.
133
133
 
134
- - **Workflow skills:** `brainstorming`, `file-todos`, `compound-docs`, `document-review`, `technical-review`, `git-worktree`, `agent-browser`, `process-metrics`, `xstate-actor-orchestration`.
134
+ - **Workflow skills:** `brainstorming`, `file-todos`, `compound-docs`, `document-review`, `technical-review`, `git-worktree`, `agent-browser`, `process-metrics`, `react-ddd-mvc-frontend`, `xstate-actor-orchestration`.
135
135
  - **State orchestration:** Use a state-orchestration skill when complexity exceeds simple local state (e.g. `xstate-actor-orchestration` per Skill Index)—UI container-as-orchestrator flows, backend/internal actor orchestration, receptionist/child-actor patterns, retries/timeouts/cancellation, or boolean-flag sprawl.
136
136
  - **Skill-local metadata:** Some skills may include tool-specific metadata under `src/.agents/skills/<skill>/agents/` (for example `openai.yaml`) when required by skill validation/runtime.
137
137
  - **Guardrail standards:** `data-foundations`, `pii-protection-prisma`, `financial-workflow-integrity`, `audit-traceability` — applied when work touches multi-tenant data, PII, money, or audit.
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"compound-workflow","version":"1.0.0","description":"Clarify → plan → execute → verify → capture. One Install action for Cursor, Claude, and OpenCode.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/cjerochim/compound-workflow.git"},"bin":{"compound-workflow":"scripts/install-cli.mjs"},"files":["src","scripts",".cursor-plugin",".claude-plugin","skills"],"engines":{"node":">=18"},"devDependencies":{"@semantic-release/git":"^10.0.1","@semantic-release/npm":"^13.1.4","semantic-release":"^25.0.3"}}
1
+ {"name":"compound-workflow","version":"1.0.1","description":"Clarify → plan → execute → verify → capture. One Install action for Cursor, Claude, and OpenCode.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/cjerochim/compound-workflow.git"},"bin":{"compound-workflow":"scripts/install-cli.mjs"},"files":["src","scripts",".cursor-plugin",".claude-plugin","skills"],"engines":{"node":">=18"},"devDependencies":{"@semantic-release/git":"^10.0.1","@semantic-release/npm":"^13.1.4","semantic-release":"^25.0.3"}}
@@ -7,6 +7,7 @@
7
7
  import fs from "node:fs";
8
8
  import path from "node:path";
9
9
  import { fileURLToPath } from "node:url";
10
+ import { spawnSync } from "node:child_process";
10
11
 
11
12
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
12
13
 
@@ -175,6 +176,12 @@ function readJsonMaybe(fileAbs) {
175
176
  return JSON.parse(stripJsonc(raw));
176
177
  }
177
178
 
179
+ function hasCommand(cmd) {
180
+ const checker = process.platform === "win32" ? "where" : "which";
181
+ const result = spawnSync(checker, [cmd], { stdio: "ignore" });
182
+ return result.status === 0;
183
+ }
184
+
178
185
  const SKILLS_SYMLINK_PATH = ".agents/compound-workflow-skills";
179
186
 
180
187
  function ensureSkillsSymlink(targetRoot, dryRun) {
@@ -341,6 +348,27 @@ function writeOpenCodeJson(targetRoot, dryRun) {
341
348
  console.log("Wrote:", opencodeAbs);
342
349
  }
343
350
 
351
+ function reportOpenCodeIntegration(targetRoot, dryRun) {
352
+ const opencodeAbs = path.join(targetRoot, "opencode.json");
353
+ const skillsLinkAbs = path.join(targetRoot, SKILLS_SYMLINK_PATH);
354
+
355
+ if (dryRun) {
356
+ console.log("[dry-run] OpenCode integration check skipped.");
357
+ return;
358
+ }
359
+
360
+ const opencode = readJsonMaybe(opencodeAbs) ?? {};
361
+ const skillPaths = Array.isArray(opencode?.skills?.paths) ? opencode.skills.paths : [];
362
+ const hasSkillsPath = skillPaths.includes(SKILLS_SYMLINK_PATH);
363
+ const hasSkillsLink = fs.existsSync(skillsLinkAbs);
364
+
365
+ console.log(
366
+ "OpenCode integration:",
367
+ hasSkillsPath && hasSkillsLink ? "ok" : "incomplete",
368
+ `(skills.path=${hasSkillsPath ? "yes" : "no"}, symlink=${hasSkillsLink ? "yes" : "no"})`
369
+ );
370
+ }
371
+
344
372
  function extractRepoConfigBlock(md) {
345
373
  const match = md.match(/(### Repo Config Block[^\n]*\n)?\s*```yaml\n([\s\S]*?)```/);
346
374
  if (!match) return { block: null, rest: md };
@@ -421,9 +449,11 @@ function main() {
421
449
 
422
450
  console.log("Target root:", targetRoot);
423
451
  console.log("Package root:", packageRoot);
452
+ console.log("OpenCode CLI detected:", hasCommand("opencode") ? "yes" : "no");
424
453
 
425
454
  writeOpenCodeJson(targetRoot, args.dryRun);
426
455
  ensureSkillsSymlink(targetRoot, args.dryRun);
456
+ reportOpenCodeIntegration(targetRoot, args.dryRun);
427
457
  ensureCursorIntegration(targetRoot, args.dryRun);
428
458
  writeAgentsMd(targetRoot, args.dryRun);
429
459
  ensureDirs(targetRoot, args.dryRun);
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: react-ddd-mvc-frontend
3
+ description: Apply React frontend architecture standards using a DDD + MVC hybrid. Use when planning or reviewing frontend work to enforce domain-based feature structure, clear layer boundaries, composable pure components, container-driven composition, and XState controller integration.
4
+ ---
5
+
6
+ # React DDD + MVC Frontend Standards
7
+
8
+ Use this skill as a reference standard during brainstorming, planning, implementation, and code review for frontend work.
9
+
10
+ ## Workflow
11
+
12
+ 1. Confirm frontend applicability.
13
+ - Use this skill when work changes React UI architecture, feature structure, components, containers, hooks, services, or controller state flow.
14
+ - Skip when no frontend surface is affected.
15
+
16
+ 2. Load standards baseline.
17
+ - Start with [references/source-map.md](references/source-map.md).
18
+ - Load [references/feature-structure.md](references/feature-structure.md) and [references/responsibility-gates.md](references/responsibility-gates.md) first.
19
+
20
+ 3. Enforce feature-by-domain structure.
21
+ - Group items into domains.
22
+ - Default location: `src/features/<feature-name>/`.
23
+ - Allow shared concerns under `src/features/common/` only when genuinely cross-domain.
24
+
25
+ 4. Enforce DDD + MVC boundaries.
26
+ - Keep domain entities in `domain/entities`.
27
+ - Keep presentation concerns in `presentation`.
28
+ - Keep orchestration and composition in `application`.
29
+ - Keep IO adapters in `infrastructure`.
30
+
31
+ 5. Apply controller/machine guidance.
32
+ - Controllers are XState machines in `application/controller`.
33
+ - For XState orchestration patterns, defer to `xstate-actor-orchestration`.
34
+
35
+ 6. Apply coding style constraints.
36
+ - Prefer immutability and functional patterns.
37
+ - Apply YAGNI to avoid speculative abstractions.
38
+ - Optimize for simplicity, maintainability, and readability.
39
+
40
+ ## Output Contract
41
+
42
+ When used in planning:
43
+ - Use applicable MUST gates as a checklist to shape acceptance criteria.
44
+ - Call out any boundary exceptions and rationale.
45
+
46
+ When used in review:
47
+ - Report MUST violations as high-priority findings by default.
48
+ - Report SHOULD violations as improvement findings.
49
+
50
+ When used in brainstorm/work:
51
+ - Use the structure and gates as reference guidance, not as a hard precondition.
@@ -0,0 +1,25 @@
1
+ # Feature Structure (DDD + MVC Hybrid)
2
+
3
+ Default structure for each frontend feature:
4
+
5
+ ```text
6
+ src/features/<feature-name>/
7
+ application/
8
+ containers/
9
+ controller/
10
+ domain/
11
+ entities/
12
+ presentation/
13
+ components/
14
+ layout/
15
+ infrastructure/
16
+ services/
17
+ mock-services/
18
+ ```
19
+
20
+ ## Notes
21
+
22
+ - Group work by domain.
23
+ - Use `src/features/common/` only for cross-domain shared concerns.
24
+ - Keep the shape consistent across features unless there is a clear, documented reason to deviate.
25
+
@@ -0,0 +1,21 @@
1
+ # Implementation Principles
2
+
3
+ ## Hooks
4
+
5
+ - Use hooks to provide common access patterns and shared feature wiring.
6
+ - Keep hooks focused and reusable; avoid mixing unrelated responsibilities.
7
+
8
+ ## Immutability and Functional Style
9
+
10
+ - Prefer immutable updates and pure transformations.
11
+ - Avoid hidden in-place mutation across layers.
12
+
13
+ ## Simplicity (YAGNI)
14
+
15
+ - Do not add speculative abstractions or layers before they are needed.
16
+ - Optimize for readability and maintainability over cleverness.
17
+
18
+ ## Boundary Reminder
19
+
20
+ - If a change requires complex machine orchestration, use `xstate-actor-orchestration` as the source of truth for machine patterns.
21
+
@@ -0,0 +1,41 @@
1
+ # Responsibility Gates
2
+
3
+ Apply these gates as default guidance in planning and review.
4
+ Use pragmatic judgment and allow justified deviations when context requires.
5
+
6
+ ## MUST Gates
7
+
8
+ 1. Feature placement:
9
+ - Frontend feature code is placed in `src/features/<feature-name>/` using the canonical layer layout.
10
+
11
+ 2. Presentation purity:
12
+ - `presentation/components` remain composable and controlled/pure.
13
+ - UI components do not perform API calls or domain decision logic.
14
+
15
+ 3. Container ownership:
16
+ - `application/containers` own composition, state wiring, translations, and context wiring.
17
+
18
+ 4. Controller ownership:
19
+ - `application/controller` contains XState machine controllers for feature state flow.
20
+ - Any advanced orchestration patterns defer to `xstate-actor-orchestration`.
21
+
22
+ 5. Domain isolation:
23
+ - `domain/entities` owns domain entities and related core domain representation.
24
+
25
+ 6. Infrastructure isolation:
26
+ - `infrastructure/services` and `infrastructure/mock-services` own IO integrations and test/mock adapters.
27
+
28
+ ## SHOULD Gates
29
+
30
+ 1. Reuse hooks for common access patterns instead of duplicating wiring logic.
31
+ 2. Keep files single-purpose and avoid multi-layer mixing in one module.
32
+ 3. Keep naming consistent with feature and domain language.
33
+
34
+ ## Planning Gate
35
+
36
+ - Use applicable MUST gates to inform acceptance criteria.
37
+
38
+ ## Review Gate
39
+
40
+ - MUST violations are high-priority by default.
41
+ - SHOULD violations are non-blocking unless repeated patterns create maintainability risk.
@@ -0,0 +1,11 @@
1
+ # Source Map
2
+
3
+ Load these references as needed:
4
+
5
+ - Feature folder and canonical layout:
6
+ - [feature-structure.md](feature-structure.md)
7
+ - Layer responsibilities and review gates:
8
+ - [responsibility-gates.md](responsibility-gates.md)
9
+ - Hooks, immutability, and simplicity rules:
10
+ - [implementation-principles.md](implementation-principles.md)
11
+
package/src/AGENTS.md CHANGED
@@ -86,6 +86,9 @@ High-risk triggers include: security, payments, privacy, data migration/backfill
86
86
  ## Routing Rules
87
87
 
88
88
  - **Capability-first in commands:** Core workflow command docs should name capabilities (problem shape), not specific libraries. Concrete skill resolution comes from the Skill Index.
89
+ - **Centralized skill routing:** Add new domain/reference skill routing in this file (Skill Index + rules) rather than hard-coding per-skill logic into each workflow command, except for rare high-criticality cases.
90
+ - **Default skill selection order:** (1) safety/guardrail standards when applicable, (2) domain architecture/reference skills, (3) workflow execution skills. Choose the minimal set that covers the problem.
91
+ - **Explain selection:** When selecting skills, state which skills were selected and why.
89
92
  - Prefer existing project patterns before introducing new ones.
90
93
  - Always run local repo + institutional learnings research first for planning.
91
94
  - Run external best-practice/framework research based on fidelity and risk.
@@ -144,7 +147,7 @@ worktree_bootstrap_notes:
144
147
  ## Implemented Components (Current Scope)
145
148
 
146
149
  - Commands: `workflow:brainstorm`, `workflow:plan`, `workflow:work`, `workflow:triage`, `workflow:review`, `workflow:compound` (under `.agents/commands/workflow/`), plus `test-browser`, `metrics`, `assess`, `setup`, `sync` (root commands)
147
- - Skills: `brainstorming`, `document-review`, `technical-review`, `compound-docs` (alias: `compound_doc`), `file-todos`, `agent-browser`, `git-worktree`, `process-metrics`, `xstate-actor-orchestration`, `pii-protection-prisma`, `financial-workflow-integrity`, `audit-traceability`, `data-foundations`
150
+ - Skills: `brainstorming`, `document-review`, `technical-review`, `compound-docs` (alias: `compound_doc`), `file-todos`, `agent-browser`, `git-worktree`, `process-metrics`, `react-ddd-mvc-frontend`, `xstate-actor-orchestration`, `pii-protection-prisma`, `financial-workflow-integrity`, `audit-traceability`, `data-foundations`
148
151
  - Agents:
149
152
  - `repo-research-analyst`
150
153
  - `learnings-researcher`
@@ -204,6 +207,7 @@ Maintenance:
204
207
  | `agent-browser` | You need to inspect available agents/skills and route deterministically. |
205
208
  | `git-worktree` | You need isolated parallel work (review/feature) using git worktrees. |
206
209
  | `process-metrics` | You want to log and assess session performance and process improvements. |
210
+ | `react-ddd-mvc-frontend` | You need React frontend architecture guidance (DDD + MVC hybrid) during planning or review to enforce feature structure, layer boundaries, composable pure components, container/controller responsibilities, and maintainable patterns. |
207
211
  | `xstate-actor-orchestration` | You are evaluating complexity and need explicit state orchestration: React container-as-orchestrator for UI flows, or actor/state-machine orchestration for backend/internal workflows (especially multi-step async branching, retries/timeouts/cancellation, receptionist/child-actor coordination, or boolean-flag sprawl). |
208
212
 
209
213
  ### Reference standards (guardrails)