From ef645c0f40614319b8c8fff0bf303c5ac1cef26c Mon Sep 17 00:00:00 2001 From: wangziqi Date: Thu, 2 Jul 2026 12:22:49 +0800 Subject: [PATCH] fix: resolve 3 review findings (permission codes, profile guard, JSDoc) --- .claude/commands/opsx/apply.md | 155 +++ .claude/commands/opsx/archive.md | 160 +++ .claude/commands/opsx/bulk-archive.md | 244 ++++ .claude/commands/opsx/continue.md | 117 ++ .claude/commands/opsx/explore.md | 174 +++ .claude/commands/opsx/ff.md | 100 ++ .claude/commands/opsx/new.md | 71 + .claude/commands/opsx/onboard.md | 550 ++++++++ .claude/commands/opsx/propose.md | 109 ++ .claude/commands/opsx/sync.md | 143 ++ .claude/commands/opsx/verify.md | 167 +++ .claude/skills/brainstorming/SKILL.md | 159 +++ .../brainstorming/scripts/frame-template.html | 213 +++ .../skills/brainstorming/scripts/helper.js | 167 +++ .../skills/brainstorming/scripts/server.cjs | 723 +++++++++++ .../brainstorming/scripts/start-server.sh | 209 +++ .../brainstorming/scripts/stop-server.sh | 120 ++ .../spec-document-reviewer-prompt.md | 49 + .../skills/brainstorming/visual-companion.md | 291 +++++ .../dispatching-parallel-agents/SKILL.md | 185 +++ .claude/skills/executing-plans/SKILL.md | 70 + .../finishing-a-development-branch/SKILL.md | 241 ++++ .claude/skills/openspec-apply-change/SKILL.md | 159 +++ .../skills/openspec-archive-change/SKILL.md | 117 ++ .../openspec-bulk-archive-change/SKILL.md | 248 ++++ .../skills/openspec-continue-change/SKILL.md | 121 ++ .claude/skills/openspec-explore/SKILL.md | 289 +++++ .claude/skills/openspec-ff-change/SKILL.md | 104 ++ .claude/skills/openspec-new-change/SKILL.md | 76 ++ .claude/skills/openspec-onboard/SKILL.md | 554 ++++++++ .claude/skills/openspec-propose/SKILL.md | 113 ++ .claude/skills/openspec-sync-specs/SKILL.md | 147 +++ .../skills/openspec-verify-change/SKILL.md | 171 +++ .claude/skills/receiving-code-review/SKILL.md | 213 +++ .../skills/requesting-code-review/SKILL.md | 103 ++ .../requesting-code-review/code-reviewer.md | 172 +++ .../subagent-driven-development/SKILL.md | 418 ++++++ .../implementer-prompt.md | 139 ++ .../scripts/review-package | 44 + .../scripts/sdd-workspace | 22 + .../scripts/task-brief | 40 + .../task-reviewer-prompt.md | 188 +++ .../systematic-debugging/CREATION-LOG.md | 119 ++ .claude/skills/systematic-debugging/SKILL.md | 296 +++++ .../condition-based-waiting-example.ts | 158 +++ .../condition-based-waiting.md | 115 ++ .../systematic-debugging/defense-in-depth.md | 122 ++ .../systematic-debugging/find-polluter.sh | 63 + .../root-cause-tracing.md | 169 +++ .../systematic-debugging/test-academic.md | 14 + .../systematic-debugging/test-pressure-1.md | 58 + .../systematic-debugging/test-pressure-2.md | 68 + .../systematic-debugging/test-pressure-3.md | 69 + .../skills/test-driven-development/SKILL.md | 371 ++++++ .../testing-anti-patterns.md | 299 +++++ .claude/skills/using-git-worktrees/SKILL.md | 202 +++ .claude/skills/using-superpowers/SKILL.md | 62 + .../references/antigravity-tools.md | 23 + .../references/codex-tools.md | 39 + .../using-superpowers/references/pi-tools.md | 16 + .../verification-before-completion/SKILL.md | 139 ++ .claude/skills/writing-plans/SKILL.md | 174 +++ .../plan-document-reviewer-prompt.md | 49 + .claude/skills/writing-skills/SKILL.md | 689 ++++++++++ .../anthropic-best-practices.md | 1150 +++++++++++++++++ .../examples/CLAUDE_MD_TESTING.md | 189 +++ .../writing-skills/graphviz-conventions.dot | 172 +++ .../writing-skills/persuasion-principles.md | 187 +++ .../skills/writing-skills/render-graphs.js | 168 +++ .../testing-skills-with-subagents.md | 384 ++++++ backend/src/auth/auth.controller.ts | 1 + .../auth/decorators/permission.decorator.ts | 4 +- backend/src/rbac/rbac.service.ts | 1 + .../specs/2026-07-02-rbac-refactor-design.md | 703 ++++++++++ frontend/src/pages/Classrooms/index.tsx | 2 +- frontend/src/pages/Expenses/index.tsx | 4 +- frontend/src/pages/Occupancies/index.tsx | 2 +- frontend/src/pages/Rooms/index.tsx | 2 +- openspec/changes/rbac-refactor/.openspec.yaml | 2 + openspec/changes/rbac-refactor/design.md | 161 +++ openspec/changes/rbac-refactor/proposal.md | 31 + openspec/config.yaml | 20 + package-lock.json | 1127 ++++++++++++++++ package.json | 5 + skills-lock.json | 89 ++ 85 files changed, 15566 insertions(+), 7 deletions(-) create mode 100644 .claude/commands/opsx/apply.md create mode 100644 .claude/commands/opsx/archive.md create mode 100644 .claude/commands/opsx/bulk-archive.md create mode 100644 .claude/commands/opsx/continue.md create mode 100644 .claude/commands/opsx/explore.md create mode 100644 .claude/commands/opsx/ff.md create mode 100644 .claude/commands/opsx/new.md create mode 100644 .claude/commands/opsx/onboard.md create mode 100644 .claude/commands/opsx/propose.md create mode 100644 .claude/commands/opsx/sync.md create mode 100644 .claude/commands/opsx/verify.md create mode 100644 .claude/skills/brainstorming/SKILL.md create mode 100644 .claude/skills/brainstorming/scripts/frame-template.html create mode 100644 .claude/skills/brainstorming/scripts/helper.js create mode 100644 .claude/skills/brainstorming/scripts/server.cjs create mode 100755 .claude/skills/brainstorming/scripts/start-server.sh create mode 100755 .claude/skills/brainstorming/scripts/stop-server.sh create mode 100644 .claude/skills/brainstorming/spec-document-reviewer-prompt.md create mode 100644 .claude/skills/brainstorming/visual-companion.md create mode 100644 .claude/skills/dispatching-parallel-agents/SKILL.md create mode 100644 .claude/skills/executing-plans/SKILL.md create mode 100644 .claude/skills/finishing-a-development-branch/SKILL.md create mode 100644 .claude/skills/openspec-apply-change/SKILL.md create mode 100644 .claude/skills/openspec-archive-change/SKILL.md create mode 100644 .claude/skills/openspec-bulk-archive-change/SKILL.md create mode 100644 .claude/skills/openspec-continue-change/SKILL.md create mode 100644 .claude/skills/openspec-explore/SKILL.md create mode 100644 .claude/skills/openspec-ff-change/SKILL.md create mode 100644 .claude/skills/openspec-new-change/SKILL.md create mode 100644 .claude/skills/openspec-onboard/SKILL.md create mode 100644 .claude/skills/openspec-propose/SKILL.md create mode 100644 .claude/skills/openspec-sync-specs/SKILL.md create mode 100644 .claude/skills/openspec-verify-change/SKILL.md create mode 100644 .claude/skills/receiving-code-review/SKILL.md create mode 100644 .claude/skills/requesting-code-review/SKILL.md create mode 100644 .claude/skills/requesting-code-review/code-reviewer.md create mode 100644 .claude/skills/subagent-driven-development/SKILL.md create mode 100644 .claude/skills/subagent-driven-development/implementer-prompt.md create mode 100755 .claude/skills/subagent-driven-development/scripts/review-package create mode 100755 .claude/skills/subagent-driven-development/scripts/sdd-workspace create mode 100755 .claude/skills/subagent-driven-development/scripts/task-brief create mode 100644 .claude/skills/subagent-driven-development/task-reviewer-prompt.md create mode 100644 .claude/skills/systematic-debugging/CREATION-LOG.md create mode 100644 .claude/skills/systematic-debugging/SKILL.md create mode 100644 .claude/skills/systematic-debugging/condition-based-waiting-example.ts create mode 100644 .claude/skills/systematic-debugging/condition-based-waiting.md create mode 100644 .claude/skills/systematic-debugging/defense-in-depth.md create mode 100755 .claude/skills/systematic-debugging/find-polluter.sh create mode 100644 .claude/skills/systematic-debugging/root-cause-tracing.md create mode 100644 .claude/skills/systematic-debugging/test-academic.md create mode 100644 .claude/skills/systematic-debugging/test-pressure-1.md create mode 100644 .claude/skills/systematic-debugging/test-pressure-2.md create mode 100644 .claude/skills/systematic-debugging/test-pressure-3.md create mode 100644 .claude/skills/test-driven-development/SKILL.md create mode 100644 .claude/skills/test-driven-development/testing-anti-patterns.md create mode 100644 .claude/skills/using-git-worktrees/SKILL.md create mode 100644 .claude/skills/using-superpowers/SKILL.md create mode 100644 .claude/skills/using-superpowers/references/antigravity-tools.md create mode 100644 .claude/skills/using-superpowers/references/codex-tools.md create mode 100644 .claude/skills/using-superpowers/references/pi-tools.md create mode 100644 .claude/skills/verification-before-completion/SKILL.md create mode 100644 .claude/skills/writing-plans/SKILL.md create mode 100644 .claude/skills/writing-plans/plan-document-reviewer-prompt.md create mode 100644 .claude/skills/writing-skills/SKILL.md create mode 100644 .claude/skills/writing-skills/anthropic-best-practices.md create mode 100644 .claude/skills/writing-skills/examples/CLAUDE_MD_TESTING.md create mode 100644 .claude/skills/writing-skills/graphviz-conventions.dot create mode 100644 .claude/skills/writing-skills/persuasion-principles.md create mode 100755 .claude/skills/writing-skills/render-graphs.js create mode 100644 .claude/skills/writing-skills/testing-skills-with-subagents.md create mode 100644 docs/superpowers/specs/2026-07-02-rbac-refactor-design.md create mode 100644 openspec/changes/rbac-refactor/.openspec.yaml create mode 100644 openspec/changes/rbac-refactor/design.md create mode 100644 openspec/changes/rbac-refactor/proposal.md create mode 100644 openspec/config.yaml create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 skills-lock.json diff --git a/.claude/commands/opsx/apply.md b/.claude/commands/opsx/apply.md new file mode 100644 index 0000000..f540757 --- /dev/null +++ b/.claude/commands/opsx/apply.md @@ -0,0 +1,155 @@ +--- +name: "OPSX: Apply" +description: Implement tasks from an OpenSpec change (Experimental) +category: Workflow +tags: [workflow, artifacts, experimental] +--- + +Implement tasks from an OpenSpec change. + +**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store ` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`). Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root. + +**Input**: Optionally specify a change name (e.g., `/opsx:apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes. + +**Steps** + +1. **Select the change** + + If a name is provided, use it. Otherwise: + - Infer from conversation context if the user mentioned a change + - Auto-select if only one active change exists + - If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select + + Always announce: "Using change: " and how to override (e.g., `/opsx:apply `). + +2. **Check status to understand the schema** + ```bash + openspec status --change "" --json + ``` + Parse the JSON to understand: + - `schemaName`: The workflow being used (e.g., "spec-driven") + - `planningHome`, `changeRoot`, and `actionContext`: planning scope and edit constraints + - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others) + +3. **Get apply instructions** + + ```bash + openspec instructions apply --change "" --json + ``` + + This returns: + - `contextFiles`: artifact ID -> array of concrete file paths (varies by schema) + - Progress (total, complete, remaining) + - Task list with status + - Dynamic instruction based on current state + + **Handle states:** + - If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue` + - If `state: "all_done"`: congratulate, suggest archive + - Otherwise: proceed to implementation + +4. **Read context files** + + Read every file path listed under `contextFiles` from the apply instructions output. + The files depend on the schema being used: + - **spec-driven**: proposal, specs, design, tasks + - Other schemas: follow the contextFiles from CLI output + +5. **Show current progress** + + Display: + - Schema being used + - Progress: "N/M tasks complete" + - Remaining tasks overview + - Dynamic instruction from CLI + +6. **Implement tasks (loop until done or blocked)** + + For each pending task: + - Show which task is being worked on + - Make the code changes required + - Keep changes minimal and focused + - Mark task complete in the tasks file: `- [ ]` → `- [x]` + - Continue to next task + + **Pause if:** + - Task is unclear → ask for clarification + - Implementation reveals a design issue → suggest updating artifacts + - Error or blocker encountered → report and wait for guidance + - User interrupts + +7. **On completion or pause, show status** + + Display: + - Tasks completed this session + - Overall progress: "N/M tasks complete" + - If all done: suggest archive + - If paused: explain why and wait for guidance + +**Output During Implementation** + +``` +## Implementing: (schema: ) + +Working on task 3/7: +[...implementation happening...] +✓ Task complete + +Working on task 4/7: +[...implementation happening...] +✓ Task complete +``` + +**Output On Completion** + +``` +## Implementation Complete + +**Change:** +**Schema:** +**Progress:** 7/7 tasks complete ✓ + +### Completed This Session +- [x] Task 1 +- [x] Task 2 +... + +All tasks complete! You can archive this change with `/opsx:archive`. +``` + +**Output On Pause (Issue Encountered)** + +``` +## Implementation Paused + +**Change:** +**Schema:** +**Progress:** 4/7 tasks complete + +### Issue Encountered + + +**Options:** +1.