@zcy2nn/agent-forge 1.1.3 → 1.1.5

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 (58) hide show
  1. package/README.md +188 -247
  2. package/agent-forge.schema.json +2 -265
  3. package/dist/agents/orchestrator.d.ts +1 -1
  4. package/dist/cli/index.js +90 -259
  5. package/dist/cli/providers.d.ts +0 -44
  6. package/dist/cli/types.d.ts +0 -2
  7. package/dist/config/constants.d.ts +3 -8
  8. package/dist/config/index.d.ts +0 -1
  9. package/dist/config/loader.d.ts +1 -1
  10. package/dist/config/schema.d.ts +1 -184
  11. package/dist/hooks/index.d.ts +0 -6
  12. package/dist/hooks/json-error-recovery/hook.d.ts +1 -1
  13. package/dist/hooks/todo-continuation/index.d.ts +2 -1
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.js +7875 -31853
  16. package/dist/tools/index.d.ts +0 -3
  17. package/dist/tui.js +5 -61
  18. package/dist/utils/index.d.ts +0 -2
  19. package/package.json +95 -104
  20. package/src/skills/brainstorming/SKILL.md +185 -186
  21. package/src/skills/brainstorming/scripts/frame-template.html +214 -214
  22. package/src/skills/brainstorming/scripts/server.cjs +354 -354
  23. package/src/skills/brainstorming/spec-document-reviewer-prompt.md +1 -1
  24. package/src/skills/requesting-code-review/SKILL.md +1 -1
  25. package/src/skills/subagent-driven-development/SKILL.md +1 -1
  26. package/src/skills/systematic-debugging/SKILL.md +318 -318
  27. package/src/skills/test-driven-development/SKILL.md +392 -392
  28. package/src/skills/verification-before-completion/SKILL.md +153 -153
  29. package/src/skills/writing-plans/SKILL.md +2 -2
  30. package/src/skills/writing-skills/graphviz-conventions.dot +171 -171
  31. package/dist/agents/council.d.ts +0 -27
  32. package/dist/agents/councillor.d.ts +0 -2
  33. package/dist/agents/designer.d.ts +0 -2
  34. package/dist/agents/explorer.d.ts +0 -2
  35. package/dist/agents/fixer.d.ts +0 -2
  36. package/dist/agents/implementer.d.ts +0 -2
  37. package/dist/agents/librarian.d.ts +0 -2
  38. package/dist/agents/observer.d.ts +0 -2
  39. package/dist/agents/oracle.d.ts +0 -2
  40. package/dist/agents/reviewer.d.ts +0 -2
  41. package/dist/cli/migration.d.ts +0 -46
  42. package/dist/config/council-schema.d.ts +0 -127
  43. package/dist/council/council-manager.d.ts +0 -49
  44. package/dist/council/index.d.ts +0 -1
  45. package/dist/hooks/phase-reminder/index.d.ts +0 -26
  46. package/dist/hooks/post-file-tool-nudge/index.d.ts +0 -19
  47. package/dist/skills/systematic-debugging/condition-based-waiting-example.d.ts +0 -51
  48. package/dist/tools/council.d.ts +0 -10
  49. package/src/skills/codemap/README.md +0 -59
  50. package/src/skills/codemap/SKILL.md +0 -163
  51. package/src/skills/codemap/codemap.md +0 -36
  52. package/src/skills/codemap/scripts/codemap.mjs +0 -483
  53. package/src/skills/codemap/scripts/codemap.test.ts +0 -129
  54. package/src/skills/codemap.md +0 -40
  55. package/src/skills/simplify/README.md +0 -19
  56. package/src/skills/simplify/SKILL.md +0 -138
  57. package/src/skills/simplify/codemap.md +0 -36
  58. package/src/skills/using-git-worktrees/SKILL.md +0 -226
@@ -1,138 +0,0 @@
1
- ---
2
- name: simplify
3
- description: Simplifies code for clarity without changing behavior. Use for readability, maintainability, and complexity reduction after behavior is understood.
4
- ---
5
-
6
- # Code Simplification
7
-
8
- ## Overview
9
-
10
- Simplify code by reducing complexity while preserving exact behavior. The goal is not fewer lines — it's code that is easier to read, understand, modify, and debug. Every simplification must pass a simple test: "Would a new team member understand this faster than the original?"
11
-
12
- ## When to Use
13
-
14
- - After a feature is working and tests pass, but the implementation feels heavier than it needs to be
15
- - During code review when readability or complexity issues are flagged
16
- - When you encounter deeply nested logic, long functions, or unclear names
17
- - When refactoring code written under time pressure
18
- - When consolidating related logic scattered across files
19
- - After merging changes that introduced duplication or inconsistency
20
-
21
- **When NOT to use:**
22
-
23
- - Code is already clean and readable — don't simplify for the sake of it
24
- - You don't understand what the code does yet — comprehend before you simplify
25
- - The code is performance-critical and the "simpler" version would be measurably slower
26
- - You're about to rewrite the module entirely — simplifying throwaway code wastes effort
27
-
28
- ## The Five Principles
29
-
30
- ### 1. Preserve Behavior Exactly
31
-
32
- Don't change what the code does — only how it expresses it. All inputs, outputs, side effects, error behavior, and edge cases must remain identical. If you're not sure a simplification preserves behavior, don't make it.
33
-
34
- Before every change, ask:
35
-
36
- - Does this produce the same output for every input?
37
- - Does this maintain the same error behavior?
38
- - Does this preserve the same side effects and ordering?
39
- - Do all existing tests still pass without modification?
40
-
41
- ### 2. Follow Project Conventions
42
-
43
- Simplification means making code more consistent with the codebase, not imposing external preferences.
44
-
45
- Before simplifying:
46
-
47
- 1. Read `AGENTS.md` / project conventions
48
- 2. Study how neighboring code handles similar patterns
49
- 3. Match the project's style for imports, naming, function style, error handling, and type annotations
50
-
51
- Simplification that breaks project consistency is not simplification — it's churn.
52
-
53
- ### 3. Prefer Clarity Over Cleverness
54
-
55
- Explicit code is better than compact code when the compact version requires a mental pause to parse.
56
-
57
- - Replace nested ternaries with readable control flow
58
- - Replace dense inline transforms with named intermediate steps when they clarify intent
59
- - Keep helpful names even if they cost a few extra lines
60
-
61
- ### 4. Maintain Balance
62
-
63
- Watch for over-simplification:
64
-
65
- - Don't inline away names that carry meaning
66
- - Don't merge unrelated logic into one larger function
67
- - Don't remove abstractions that serve testability or extensibility
68
- - Don't optimize for line count over comprehension
69
-
70
- ### 5. Scope to What Changed
71
-
72
- Default to simplifying recently modified code. Avoid unrelated drive-by refactors unless explicitly asked.
73
-
74
- ## Process
75
-
76
- ### Step 1: Understand Before Touching
77
-
78
- Before changing or removing anything, understand why it exists.
79
-
80
- Answer:
81
-
82
- - What is this code's responsibility?
83
- - What calls it? What does it call?
84
- - What are the edge cases and error paths?
85
- - Are there tests that define expected behavior?
86
- - Why might it have been written this way?
87
-
88
- If you can't answer these, read more context first.
89
-
90
- ### Step 2: Look for Simplification Opportunities
91
-
92
- Signals:
93
-
94
- - Deep nesting
95
- - Long functions with mixed responsibilities
96
- - Nested ternaries
97
- - Boolean flag arguments
98
- - Repeated conditionals
99
- - Generic or misleading names
100
- - Duplicated logic
101
- - Dead code
102
- - Wrappers or abstractions that add no value
103
-
104
- ### Step 3: Apply Changes Incrementally
105
-
106
- Make one simplification at a time.
107
-
108
- For each simplification:
109
-
110
- 1. Make the change
111
- 2. Run relevant tests
112
- 3. Keep it only if behavior is preserved
113
-
114
- Separate refactoring from feature work whenever possible.
115
-
116
- ### Step 4: Verify the Result
117
-
118
- After simplifying, confirm:
119
-
120
- - The code is genuinely easier to understand
121
- - The diff is clean and reviewable
122
- - Project conventions still match
123
- - No behavior, error handling, or side effects changed
124
-
125
- ## Guidance for This Repository
126
-
127
- - Prefer straightforward TypeScript over clever compression
128
- - Preserve existing runtime behavior, tests, and hooks
129
- - Favor explicit names and smaller focused helpers when they improve readability
130
- - Keep refactors tightly scoped to the task or review feedback
131
-
132
- ## Verification Checklist
133
-
134
- - [ ] Existing tests pass without modification
135
- - [ ] Build/typecheck/lint still pass
136
- - [ ] No unrelated files were refactored
137
- - [ ] No error handling was weakened or removed
138
- - [ ] The result is simpler to review than the original
@@ -1,36 +0,0 @@
1
- # src/skills/simplify/
2
-
3
- ## Responsibility
4
-
5
- - Provide a behavior-preserving refactoring skill contract that constrains code cleanup to clarity-focused,
6
- low-risk changes.
7
- - Define explicit quality gates (understand-before-edit, behavior parity, incremental simplification, rollback-friendly diffs)
8
- for any simplification task.
9
- - Ship only metadata; no local runtime state machine is kept in this directory.
10
-
11
- ## Design
12
-
13
- - Contract layer: `SKILL.md` is the executable prompt specification with explicit phases:
14
- - pre-change understanding
15
- - simplification candidate selection
16
- - incremental transformation and verification
17
- - final review checklist.
18
- - Documentation layer: `README.md` explains intent, source provenance, and plugin install behavior.
19
- - Policy model is declarative (`description`, allowed usage, checklist) consumed by the OpenCode skill executor,
20
- without helper scripts or plugin code dependencies.
21
-
22
- ## Flow
23
-
24
- - Agent discovery resolves `src/skills/simplify` as a custom skill entrypoint, then reads `SKILL.md` at runtime.
25
- - Runtime behavior is gated by `src/cli/custom-skills.ts` (`allowedAgents: ['reviewer']`) and by skill permissions
26
- computed in `getSkillPermissionsForAgent()`.
27
- - In practice the workflow is read-only and context-driven: simplify instructions require understanding of callers,
28
- edge cases, and tests before mutation, then apply local, scoped refactors with validation.
29
- - Consumers (Implementer/Reviewer tasks) rely on this contract as operational constraints, not as executable TypeScript.
30
-
31
- ## Integration
32
-
33
- - Installed by plugin installer (`installCustomSkills`) using `src/cli/install.ts` via `installCustomSkill()`.
34
- - Permission surface is enforced by hook layer in `src/hooks/filter-available-skills/index.ts` (`permissionRules`).
35
- - Release integrity: `scripts/verify-release-artifact.ts` checks for `src/skills/simplify/SKILL.md` in package tarballs.
36
- - Operationally paired with codemap/implementer flows in `src/index.ts` orchestrations for post-feature readability hardening.
@@ -1,226 +0,0 @@
1
- ---
2
- name: using-git-worktrees
3
- description: Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification
4
- ---
5
-
6
- # Using Git Worktrees
7
-
8
- ## Overview
9
-
10
- Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.
11
-
12
- **Core principle:** Systematic directory selection + safety verification = reliable isolation.
13
-
14
- **Announce at start:** "I'm using the using-git-worktrees skill to set up an isolated workspace."
15
-
16
- ## Directory Selection Process
17
-
18
- Follow this priority order:
19
-
20
- ### 1. Check Existing Directories
21
-
22
- ```bash
23
- # Check in priority order
24
- ls -d .worktrees 2>/dev/null # Preferred (hidden)
25
- ls -d worktrees 2>/dev/null # Alternative
26
- ```
27
-
28
- **If found:** Use that directory. If both exist, `.worktrees` wins.
29
-
30
- ### 2. Check CLAUDE.md
31
-
32
- ```bash
33
- grep -i "worktree.*director" CLAUDE.md 2>/dev/null
34
- ```
35
-
36
- **If preference specified:** Use it without asking.
37
-
38
- ### 3. Ask User
39
-
40
- If no directory exists and no CLAUDE.md preference:
41
-
42
- ```
43
- No worktree directory found. Where should I create worktrees?
44
-
45
- 1. .worktrees/ (project-local, hidden)
46
- 2. ~/.config/superpowers/worktrees/<project-name>/ (global location)
47
-
48
- Which would you prefer?
49
- ```
50
-
51
- ## Safety Verification
52
-
53
- ### For Project-Local Directories (.worktrees or worktrees)
54
-
55
- **MUST verify directory is ignored before creating worktree:**
56
-
57
- ```bash
58
- # Check if directory is ignored (respects local, global, and system gitignore)
59
- git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null
60
- ```
61
-
62
- **If NOT ignored:**
63
-
64
- Per Jesse's rule "Fix broken things immediately":
65
- 1. Add appropriate line to .gitignore
66
- 2. Commit the change
67
- 3. Proceed with worktree creation
68
-
69
- **Why critical:** Prevents accidentally committing worktree contents to repository.
70
-
71
- ### For Global Directory (~/.config/superpowers/worktrees)
72
-
73
- No .gitignore verification needed - outside project entirely.
74
-
75
- ## Creation Steps
76
-
77
- ### 1. Detect Project Name
78
-
79
- ```bash
80
- project=$(basename "$(git rev-parse --show-toplevel)")
81
- ```
82
-
83
- ### 2. Create Worktree
84
-
85
- ```bash
86
- # Determine full path
87
- case $LOCATION in
88
- .worktrees|worktrees)
89
- path="$LOCATION/$BRANCH_NAME"
90
- ;;
91
- ~/.config/superpowers/worktrees/*)
92
- path="~/.config/superpowers/worktrees/$project/$BRANCH_NAME"
93
- ;;
94
- esac
95
-
96
- # Create worktree with new branch
97
- git worktree add "$path" -b "$BRANCH_NAME"
98
- cd "$path"
99
- ```
100
-
101
- ### 3. Run Project Setup
102
-
103
- Auto-detect and run appropriate setup:
104
-
105
- ```bash
106
- # Node.js
107
- if [ -f package.json ]; then npm install; fi
108
-
109
- # Rust
110
- if [ -f Cargo.toml ]; then cargo build; fi
111
-
112
- # Python
113
- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
114
- if [ -f pyproject.toml ]; then poetry install; fi
115
-
116
- # Go
117
- if [ -f go.mod ]; then go mod download; fi
118
- ```
119
-
120
- ### 4. Verify Clean Baseline
121
-
122
- Run tests to ensure worktree starts clean:
123
-
124
- ```bash
125
- # Examples - use project-appropriate command
126
- npm test
127
- cargo test
128
- pytest
129
- go test ./...
130
- ```
131
-
132
- **If tests fail:** Report failures, ask whether to proceed or investigate.
133
-
134
- **If tests pass:** Report ready.
135
-
136
- ### 5. Report Location
137
-
138
- ```
139
- Worktree ready at <full-path>
140
- Tests passing (<N> tests, 0 failures)
141
- Ready to implement <feature-name>
142
- ```
143
-
144
- ## Quick Reference
145
-
146
- | Situation | Action |
147
- |-----------|--------|
148
- | `.worktrees/` exists | Use it (verify ignored) |
149
- | `worktrees/` exists | Use it (verify ignored) |
150
- | Both exist | Use `.worktrees/` |
151
- | Neither exists | Check CLAUDE.md → Ask user |
152
- | Directory not ignored | Add to .gitignore + commit |
153
- | Tests fail during baseline | Report failures + ask |
154
- | No package.json/Cargo.toml | Skip dependency install |
155
-
156
- ## Common Mistakes
157
-
158
- ### Skipping ignore verification
159
-
160
- - **Problem:** Worktree contents get tracked, pollute git status
161
- - **Fix:** Always use `git check-ignore` before creating project-local worktree
162
-
163
- ### Assuming directory location
164
-
165
- - **Problem:** Creates inconsistency, violates project conventions
166
- - **Fix:** Follow priority: existing > CLAUDE.md > ask
167
-
168
- ### Proceeding with failing tests
169
-
170
- - **Problem:** Can't distinguish new bugs from pre-existing issues
171
- - **Fix:** Report failures, get explicit permission to proceed
172
-
173
- ### Hardcoding setup commands
174
-
175
- - **Problem:** Breaks on projects using different tools
176
- - **Fix:** Auto-detect from project files (package.json, etc.)
177
-
178
- ## Example Workflow
179
-
180
- ```
181
- You: I'm using the using-git-worktrees skill to set up an isolated workspace.
182
-
183
- [Check .worktrees/ - exists]
184
- [Verify ignored - git check-ignore confirms .worktrees/ is ignored]
185
- [Create worktree: git worktree add .worktrees/auth -b feature/auth]
186
- [Run npm install]
187
- [Run npm test - 47 passing]
188
-
189
- Worktree ready at /Users/jesse/myproject/.worktrees/auth
190
- Tests passing (47 tests, 0 failures)
191
- Ready to implement auth feature
192
- ```
193
-
194
- ## Red Flags
195
-
196
- **Never:**
197
- - Create worktree without verifying it's ignored (project-local)
198
- - Skip baseline test verification
199
- - Proceed with failing tests without asking
200
- - Assume directory location when ambiguous
201
- - Skip CLAUDE.md check
202
-
203
- **Always:**
204
- - Follow directory priority: existing > CLAUDE.md > ask
205
- - Verify directory is ignored for project-local
206
- - Auto-detect and run project setup
207
- - Verify clean test baseline
208
-
209
- ## Complexity Assessment
210
-
211
- **Lightweight usage:**
212
- - Create worktree in default directory, skip safety verification
213
-
214
- **Standard usage:**
215
- - Directory selection → safety verification → create → project setup → verify baseline
216
-
217
- ## Integration
218
-
219
- **Called by:**
220
- - **brainstorming** (Phase 4) - REQUIRED when design is approved and implementation follows
221
- - **subagent-driven-development** - REQUIRED before executing any tasks
222
- - **executing-plans** - REQUIRED before executing any tasks
223
- - Any skill needing isolated workspace
224
-
225
- **Pairs with:**
226
- - **finishing-a-development-branch** - REQUIRED for cleanup after work complete