selfish-pipeline 1.1.0 → 1.2.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.
- package/.claude-plugin/marketplace.json +4 -4
- package/.claude-plugin/plugin.json +3 -5
- package/MIGRATION.md +46 -46
- package/README.md +20 -13
- package/agents/selfish-architect.md +8 -2
- package/agents/selfish-security.md +9 -2
- package/bin/cli.mjs +20 -20
- package/commands/analyze.md +76 -77
- package/commands/architect.md +90 -85
- package/commands/auto.md +231 -173
- package/commands/checkpoint.md +51 -51
- package/commands/clarify.md +53 -53
- package/commands/debug.md +69 -63
- package/commands/doctor.md +166 -0
- package/commands/implement.md +151 -95
- package/commands/init.md +195 -61
- package/commands/plan.md +114 -98
- package/commands/principles.md +62 -62
- package/commands/research.md +62 -62
- package/commands/resume.md +48 -47
- package/commands/review.md +135 -83
- package/commands/security.md +77 -76
- package/commands/spec.md +99 -83
- package/commands/tasks.md +84 -65
- package/commands/test.md +123 -0
- package/docs/critic-loop-rules.md +97 -0
- package/docs/nfr-templates.md +40 -0
- package/docs/phase-gate-protocol.md +44 -0
- package/hooks/hooks.json +36 -19
- package/package.json +3 -2
- package/scripts/pre-compact-checkpoint.sh +37 -33
- package/scripts/selfish-auto-format.sh +11 -11
- package/scripts/selfish-bash-guard.sh +33 -23
- package/scripts/selfish-config-change.sh +13 -13
- package/scripts/selfish-failure-hint.sh +23 -23
- package/scripts/selfish-notify.sh +19 -17
- package/scripts/selfish-parallel-validate.sh +158 -0
- package/scripts/selfish-permission-request.sh +18 -17
- package/scripts/selfish-pipeline-manage.sh +74 -11
- package/scripts/selfish-preflight-check.sh +102 -0
- package/scripts/selfish-session-end.sh +15 -15
- package/scripts/selfish-stop-gate.sh +31 -16
- package/scripts/selfish-subagent-context.sh +29 -15
- package/scripts/selfish-subagent-stop.sh +14 -14
- package/scripts/selfish-task-completed-gate.sh +17 -14
- package/scripts/selfish-teammate-idle.sh +13 -10
- package/scripts/selfish-timeline-log.sh +97 -0
- package/scripts/selfish-user-prompt-submit.sh +7 -7
- package/scripts/session-start-context.sh +20 -16
- package/scripts/track-selfish-changes.sh +13 -13
- package/templates/selfish.config.express-api.md +32 -32
- package/templates/selfish.config.monorepo.md +41 -41
- package/templates/selfish.config.nextjs-fsd.md +37 -37
- package/templates/selfish.config.react-spa.md +26 -26
- package/templates/selfish.config.template.md +37 -37
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
"email": "relee6203@gmail.com"
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
|
-
"description": "
|
|
9
|
-
"version": "1.
|
|
8
|
+
"description": "Automated pipeline for Claude Code — spec → plan → tasks → implement → review → clean",
|
|
9
|
+
"version": "1.2.0"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "selfish",
|
|
14
14
|
"source": "./",
|
|
15
|
-
"description": "Claude Code
|
|
16
|
-
"version": "1.
|
|
15
|
+
"description": "Automated pipeline for Claude Code. Automates the full development cycle: spec → plan → tasks → implement → review → clean.",
|
|
16
|
+
"version": "1.2.0",
|
|
17
17
|
"category": "automation",
|
|
18
18
|
"tags": ["pipeline", "automation", "spec", "plan", "implement", "review", "critic-loop"]
|
|
19
19
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "selfish",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Claude Code
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Automated pipeline for Claude Code. Automates the full development cycle: spec → plan → tasks → implement → review → clean.",
|
|
5
5
|
"author": { "name": "jhlee0409", "email": "relee6203@gmail.com" },
|
|
6
6
|
"homepage": "https://github.com/jhlee0409/selfish-pipeline",
|
|
7
7
|
"repository": "https://github.com/jhlee0409/selfish-pipeline",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"keywords": ["pipeline", "automation", "spec", "plan", "implement", "review", "critic-loop"],
|
|
10
|
-
"commands": "./commands/"
|
|
11
|
-
"hooks": "./hooks/hooks.json",
|
|
12
|
-
"agents": "./agents/"
|
|
10
|
+
"commands": "./commands/"
|
|
13
11
|
}
|
package/MIGRATION.md
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
# Migration Guide: install.sh → Plugin
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> A guide for migrating from the `git clone` + `install.sh` approach to the Claude Code plugin system.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Summary of Changes
|
|
6
6
|
|
|
7
|
-
|
|
|
8
|
-
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
| Hook
|
|
13
|
-
| Hook
|
|
14
|
-
|
|
|
7
|
+
| Item | Before | After |
|
|
8
|
+
|------|--------|-------|
|
|
9
|
+
| Installation | `git clone` + `./install.sh` | `/plugin install <url>` |
|
|
10
|
+
| Command separator | `.` (`/selfish.spec`) | `:` (`/selfish:spec`) |
|
|
11
|
+
| Command location | `~/.claude/commands/selfish.*.md` | `commands/*.md` inside the plugin |
|
|
12
|
+
| Hook scripts | `<project>/.claude/hooks/*.sh` | `scripts/*.sh` inside the plugin |
|
|
13
|
+
| Hook config | `<project>/.claude/settings.json` | `hooks/hooks.json` inside the plugin |
|
|
14
|
+
| Config file | `.claude/selfish.config.md` (unchanged) | `.claude/selfish.config.md` (unchanged) |
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Migration Steps
|
|
17
17
|
|
|
18
|
-
### 1.
|
|
18
|
+
### 1. Clean Up Existing Files
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
#
|
|
21
|
+
# Remove existing command files (user level)
|
|
22
22
|
rm -f ~/.claude/commands/selfish.*.md
|
|
23
23
|
|
|
24
|
-
#
|
|
24
|
+
# Remove existing hook scripts (project level)
|
|
25
25
|
rm -f .claude/hooks/session-start-context.sh
|
|
26
26
|
rm -f .claude/hooks/pre-compact-checkpoint.sh
|
|
27
27
|
rm -f .claude/hooks/track-selfish-changes.sh
|
|
@@ -29,72 +29,72 @@ rm -f .claude/hooks/selfish-stop-gate.sh
|
|
|
29
29
|
rm -f .claude/hooks/selfish-pipeline-manage.sh
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
### 2.
|
|
32
|
+
### 2. Remove selfish hooks from settings.json
|
|
33
33
|
|
|
34
|
-
`.claude/settings.json
|
|
35
|
-
|
|
34
|
+
Remove selfish-related hook entries from `.claude/settings.json`.
|
|
35
|
+
Since the plugin registers hooks via its own `hooks.json`, manual configuration in settings.json is no longer needed.
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Items to remove (from settings.json):
|
|
38
38
|
- `SessionStart` → `session-start-context.sh`
|
|
39
39
|
- `PreCompact` → `pre-compact-checkpoint.sh`
|
|
40
40
|
- `PostToolUse` → `track-selfish-changes.sh`
|
|
41
41
|
- `Stop` → `selfish-stop-gate.sh`
|
|
42
42
|
|
|
43
|
-
>
|
|
43
|
+
> If you have other project-specific hooks in settings.json, keep those as they are.
|
|
44
44
|
|
|
45
|
-
### 3.
|
|
45
|
+
### 3. Install the Plugin
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
48
|
npx selfish-pipeline
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
Or manually:
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
54
|
claude plugin marketplace add jhlee0409/selfish-pipeline
|
|
55
55
|
claude plugin install selfish@selfish-pipeline --scope user
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
The equivalent of `install.sh --commands-only` is the **User** scope; for team sharing, use the **Project** scope.
|
|
59
59
|
|
|
60
|
-
### 4.
|
|
60
|
+
### 4. Command Name Changes
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
The separator for all commands has changed from `.` to `:`:
|
|
63
63
|
|
|
64
64
|
```text
|
|
65
|
-
#
|
|
66
|
-
/selfish.auto "
|
|
67
|
-
/selfish.spec "
|
|
65
|
+
# Before
|
|
66
|
+
/selfish.auto "feature description"
|
|
67
|
+
/selfish.spec "feature description"
|
|
68
68
|
/selfish.plan
|
|
69
69
|
|
|
70
|
-
#
|
|
71
|
-
/selfish:auto "
|
|
72
|
-
/selfish:spec "
|
|
70
|
+
# After
|
|
71
|
+
/selfish:auto "feature description"
|
|
72
|
+
/selfish:spec "feature description"
|
|
73
73
|
/selfish:plan
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
### 5.
|
|
76
|
+
### 5. Verify Config File
|
|
77
77
|
|
|
78
|
-
`.claude/selfish.config.md
|
|
78
|
+
`.claude/selfish.config.md` can be **used as-is without any changes**.
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
For new projects, you can auto-generate it with `/selfish:init`.
|
|
81
81
|
|
|
82
|
-
##
|
|
82
|
+
## What Stays the Same
|
|
83
83
|
|
|
84
|
-
- `.claude/selfish.config.md`
|
|
85
|
-
- `specs/{feature}/`
|
|
86
|
-
- `memory/`
|
|
87
|
-
- `.selfish-*`
|
|
88
|
-
- `git tag selfish/pre-*`
|
|
89
|
-
-
|
|
84
|
+
- `.claude/selfish.config.md` file format and path
|
|
85
|
+
- `specs/{feature}/` artifact paths
|
|
86
|
+
- `memory/` references (checkpoint, principles, research, decisions)
|
|
87
|
+
- `.selfish-*` state file paths
|
|
88
|
+
- `git tag selfish/pre-*` safety tags
|
|
89
|
+
- Internal logic of hook scripts
|
|
90
90
|
|
|
91
91
|
## FAQ
|
|
92
92
|
|
|
93
|
-
**Q:
|
|
94
|
-
A:
|
|
93
|
+
**Q: Do I need to recreate `.claude/selfish.config.md` for existing projects?**
|
|
94
|
+
A: No. The config file format is the same. Use it as-is.
|
|
95
95
|
|
|
96
|
-
**Q:
|
|
97
|
-
A:
|
|
96
|
+
**Q: I'm using this across multiple projects. Do I need to migrate each one?**
|
|
97
|
+
A: You only need to install the plugin once. For each project, just clean up the existing `.claude/hooks/*.sh` files and selfish hook entries in settings.json.
|
|
98
98
|
|
|
99
|
-
**Q:
|
|
100
|
-
A:
|
|
99
|
+
**Q: Can I use the old version and the plugin at the same time?**
|
|
100
|
+
A: This is not recommended. Since the command names differ (`/selfish.spec` vs `/selfish:spec`), there are no conflicts, but hooks may get registered twice.
|
package/README.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/selfish-pipeline)
|
|
6
6
|
[](./LICENSE)
|
|
7
|
-
[]()
|
|
9
|
-
[](#how-it-works)
|
|
8
|
+
[](#15-hook-events)
|
|
9
|
+
[](#18-slash-commands)
|
|
10
10
|
|
|
11
11
|
> Zero-dependency automation pipeline for Claude Code. One command (`/selfish:auto`) runs the entire cycle: write specs, design plans, break into tasks, implement code, review quality, and clean up — all with built-in CI gates and critic loops.
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
Selfish Pipeline is a **Claude Code plugin** that transforms your development workflow into a fully automated pipeline. Instead of manually prompting Claude through each development phase, you run a single command and the pipeline handles everything — from writing feature specifications to final code review.
|
|
16
16
|
|
|
17
|
-
- **
|
|
17
|
+
- **18 slash commands** for every phase of development
|
|
18
18
|
- **15 hook events** with 3 handler types (shell scripts, LLM prompts, subagents)
|
|
19
19
|
- **5 project presets** for popular stacks (Next.js, React SPA, Express API, Monorepo)
|
|
20
20
|
- **Persistent memory agents** that learn across sessions
|
|
@@ -75,9 +75,9 @@ Runs all 6 phases automatically with **Critic Loop** quality checks at each gate
|
|
|
75
75
|
Spec (1/6) → Plan (2/6) → Tasks (3/6) → Implement (4/6) → Review (5/6) → Clean (6/6)
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
###
|
|
78
|
+
### 18 Slash Commands
|
|
79
79
|
|
|
80
|
-
**User
|
|
80
|
+
**User and model (unrestricted):**
|
|
81
81
|
|
|
82
82
|
| Command | Description |
|
|
83
83
|
|---|---|
|
|
@@ -85,24 +85,31 @@ Spec (1/6) → Plan (2/6) → Tasks (3/6) → Implement (4/6) → Review (5/6)
|
|
|
85
85
|
| `/selfish:spec` | Write feature specification with acceptance criteria |
|
|
86
86
|
| `/selfish:plan` | Design implementation plan with file change map |
|
|
87
87
|
| `/selfish:implement` | Execute code implementation with CI gates |
|
|
88
|
+
| `/selfish:test` | Test strategy planning and test writing |
|
|
88
89
|
| `/selfish:review` | Code review with security scanning |
|
|
89
90
|
| `/selfish:research` | Technical research with persistent storage |
|
|
90
|
-
| `/selfish:
|
|
91
|
+
| `/selfish:debug` | Bug diagnosis and fix |
|
|
91
92
|
|
|
92
|
-
**
|
|
93
|
+
**User-only** (`disable-model-invocation: true`):
|
|
93
94
|
|
|
94
95
|
| Command | Description |
|
|
95
96
|
|---|---|
|
|
96
|
-
| `/selfish:
|
|
97
|
-
| `/selfish:
|
|
97
|
+
| `/selfish:init` | Project setup — detects stack and generates config |
|
|
98
|
+
| `/selfish:doctor` | Diagnose project health and plugin setup |
|
|
98
99
|
| `/selfish:architect` | Architecture analysis (persistent memory) |
|
|
99
100
|
| `/selfish:security` | Security scan (persistent memory, isolated worktree) |
|
|
100
|
-
| `/selfish:clarify` | Resolve spec ambiguities |
|
|
101
|
-
| `/selfish:debug` | Bug diagnosis and fix |
|
|
102
101
|
| `/selfish:principles` | Project principles management |
|
|
103
102
|
| `/selfish:checkpoint` | Save session state |
|
|
104
103
|
| `/selfish:resume` | Restore session state |
|
|
105
104
|
|
|
105
|
+
**Model-only** (`user-invocable: false`):
|
|
106
|
+
|
|
107
|
+
| Command | Description |
|
|
108
|
+
|---|---|
|
|
109
|
+
| `/selfish:tasks` | Break plan into parallelizable tasks |
|
|
110
|
+
| `/selfish:analyze` | Verify artifact consistency |
|
|
111
|
+
| `/selfish:clarify` | Resolve spec ambiguities |
|
|
112
|
+
|
|
106
113
|
### 15 Hook Events
|
|
107
114
|
|
|
108
115
|
Every hook fires automatically — no configuration needed after install.
|
|
@@ -187,7 +194,7 @@ This detects your tech stack and generates `.claude/selfish.config.md` with:
|
|
|
187
194
|
## FAQ
|
|
188
195
|
|
|
189
196
|
### What is selfish-pipeline?
|
|
190
|
-
A Claude Code plugin that automates the entire development cycle (spec → plan → tasks → implement → review → clean) through
|
|
197
|
+
A Claude Code plugin that automates the entire development cycle (spec → plan → tasks → implement → review → clean) through 18 slash commands and 15 hook events.
|
|
191
198
|
|
|
192
199
|
### How does it compare to manual Claude Code workflows?
|
|
193
200
|
Instead of manually prompting each step, selfish-pipeline orchestrates the full cycle with built-in quality gates that physically prevent skipping CI or security checks.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: selfish-architect
|
|
3
|
-
description: "
|
|
3
|
+
description: "Architecture analysis agent — remembers ADR decisions and architecture patterns across sessions to provide consistent design guidance."
|
|
4
4
|
tools:
|
|
5
5
|
- Read
|
|
6
6
|
- Grep
|
|
@@ -15,7 +15,13 @@ skills:
|
|
|
15
15
|
- docs/phase-gate-protocol.md
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
-
You are an architecture analysis agent for the
|
|
18
|
+
You are an architecture analysis agent for the current project.
|
|
19
|
+
|
|
20
|
+
## Reference Documents
|
|
21
|
+
|
|
22
|
+
Before performing analysis, read these shared reference documents:
|
|
23
|
+
- `docs/critic-loop-rules.md` — Critic Loop execution rules
|
|
24
|
+
- `docs/phase-gate-protocol.md` — Phase gate validation protocol
|
|
19
25
|
|
|
20
26
|
## Memory Usage
|
|
21
27
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: selfish-security
|
|
3
|
-
description: "
|
|
3
|
+
description: "Security scanning agent — remembers vulnerability patterns and project-specific security characteristics across sessions to improve scan precision."
|
|
4
4
|
tools:
|
|
5
5
|
- Read
|
|
6
6
|
- Grep
|
|
7
7
|
- Glob
|
|
8
8
|
- Bash
|
|
9
9
|
- Task
|
|
10
|
+
- WebSearch
|
|
10
11
|
model: sonnet
|
|
11
12
|
memory: project
|
|
12
13
|
isolation: worktree
|
|
@@ -15,7 +16,13 @@ skills:
|
|
|
15
16
|
- docs/phase-gate-protocol.md
|
|
16
17
|
---
|
|
17
18
|
|
|
18
|
-
You are a security scanning agent for the
|
|
19
|
+
You are a security scanning agent for the current project.
|
|
20
|
+
|
|
21
|
+
## Reference Documents
|
|
22
|
+
|
|
23
|
+
Before performing scans, read these shared reference documents:
|
|
24
|
+
- `docs/critic-loop-rules.md` — Critic Loop execution rules
|
|
25
|
+
- `docs/phase-gate-protocol.md` — Phase gate validation protocol
|
|
19
26
|
|
|
20
27
|
## Memory Usage
|
|
21
28
|
|
package/bin/cli.mjs
CHANGED
|
@@ -12,19 +12,19 @@ const SCOPES = [
|
|
|
12
12
|
{
|
|
13
13
|
key: "1",
|
|
14
14
|
name: "user",
|
|
15
|
-
label: "User (
|
|
15
|
+
label: "User (all projects for this user)",
|
|
16
16
|
desc: "~/.claude/settings.json",
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
key: "2",
|
|
20
20
|
name: "project",
|
|
21
|
-
label: "Project (
|
|
21
|
+
label: "Project (shared with team, committable)",
|
|
22
22
|
desc: ".claude/settings.json",
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
key: "3",
|
|
26
26
|
name: "local",
|
|
27
|
-
label: "Local (
|
|
27
|
+
label: "Local (this project only, gitignored)",
|
|
28
28
|
desc: ".claude/settings.local.json",
|
|
29
29
|
},
|
|
30
30
|
];
|
|
@@ -44,48 +44,48 @@ async function main() {
|
|
|
44
44
|
console.log(" ================================================");
|
|
45
45
|
console.log();
|
|
46
46
|
|
|
47
|
-
// claude CLI
|
|
47
|
+
// Check claude CLI exists
|
|
48
48
|
try {
|
|
49
49
|
execSync("claude --version", { stdio: "pipe" });
|
|
50
50
|
} catch {
|
|
51
|
-
console.error(" ✗ Claude Code CLI
|
|
52
|
-
console.error(" https://claude.ai/code
|
|
51
|
+
console.error(" ✗ Claude Code CLI is not installed.");
|
|
52
|
+
console.error(" Install it from https://claude.ai/code");
|
|
53
53
|
exit(1);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
const rl = createInterface({ input: stdin, output: stdout });
|
|
57
57
|
|
|
58
58
|
try {
|
|
59
|
-
console.log("
|
|
59
|
+
console.log(" Select install scope:\n");
|
|
60
60
|
for (const s of SCOPES) {
|
|
61
61
|
console.log(` ${s.key}) ${s.label}`);
|
|
62
62
|
console.log(` → ${s.desc}`);
|
|
63
63
|
}
|
|
64
64
|
console.log();
|
|
65
65
|
|
|
66
|
-
const answer = await rl.question("
|
|
66
|
+
const answer = await rl.question(" Choose [1/2/3] (default: 1): ");
|
|
67
67
|
const choice = answer.trim() || "1";
|
|
68
68
|
const scope = SCOPES.find((s) => s.key === choice);
|
|
69
69
|
|
|
70
70
|
if (!scope) {
|
|
71
|
-
console.error("\n ✗
|
|
71
|
+
console.error("\n ✗ Invalid selection.");
|
|
72
72
|
exit(1);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
console.log(`\n → ${scope.label}
|
|
75
|
+
console.log(`\n → Installing with ${scope.label} scope...\n`);
|
|
76
76
|
|
|
77
|
-
// Step 1:
|
|
78
|
-
console.log(" [1/2]
|
|
77
|
+
// Step 1: Register marketplace
|
|
78
|
+
console.log(" [1/2] Registering marketplace...");
|
|
79
79
|
run(`claude plugin marketplace add ${GITHUB_REPO}`);
|
|
80
80
|
|
|
81
|
-
// Step 2:
|
|
82
|
-
console.log(` [2/2]
|
|
81
|
+
// Step 2: Install plugin
|
|
82
|
+
console.log(` [2/2] Installing plugin (--scope ${scope.name})...`);
|
|
83
83
|
const installed = run(
|
|
84
84
|
`claude plugin install ${PLUGIN_NAME}@${MARKETPLACE_NAME} --scope ${scope.name}`
|
|
85
85
|
);
|
|
86
86
|
|
|
87
87
|
if (!installed) {
|
|
88
|
-
console.error("\n ✗
|
|
88
|
+
console.error("\n ✗ Installation failed. Try manually:");
|
|
89
89
|
console.error(` claude plugin marketplace add ${GITHUB_REPO}`);
|
|
90
90
|
console.error(
|
|
91
91
|
` claude plugin install ${PLUGIN_NAME}@${MARKETPLACE_NAME} --scope ${scope.name}`
|
|
@@ -94,11 +94,11 @@ async function main() {
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
console.log();
|
|
97
|
-
console.log(" ✓
|
|
97
|
+
console.log(" ✓ Installation complete!");
|
|
98
98
|
console.log();
|
|
99
|
-
console.log("
|
|
100
|
-
console.log(" /selfish:init
|
|
101
|
-
console.log(' /selfish:auto "
|
|
99
|
+
console.log(" Next steps:");
|
|
100
|
+
console.log(" /selfish:init Create project config");
|
|
101
|
+
console.log(' /selfish:auto "feature desc" Run the pipeline');
|
|
102
102
|
console.log();
|
|
103
103
|
} finally {
|
|
104
104
|
rl.close();
|
|
@@ -106,6 +106,6 @@ async function main() {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
main().catch((err) => {
|
|
109
|
-
console.error(`\n ✗
|
|
109
|
+
console.error(`\n ✗ Installation failed: ${err.message}`);
|
|
110
110
|
exit(1);
|
|
111
111
|
});
|
package/commands/analyze.md
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: selfish:analyze
|
|
3
|
-
description: "
|
|
4
|
-
argument-hint: "[
|
|
3
|
+
description: "Artifact consistency validation (read-only)"
|
|
4
|
+
argument-hint: "[validation scope: spec-plan, tasks-only]"
|
|
5
5
|
user-invocable: false
|
|
6
6
|
context: fork
|
|
7
|
-
agent: Explore
|
|
8
7
|
allowed-tools:
|
|
9
8
|
- Read
|
|
10
9
|
- Grep
|
|
@@ -12,116 +11,116 @@ allowed-tools:
|
|
|
12
11
|
model: haiku
|
|
13
12
|
---
|
|
14
13
|
|
|
15
|
-
# /selfish:analyze —
|
|
14
|
+
# /selfish:analyze — Artifact Consistency Validation
|
|
16
15
|
|
|
17
|
-
> spec.md, plan.md, tasks.md
|
|
18
|
-
>
|
|
16
|
+
> Validates consistency and quality across spec.md, plan.md, and tasks.md.
|
|
17
|
+
> **Read-only** — does not modify any files.
|
|
19
18
|
|
|
20
|
-
##
|
|
19
|
+
## Arguments
|
|
21
20
|
|
|
22
|
-
- `$ARGUMENTS` — (
|
|
21
|
+
- `$ARGUMENTS` — (optional) limit validation scope (e.g., "spec-plan", "tasks-only")
|
|
23
22
|
|
|
24
|
-
##
|
|
23
|
+
## Config Load
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
Read the following settings from `CLAUDE.md` or `.claude/CLAUDE.md` at the project root and assign to the `config` variable:
|
|
27
26
|
|
|
28
27
|
```
|
|
29
|
-
config.architecture =
|
|
30
|
-
(
|
|
31
|
-
→ CLAUDE.md
|
|
28
|
+
config.architecture = the architecture pattern used in the project
|
|
29
|
+
(e.g., "FSD", "Clean Architecture", "Layered", "Modular Monolith")
|
|
30
|
+
→ Architecture standard specified in CLAUDE.md. Assume "Layered Architecture" if not present.
|
|
32
31
|
```
|
|
33
32
|
|
|
34
|
-
##
|
|
33
|
+
## Execution Steps
|
|
35
34
|
|
|
36
|
-
### 1.
|
|
35
|
+
### 1. Load Artifacts
|
|
37
36
|
|
|
38
|
-
`specs/{feature}
|
|
39
|
-
- **spec.md** (
|
|
40
|
-
- **plan.md** (
|
|
41
|
-
- **tasks.md** (
|
|
42
|
-
- **research.md** (
|
|
37
|
+
From `specs/{feature}/`:
|
|
38
|
+
- **spec.md** (required)
|
|
39
|
+
- **plan.md** (required)
|
|
40
|
+
- **tasks.md** (if present)
|
|
41
|
+
- **research.md** (if present)
|
|
43
42
|
|
|
44
|
-
|
|
43
|
+
Warn about missing files but proceed with what is available.
|
|
45
44
|
|
|
46
|
-
### 2.
|
|
45
|
+
### 2. Run Validation
|
|
47
46
|
|
|
48
|
-
6
|
|
47
|
+
Validate across 6 categories:
|
|
49
48
|
|
|
50
|
-
#### A.
|
|
51
|
-
- spec.md
|
|
52
|
-
- tasks.md
|
|
49
|
+
#### A. Duplication Detection (DUPLICATION)
|
|
50
|
+
- Similar requirements within spec.md
|
|
51
|
+
- Overlapping tasks within tasks.md
|
|
53
52
|
|
|
54
|
-
#### B.
|
|
55
|
-
-
|
|
56
|
-
- TODO/TBD/FIXME
|
|
57
|
-
-
|
|
53
|
+
#### B. Ambiguity Detection (AMBIGUITY)
|
|
54
|
+
- Unmeasurable adjectives ("appropriate", "fast", "good")
|
|
55
|
+
- Residual TODO/TBD/FIXME markers
|
|
56
|
+
- Incomplete sentences
|
|
58
57
|
|
|
59
|
-
#### C.
|
|
60
|
-
- spec → plan:
|
|
61
|
-
- plan → tasks: plan
|
|
62
|
-
- spec → tasks:
|
|
58
|
+
#### C. Coverage Gaps (COVERAGE)
|
|
59
|
+
- spec → plan: Are all FR-*/NFR-* reflected in the plan?
|
|
60
|
+
- plan → tasks: Are all items in the plan's File Change Map present in tasks?
|
|
61
|
+
- spec → tasks: Are all requirements mapped to tasks?
|
|
63
62
|
|
|
64
|
-
#### D.
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
- plan
|
|
63
|
+
#### D. Inconsistencies (INCONSISTENCY)
|
|
64
|
+
- Terminology drift (different names for the same concept)
|
|
65
|
+
- Conflicting requirements
|
|
66
|
+
- Mismatches between technical decisions in plan and execution in tasks
|
|
68
67
|
|
|
69
|
-
#### E.
|
|
70
|
-
- memory/principles.md
|
|
71
|
-
- {config.architecture}
|
|
68
|
+
#### E. Principles Compliance (PRINCIPLES)
|
|
69
|
+
- Validate against MUST principles in memory/principles.md if present
|
|
70
|
+
- Potential violations of {config.architecture} rules
|
|
72
71
|
|
|
73
|
-
#### F.
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
72
|
+
#### F. Unidentified Risks (RISK)
|
|
73
|
+
- Are there risks not identified in plan.md?
|
|
74
|
+
- External dependency risks
|
|
75
|
+
- Potential performance bottlenecks
|
|
77
76
|
|
|
78
|
-
### 3.
|
|
77
|
+
### 3. Severity Classification
|
|
79
78
|
|
|
80
|
-
|
|
|
81
|
-
|
|
82
|
-
| **CRITICAL** |
|
|
83
|
-
| **HIGH** |
|
|
84
|
-
| **MEDIUM** |
|
|
85
|
-
| **LOW** |
|
|
79
|
+
| Severity | Criteria |
|
|
80
|
+
|----------|----------|
|
|
81
|
+
| **CRITICAL** | Principles violation, core feature blocker, security issue |
|
|
82
|
+
| **HIGH** | Duplication/conflict, untestable, coverage gap |
|
|
83
|
+
| **MEDIUM** | Terminology drift, ambiguous requirements |
|
|
84
|
+
| **LOW** | Style improvements, minor duplication |
|
|
86
85
|
|
|
87
|
-
### 4.
|
|
86
|
+
### 4. Output Results (console)
|
|
88
87
|
|
|
89
88
|
```markdown
|
|
90
|
-
##
|
|
89
|
+
## Consistency Analysis Results: {feature name}
|
|
91
90
|
|
|
92
|
-
###
|
|
93
|
-
| ID |
|
|
94
|
-
|
|
95
|
-
| A-001 | COVERAGE | HIGH | spec FR-003 |
|
|
96
|
-
| A-002 | AMBIGUITY | MEDIUM | spec NFR-001 | "
|
|
91
|
+
### Findings
|
|
92
|
+
| ID | Category | Severity | Location | Summary | Recommended Action |
|
|
93
|
+
|----|----------|----------|----------|---------|-------------------|
|
|
94
|
+
| A-001 | COVERAGE | HIGH | spec FR-003 | No mapping in tasks | Add task |
|
|
95
|
+
| A-002 | AMBIGUITY | MEDIUM | spec NFR-001 | "quickly" is unmeasurable | Add numeric threshold |
|
|
97
96
|
|
|
98
|
-
###
|
|
99
|
-
|
|
|
100
|
-
|
|
97
|
+
### Coverage Summary
|
|
98
|
+
| Mapping | Coverage |
|
|
99
|
+
|---------|----------|
|
|
101
100
|
| spec → plan | {N}% |
|
|
102
101
|
| plan → tasks | {N}% |
|
|
103
102
|
| spec → tasks | {N}% |
|
|
104
103
|
|
|
105
|
-
###
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
104
|
+
### Metrics
|
|
105
|
+
- Total requirements: {N}
|
|
106
|
+
- Total tasks: {N}
|
|
107
|
+
- Issues: CRITICAL {N} / HIGH {N} / MEDIUM {N} / LOW {N}
|
|
109
108
|
|
|
110
|
-
###
|
|
111
|
-
{
|
|
109
|
+
### Next Steps
|
|
110
|
+
{Concrete action proposals for CRITICAL/HIGH issues}
|
|
112
111
|
```
|
|
113
112
|
|
|
114
|
-
### 5.
|
|
113
|
+
### 5. Final Output
|
|
115
114
|
|
|
116
115
|
```
|
|
117
|
-
|
|
118
|
-
├─
|
|
119
|
-
├─
|
|
120
|
-
└─
|
|
116
|
+
Analysis complete
|
|
117
|
+
├─ Found: CRITICAL {N} / HIGH {N} / MEDIUM {N} / LOW {N}
|
|
118
|
+
├─ Coverage: spec→plan {N}%, plan→tasks {N}%, spec→tasks {N}%
|
|
119
|
+
└─ Recommended: {next action}
|
|
121
120
|
```
|
|
122
121
|
|
|
123
|
-
##
|
|
122
|
+
## Notes
|
|
124
123
|
|
|
125
|
-
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
124
|
+
- **Read-only**: Do not modify any files. Report only.
|
|
125
|
+
- **Avoid false positives**: Do not over-flag ambiguity. Consider context.
|
|
126
|
+
- **Optional**: Not required in the pipeline. Can proceed plan → tasks → implement directly.
|