claude-everything-workflow 0.1.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 (99) hide show
  1. package/AGENTS.md +36 -0
  2. package/CLAUDE.md +7 -0
  3. package/LICENSE +22 -0
  4. package/README.md +369 -0
  5. package/agents/architect.md +59 -0
  6. package/agents/code-reviewer.md +57 -0
  7. package/agents/database-reviewer.md +44 -0
  8. package/agents/e2e-runner.md +153 -0
  9. package/agents/harness-optimizer.md +92 -0
  10. package/agents/planner.md +124 -0
  11. package/agents/refactor-cleaner.md +54 -0
  12. package/agents/security-reviewer.md +47 -0
  13. package/agents/tdd-guide.md +101 -0
  14. package/bin/claude-everything-workflow.js +91 -0
  15. package/commands/code-review.md +27 -0
  16. package/commands/e2e.md +28 -0
  17. package/commands/evolve.md +42 -0
  18. package/commands/harness-audit.md +27 -0
  19. package/commands/instinct-status.md +38 -0
  20. package/commands/learn-eval.md +91 -0
  21. package/commands/pr.md +88 -0
  22. package/commands/projects.md +27 -0
  23. package/commands/promote.md +29 -0
  24. package/commands/prune.md +46 -0
  25. package/commands/tdd.md +27 -0
  26. package/commands/verify.md +93 -0
  27. package/homunculus/instincts/personal/always-test-first.md +28 -0
  28. package/homunculus/instincts/personal/pr-ci-quality-gate.md +30 -0
  29. package/hooks/check-console-log.js +37 -0
  30. package/hooks/commit-quality.js +143 -0
  31. package/hooks/evaluate-session.js +59 -0
  32. package/hooks/pre-compact.js +92 -0
  33. package/hooks/runtime/hook-flags.js +40 -0
  34. package/hooks/runtime/run-with-flags.js +141 -0
  35. package/hooks/runtime/session-utils.js +45 -0
  36. package/hooks/session-end.js +62 -0
  37. package/hooks/session-start.js +60 -0
  38. package/package.json +48 -0
  39. package/references/agents/database-reviewer.md +657 -0
  40. package/references/agents/refactor-cleaner.md +75 -0
  41. package/references/agents/security-reviewer.md +542 -0
  42. package/rules/01-base.md +49 -0
  43. package/rules/02-code-size.md +13 -0
  44. package/rules/03-architecture.md +64 -0
  45. package/rules/04-error-handling.md +27 -0
  46. package/rules/05-git-workflow.md +56 -0
  47. package/rules/06-comments.md +44 -0
  48. package/rules/07-forbidden.md +43 -0
  49. package/rules/08-ecc-integration.md +46 -0
  50. package/rules/common/agent-orchestration.md +54 -0
  51. package/rules/common/context-hygiene.md +85 -0
  52. package/rules/common/harness-engineering.md +46 -0
  53. package/rules/common/hooks.md +87 -0
  54. package/rules/common/implementation.md +25 -0
  55. package/rules/common/performance.md +71 -0
  56. package/rules/common/pr-automation.md +73 -0
  57. package/rules/common/security.md +19 -0
  58. package/rules/common/skills-learning.md +39 -0
  59. package/rules/common/testing.md +68 -0
  60. package/scripts/install.ps1 +286 -0
  61. package/scripts/install.sh +214 -0
  62. package/scripts/learning/migrate-homunculus.js +93 -0
  63. package/scripts/learning/project-utils.js +214 -0
  64. package/scripts/learning/projects.js +60 -0
  65. package/scripts/learning/promote.js +98 -0
  66. package/scripts/learning/review-confidence.js +455 -0
  67. package/scripts/verify-harness.js +868 -0
  68. package/settings.json +77 -0
  69. package/skills/brainstorming/SKILL.md +185 -0
  70. package/skills/brainstorming/agents/openai.yaml +3 -0
  71. package/skills/brainstorming/scripts/frame-template.html +214 -0
  72. package/skills/brainstorming/scripts/helper.js +88 -0
  73. package/skills/brainstorming/scripts/server.cjs +354 -0
  74. package/skills/brainstorming/scripts/start-server.sh +148 -0
  75. package/skills/brainstorming/scripts/stop-server.sh +56 -0
  76. package/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  77. package/skills/brainstorming/visual-companion.md +287 -0
  78. package/skills/continuous-learning-v2/SKILL.md +74 -0
  79. package/skills/continuous-learning-v2/agents/observer.md +129 -0
  80. package/skills/continuous-learning-v2/agents/start-observer.sh +83 -0
  81. package/skills/continuous-learning-v2/config.json +58 -0
  82. package/skills/continuous-learning-v2/hooks/observe-v2.js +144 -0
  83. package/skills/documentation-lookup/SKILL.md +90 -0
  84. package/skills/e2e-testing/SKILL.md +326 -0
  85. package/skills/executing-plans/SKILL.md +66 -0
  86. package/skills/find-skills/SKILL.md +142 -0
  87. package/skills/skill-creator/LICENSE.txt +202 -0
  88. package/skills/skill-creator/SKILL.md +356 -0
  89. package/skills/skill-creator/references/output-patterns.md +82 -0
  90. package/skills/skill-creator/references/workflows.md +28 -0
  91. package/skills/skill-creator/scripts/init_skill.py +303 -0
  92. package/skills/skill-creator/scripts/package_skill.py +110 -0
  93. package/skills/skill-creator/scripts/quick_validate.py +95 -0
  94. package/skills/systematic-debugging/SKILL.md +59 -0
  95. package/skills/test-driven-development/SKILL.md +71 -0
  96. package/skills/using-git-worktrees/SKILL.md +64 -0
  97. package/skills/verification-before-completion/SKILL.md +77 -0
  98. package/skills/writing-plans/SKILL.md +183 -0
  99. package/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: using-git-worktrees
3
+ description: Use before implementing substantial plans when work should be isolated from the current checkout, especially multi-step features, risky refactors, parallel agent work, or when the current worktree has unrelated user changes.
4
+ ---
5
+
6
+ # Using Git Worktrees
7
+
8
+ Reference: https://github.com/obra/superpowers
9
+
10
+ Use a git worktree when implementation needs isolation without disturbing the user's current checkout. Keep this skill lightweight: inspect first, create only when it materially reduces risk.
11
+
12
+ ## Preconditions
13
+
14
+ - Use only inside a git repository.
15
+ - Do not create a worktree for simple single-file edits, documentation tweaks, or quick read-only analysis.
16
+ - Never discard or overwrite existing user changes.
17
+ - If the current worktree has unrelated changes and the task requires broad edits, prefer a new worktree.
18
+
19
+ ## Flow
20
+
21
+ 1. Inspect repository state.
22
+
23
+ ```bash
24
+ git status --short
25
+ git branch --show-current
26
+ git rev-parse --show-toplevel
27
+ ```
28
+
29
+ 2. Choose a branch name with the project convention. For Codex-managed branches, prefer `codex/<short-task-name>` unless the user requested another name.
30
+
31
+ 3. Create the worktree from the current `HEAD` or an explicit base branch.
32
+
33
+ ```bash
34
+ git worktree add ../<repo-name>-<short-task-name> -b codex/<short-task-name>
35
+ ```
36
+
37
+ 4. Run setup in the new worktree only when the project requires it. Do not reinstall dependencies if the project already supports shared caches or the task is docs-only.
38
+
39
+ 5. Do all implementation, testing, and review inside the worktree. Keep the original checkout untouched except for user-approved coordination changes.
40
+
41
+ 6. Before finishing, report:
42
+ - worktree path
43
+ - branch name
44
+ - base commit or base branch
45
+ - commands run
46
+ - remaining cleanup, if any
47
+
48
+ ## Cleanup
49
+
50
+ After the branch is merged, abandoned, or the user asks to clean up:
51
+
52
+ ```bash
53
+ git worktree list
54
+ git worktree remove <worktree-path>
55
+ git branch -d codex/<short-task-name>
56
+ ```
57
+
58
+ Use `git branch -D` only when the user explicitly confirms deleting an unmerged branch.
59
+
60
+ ## Safety
61
+
62
+ - Do not run destructive cleanup from a computed path unless the absolute target path has been verified.
63
+ - Do not create nested worktrees inside another worktree.
64
+ - Do not use worktrees as a substitute for understanding the current dirty state; inspect first.
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: verification-before-completion
3
+ description: Use before claiming work is complete, fixed, passing, ready for PR, or moving to the next task. Requires fresh verification evidence from this turn, with exact commands, results, skipped checks, and remaining risk.
4
+ ---
5
+
6
+ # Verification Before Completion
7
+
8
+ Use this skill before any success or completion claim.
9
+
10
+ Core rule: do not say work is complete, fixed, passing, or ready unless fresh verification evidence from this turn supports that claim.
11
+
12
+ ## Gate
13
+
14
+ Before making a completion claim:
15
+
16
+ 1. Identify the smallest command or manual check that proves the claim.
17
+ 2. Run the full relevant command now, unless the environment makes it impossible.
18
+ 3. Read the output and exit code.
19
+ 4. Compare the result against the exact claim.
20
+ 5. Report the claim only with evidence.
21
+
22
+ If verification cannot run, say that it was not run and explain the remaining risk. Do not replace evidence with confidence.
23
+
24
+ ## Claims And Required Evidence
25
+
26
+ | Claim | Required evidence |
27
+ | --- | --- |
28
+ | Tests pass | Fresh test command output with exit code 0 or an exact pass count |
29
+ | Build succeeds | Fresh build command output with exit code 0 |
30
+ | Lint is clean | Fresh lint command output with zero reported errors |
31
+ | Bug is fixed | Fresh reproduction or regression test showing the original symptom no longer occurs |
32
+ | Task is complete | Spec, plan, or user request checklist verified against the changed files |
33
+ | Ready for `/pr` | `/verify` or equivalent checks with skipped checks and risks stated |
34
+ | Agent work is done | Independent inspection of the diff and required verification, not only the agent report |
35
+
36
+ ## Red Flags
37
+
38
+ Stop and verify before using language like:
39
+
40
+ - "完成了"
41
+ - "已修复"
42
+ - "通过了"
43
+ - "可以提交"
44
+ - "ready"
45
+ - "should pass"
46
+ - "looks good"
47
+ - "应该没问题"
48
+
49
+ ## Failed Or Partial Verification
50
+
51
+ If verification fails:
52
+
53
+ 1. State the exact failing command and result.
54
+ 2. Use `skills/systematic-debugging/SKILL.md` before changing code.
55
+ 3. Re-run the relevant verification after the fix.
56
+
57
+ If verification is partial:
58
+
59
+ 1. State what passed.
60
+ 2. State what did not run and why.
61
+ 3. State what risk remains.
62
+ 4. Avoid broader completion claims than the evidence supports.
63
+
64
+ ## Reporting Format
65
+
66
+ Use this compact format in final summaries and task checkpoints:
67
+
68
+ ```text
69
+ 验证:
70
+ - <command>: <passed/failed/not run> — <evidence>
71
+
72
+ 未运行:
73
+ - <check>: <reason>
74
+
75
+ 剩余风险:
76
+ - <risk or "无已知剩余风险">
77
+ ```
@@ -0,0 +1,183 @@
1
+ ---
2
+ name: writing-plans
3
+ description: Use when you have a spec or requirements for a multi-step task, before touching code
4
+ ---
5
+
6
+ # Writing Plans
7
+
8
+ ## Overview
9
+
10
+ Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Verification checkpoints.
11
+
12
+ Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well.
13
+
14
+ **Announce at start:** "I'm using the writing-plans skill to create the implementation plan."
15
+
16
+ **Context:** If working in an isolated worktree, it should be created via `skills/using-git-worktrees/SKILL.md` at execution time.
17
+
18
+ **Save plans to:** `docs/superpowers/plans/YYYY-MM-DD-<feature-name>.md`
19
+ - (User preferences for plan location override this default)
20
+
21
+ ## Preconditions
22
+
23
+ Only write an implementation plan after a design spec exists and the user has approved it. If the request is complex and no approved spec exists, return to `skills/brainstorming/SKILL.md` instead of creating a plan. The approved spec is the Plan Gate input.
24
+
25
+ ## Scope Check
26
+
27
+ If the spec covers multiple independent subsystems, it should have been broken into sub-project specs during brainstorming. If it wasn't, suggest breaking this into separate plans — one per subsystem. Each plan should produce working, testable software on its own.
28
+
29
+ ## File Structure
30
+
31
+ Before defining tasks, map out which files will be created or modified and what each one is responsible for. This is where decomposition decisions get locked in.
32
+
33
+ - Design units with clear boundaries and well-defined interfaces. Each file should have one clear responsibility.
34
+ - You reason best about code you can hold in context at once, and your edits are more reliable when files are focused. Prefer smaller, focused files over large ones that do too much.
35
+ - Files that change together should live together. Split by responsibility, not by technical layer.
36
+ - In existing codebases, follow established patterns. If the codebase uses large files, don't unilaterally restructure - but if a file you're modifying has grown unwieldy, including a split in the plan is reasonable.
37
+
38
+ This structure informs the task decomposition. Each task should produce self-contained changes that make sense independently.
39
+
40
+ ## Bite-Sized Task Granularity
41
+
42
+ **Each step is one action (2-5 minutes):**
43
+ - "Write the failing test" - step
44
+ - "Run it to make sure it fails" - step
45
+ - "Implement the minimal code to make the test pass" - step
46
+ - "Run the tests and make sure they pass" - step
47
+ - "Inspect the diff and record status" - step
48
+
49
+ Do not include commit steps by default. Add `git add` or `git commit` steps only when the user explicitly asks for commit handling, or when an approved workflow already says this plan is allowed to create commits.
50
+
51
+ ## Plan Document Header
52
+
53
+ **Every plan MUST start with this header:**
54
+
55
+ ```markdown
56
+ # [Feature Name] Implementation Plan
57
+
58
+ > **For agentic workers:** Implement this plan task-by-task. Keep checkbox (`- [ ]`) status updated. For substantial plans, prefer the project-agent loop: one fresh implementation subagent per task, then requirement/spec compliance review, then code quality review.
59
+
60
+ **Goal:** [One sentence describing what this builds]
61
+
62
+ **Architecture:** [2-3 sentences about approach]
63
+
64
+ **Tech Stack:** [Key technologies/libraries]
65
+
66
+ ---
67
+ ```
68
+
69
+ ## Task Structure
70
+
71
+ ````markdown
72
+ ### Task N: [Component Name]
73
+
74
+ **Files:**
75
+ - Create: `exact/path/to/file.py`
76
+ - Modify: `exact/path/to/existing.py:123-145`
77
+ - Test: `tests/exact/path/to/test.py`
78
+
79
+ - [ ] **Step 1: Write the failing test**
80
+
81
+ ```python
82
+ def test_specific_behavior():
83
+ result = function(input)
84
+ assert result == expected
85
+ ```
86
+
87
+ - [ ] **Step 2: Run test to verify it fails**
88
+
89
+ Run: `pytest tests/path/test.py::test_name -v`
90
+ Expected: FAIL with "function not defined"
91
+
92
+ - [ ] **Step 3: Write minimal implementation**
93
+
94
+ ```python
95
+ def function(input):
96
+ return expected
97
+ ```
98
+
99
+ - [ ] **Step 4: Run test to verify it passes**
100
+
101
+ Run: `pytest tests/path/test.py::test_name -v`
102
+ Expected: PASS
103
+
104
+ - [ ] **Step 5: Inspect the diff**
105
+
106
+ ```bash
107
+ git diff -- tests/path/test.py src/path/file.py
108
+ git status --short
109
+ ```
110
+ ````
111
+
112
+ ## No Placeholders
113
+
114
+ Every step must contain the actual content an engineer needs. These are **plan failures** — never write them:
115
+ - "TBD", "TODO", "implement later", "fill in details"
116
+ - "Add appropriate error handling" / "add validation" / "handle edge cases"
117
+ - "Write tests for the above" (without actual test code)
118
+ - "Similar to Task N" (repeat the code — the engineer may be reading tasks out of order)
119
+ - Steps that describe what to do without showing how (code blocks required for code steps)
120
+ - References to types, functions, or methods not defined in any task
121
+
122
+ ## Remember
123
+ - Exact file paths always
124
+ - Complete code in every step — if a step changes code, show the code
125
+ - Exact commands with expected output
126
+ - DRY, YAGNI, TDD, verification checkpoints
127
+ - Do not default to commits; leave changes uncommitted unless the user explicitly asks for commit, push, PR, or an approved workflow includes commit handling.
128
+
129
+ ## Self-Review
130
+
131
+ After writing the complete plan, look at the spec with fresh eyes and check the plan against it. This is a checklist you run yourself — not a subagent dispatch.
132
+
133
+ **1. Spec coverage:** Skim each section/requirement in the spec. Can you point to a task that implements it? List any gaps.
134
+
135
+ **2. Placeholder scan:** Search your plan for red flags — any of the patterns from the "No Placeholders" section above. Fix them.
136
+
137
+ **3. Type consistency:** Do the types, method signatures, and property names you used in later tasks match what you defined in earlier tasks? A function called `clearLayers()` in Task 3 but `clearFullLayers()` in Task 7 is a bug.
138
+
139
+ If you find issues, fix them inline. No need to re-review — just fix and move on. If you find a spec requirement with no task, add the task.
140
+
141
+ ## Execution Handoff
142
+
143
+ After saving the plan, offer execution choice:
144
+
145
+ **"Plan complete and saved to `docs/superpowers/plans/<filename>.md`. If you want me to execute it, I will use `skills/executing-plans/SKILL.md`. Two execution options:**
146
+
147
+ **1. Project-Agent Loop (recommended for substantial plans)** - Use this project's existing agents. Dispatch one fresh implementation subagent per task, then run two reviews before marking the task complete.
148
+
149
+ **2. Inline Execution (lightweight)** - Execute tasks in this session, task-by-task, with checkpoints. Use this for small, clear, tightly coupled work.
150
+
151
+ **Which approach?"**
152
+
153
+ **If Project-Agent Loop chosen:**
154
+ - Read the full plan once and extract each task with its files, tests, commands, and acceptance criteria.
155
+ - For each task, dispatch a fresh implementation subagent with only that task plus the necessary project context. Before dispatching, read the matching `agents/*.md` file and use its role, process, and constraints as the subagent prompt. In runtimes that do not expose custom agent names directly, dispatch a generic worker and seed it with the selected project-agent prompt.
156
+ - Pick the implementation agent by task shape:
157
+ - `agents/tdd-guide.md` for new behavior, bug fixes, or behavior changes that need tests first
158
+ - `agents/refactor-cleaner.md` for focused refactors
159
+ - `agents/e2e-runner.md` for Playwright or user-flow verification tasks
160
+ - a general worker if no specialized project agent fits
161
+ - Review stage 1: requirement/spec compliance. Use `agents/planner.md` or a generic review worker seeded with the spec and plan. Compare the implementation against the spec and this plan before judging style. If there is a gap, send it back to the same task implementer.
162
+ - Review stage 2: code quality. Use `agents/code-reviewer.md`, plus `agents/security-reviewer.md` or `agents/database-reviewer.md` when the touched area warrants it. If issues remain, send them back to the same task implementer and re-review.
163
+ - Mark the task checkbox complete only after tests pass and both review stages pass.
164
+
165
+ **If Inline Execution chosen:**
166
+ - Execute the plan in the current session.
167
+ - Keep the same order: implement one task, run its tests, do a requirement/spec compliance check, do a code quality check, then update the checkbox.
168
+
169
+ ## Debugging Detour
170
+
171
+ If any task hits a bug, failing test, flaky behavior, or unexpected result, pause implementation and use `skills/systematic-debugging/SKILL.md`.
172
+
173
+ Do not stack quick fixes. Complete the four debugging phases, document the root cause briefly in the task notes, then return to the same task and re-run its required verification.
174
+
175
+ ## Completion Loop
176
+
177
+ After all plan tasks are complete:
178
+
179
+ 1. Apply `skills/verification-before-completion/SKILL.md`: identify the verification evidence required before any completion claim.
180
+ 2. Run the project's verification flow (`/verify` or equivalent commands) to produce that fresh evidence.
181
+ 3. If verification fails, use `skills/systematic-debugging/SKILL.md` for each failure class before changing code.
182
+ 4. Run a final code review over the whole diff using `agents/code-reviewer.md`, adding `agents/security-reviewer.md` or `agents/database-reviewer.md` when relevant.
183
+ 5. Use `/pr` when the user wants commit, push, or PR handling.
@@ -0,0 +1,49 @@
1
+ # Plan Document Reviewer Prompt Template
2
+
3
+ Use this template when dispatching a plan document reviewer subagent.
4
+
5
+ **Purpose:** Verify the plan is complete, matches the spec, and has proper task decomposition.
6
+
7
+ **Dispatch after:** The complete plan is written.
8
+
9
+ ```
10
+ Task tool (general-purpose):
11
+ description: "Review plan document"
12
+ prompt: |
13
+ You are a plan document reviewer. Verify this plan is complete and ready for implementation.
14
+
15
+ **Plan to review:** [PLAN_FILE_PATH]
16
+ **Spec for reference:** [SPEC_FILE_PATH]
17
+
18
+ ## What to Check
19
+
20
+ | Category | What to Look For |
21
+ |----------|------------------|
22
+ | Completeness | TODOs, placeholders, incomplete tasks, missing steps |
23
+ | Spec Alignment | Plan covers spec requirements, no major scope creep |
24
+ | Task Decomposition | Tasks have clear boundaries, steps are actionable |
25
+ | Buildability | Could an engineer follow this plan without getting stuck? |
26
+
27
+ ## Calibration
28
+
29
+ **Only flag issues that would cause real problems during implementation.**
30
+ An implementer building the wrong thing or getting stuck is an issue.
31
+ Minor wording, stylistic preferences, and "nice to have" suggestions are not.
32
+
33
+ Approve unless there are serious gaps — missing requirements from the spec,
34
+ contradictory steps, placeholder content, or tasks so vague they can't be acted on.
35
+
36
+ ## Output Format
37
+
38
+ ## Plan Review
39
+
40
+ **Status:** Approved | Issues Found
41
+
42
+ **Issues (if any):**
43
+ - [Task X, Step Y]: [specific issue] - [why it matters for implementation]
44
+
45
+ **Recommendations (advisory, do not block approval):**
46
+ - [suggestions for improvement]
47
+ ```
48
+
49
+ **Reviewer returns:** Status, Issues (if any), Recommendations