ystack 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.
- package/CHANGELOG.md +24 -0
- package/LICENSE +21 -0
- package/LINTING.md +198 -0
- package/PHILOSOPHY.md +132 -0
- package/PLAN.md +515 -0
- package/README.md +103 -0
- package/RUNTIMES.md +199 -0
- package/bin/cli.js +973 -0
- package/hooks/context-monitor.js +30 -0
- package/hooks/session-start.sh +35 -0
- package/hooks/workflow-nudge.js +107 -0
- package/package.json +39 -0
- package/skills/address-review/SKILL.md +244 -0
- package/skills/build/SKILL.md +246 -0
- package/skills/build/resources/plan-checker.md +121 -0
- package/skills/docs/SKILL.md +160 -0
- package/skills/go/SKILL.md +216 -0
- package/skills/go/resources/executor.md +57 -0
- package/skills/import/SKILL.md +306 -0
- package/skills/pr/SKILL.md +152 -0
- package/skills/review/SKILL.md +184 -0
- package/skills/scaffold/SKILL.md +549 -0
package/RUNTIMES.md
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Multi-Runtime Support
|
|
2
|
+
|
|
3
|
+
> **Status: Future Roadmap / Design Spec**
|
|
4
|
+
> This document describes a planned multi-runtime adapter architecture. It is NOT implemented. v0.1 supports Claude Code only. Everything below is retained as a roadmap and specification for future versions.
|
|
5
|
+
|
|
6
|
+
## The Problem
|
|
7
|
+
|
|
8
|
+
AI coding agents all have different conventions:
|
|
9
|
+
|
|
10
|
+
| Runtime | Skills/Commands | Rules/Context | Hooks | Subagents |
|
|
11
|
+
|---------|----------------|---------------|-------|-----------|
|
|
12
|
+
| Claude Code | `.claude/skills/`, `.claude/commands/` | `CLAUDE.md`, `.claude/rules/` | `.claude/settings.json` hooks | `Agent()` tool with `subagent_type` |
|
|
13
|
+
| Codex | `AGENTS.md` instructions | `AGENTS.md` | None | None (single-agent) |
|
|
14
|
+
| Cursor | `.cursor/rules/*.mdc` | `.cursorrules` | None | None |
|
|
15
|
+
| Copilot | `.github/copilot-instructions.md` | Same file | None | None |
|
|
16
|
+
| Windsurf | `.windsurfrules` | Same file | None | None |
|
|
17
|
+
| Gemini CLI | `.gemini/` | `.gemini/GEMINI.md` | `.gemini/settings.json` | Task-based |
|
|
18
|
+
|
|
19
|
+
ystack's core logic — read docs, surface assumptions, create plans, verify against criteria — is just prompts. It works in any agent. The only thing that changes is how the prompts are packaged and delivered.
|
|
20
|
+
|
|
21
|
+
## Architecture (Planned)
|
|
22
|
+
|
|
23
|
+
> **Not yet built.** The `core/prompts/` and `adapters/<runtime>/` structure below is the target design. In v0.1, skills are installed directly as `.claude/skills/` files for Claude Code only.
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
ystack/
|
|
27
|
+
├── core/ # Agent-agnostic
|
|
28
|
+
│ ├── prompts/ # The actual skill logic (markdown)
|
|
29
|
+
│ │ ├── build.md
|
|
30
|
+
│ │ ├── go.md
|
|
31
|
+
│ │ ├── review.md
|
|
32
|
+
│ │ ├── docs.md
|
|
33
|
+
│ │ ├── pr.md
|
|
34
|
+
│ │ ├── scaffold.md
|
|
35
|
+
│ │ └── import.md
|
|
36
|
+
│ ├── agents/ # Subagent prompts
|
|
37
|
+
│ │ ├── plan-checker.md
|
|
38
|
+
│ │ └── executor.md
|
|
39
|
+
│ ├── rules/ # Agent lint rules (declarative)
|
|
40
|
+
│ │ ├── spec-before-plan.json
|
|
41
|
+
│ │ ├── no-scope-reduction.json
|
|
42
|
+
│ │ └── docs-before-ship.json
|
|
43
|
+
│ └── templates/
|
|
44
|
+
│ ├── DECISIONS.md
|
|
45
|
+
│ └── PLAN.md
|
|
46
|
+
│
|
|
47
|
+
├── adapters/ # Runtime-specific packaging
|
|
48
|
+
│ ├── claude-code/ # → .claude/skills/, .claude/rules/, hooks
|
|
49
|
+
│ ├── codex/ # → AGENTS.md with embedded instructions
|
|
50
|
+
│ ├── cursor/ # → .cursor/rules/*.mdc
|
|
51
|
+
│ ├── copilot/ # → .github/copilot-instructions.md
|
|
52
|
+
│ ├── windsurf/ # → .windsurfrules
|
|
53
|
+
│ └── gemini/ # → .gemini/ directory
|
|
54
|
+
│
|
|
55
|
+
└── install.js # Detects runtime, applies adapter
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Core (agent-agnostic)
|
|
59
|
+
|
|
60
|
+
The prompts in `core/prompts/` are the actual skill logic. They reference:
|
|
61
|
+
- `ystack.config.json` for the module registry
|
|
62
|
+
- `bd` CLI for Beads operations
|
|
63
|
+
- Doc page paths (resolved from the registry)
|
|
64
|
+
- `.context/<bead-id>/` for temporary state
|
|
65
|
+
|
|
66
|
+
These are pure markdown instructions that any LLM can follow. They don't use Claude-specific features, tool names, or XML tags.
|
|
67
|
+
|
|
68
|
+
### Adapters (Planned — not yet implemented)
|
|
69
|
+
|
|
70
|
+
Each adapter takes the core prompts and packages them for a specific runtime:
|
|
71
|
+
|
|
72
|
+
**Claude Code adapter:**
|
|
73
|
+
- Wraps each prompt as a `.claude/skills/<name>/SKILL.md`
|
|
74
|
+
- Installs lint rules as hooks in `.claude/settings.json`
|
|
75
|
+
- Registers subagent types for plan-checker and executor
|
|
76
|
+
- Supports parallel subagent execution via `Agent()` tool
|
|
77
|
+
|
|
78
|
+
**Codex adapter:**
|
|
79
|
+
- Compiles all prompts into sections of `AGENTS.md`
|
|
80
|
+
- No hooks (Codex doesn't support them) — lint rules become inline instructions
|
|
81
|
+
- No subagents — execution runs inline in single context
|
|
82
|
+
- Commands referenced as natural language triggers
|
|
83
|
+
|
|
84
|
+
**Cursor adapter:**
|
|
85
|
+
- Wraps prompts as `.cursor/rules/*.mdc` with frontmatter (globs, description)
|
|
86
|
+
- Rules applied contextually based on file patterns
|
|
87
|
+
- No hooks — lint rules become rule file instructions
|
|
88
|
+
- No subagents — single context execution
|
|
89
|
+
|
|
90
|
+
**Copilot adapter:**
|
|
91
|
+
- Compiles into `.github/copilot-instructions.md`
|
|
92
|
+
- Minimal format — instructions only, no hooks or subagents
|
|
93
|
+
|
|
94
|
+
**Gemini CLI adapter:**
|
|
95
|
+
- Wraps as `.gemini/` skills
|
|
96
|
+
- Hook support via `.gemini/settings.json`
|
|
97
|
+
- Task-based subagent execution
|
|
98
|
+
|
|
99
|
+
## Capability Tiers (Planned)
|
|
100
|
+
|
|
101
|
+
Not all runtimes can do everything. ystack degrades gracefully:
|
|
102
|
+
|
|
103
|
+
| Capability | Tier 1 (full) | Tier 2 (inline) | Tier 3 (instructions) |
|
|
104
|
+
|------------|--------------|-----------------|----------------------|
|
|
105
|
+
| **Runtimes** | Claude Code, Gemini CLI | Codex, Cursor | Copilot, Windsurf |
|
|
106
|
+
| **Subagents** | Yes — fresh context per task | No — inline execution | No |
|
|
107
|
+
| **Hooks** | Yes — pre/post tool use | No — rules embedded in prompts | No |
|
|
108
|
+
| **Beads** | Full (`bd` CLI) | Full (`bd` CLI) | Full (`bd` CLI) |
|
|
109
|
+
| **Docs reading** | Selective (agent navigates) | Selective | Selective |
|
|
110
|
+
| **Plan-checker** | Separate agent validates | Self-check in same context | Self-check |
|
|
111
|
+
| **Parallel execution** | Yes (wave-based) | Sequential | Sequential |
|
|
112
|
+
| **Agent linting** | Hook-enforced | Prompt-instructed | Prompt-instructed |
|
|
113
|
+
|
|
114
|
+
### Tier 1: Full Harness
|
|
115
|
+
|
|
116
|
+
Claude Code and Gemini CLI support subagents and hooks. They get the full experience:
|
|
117
|
+
- `/go` spawns fresh subagents per task (context rot prevention)
|
|
118
|
+
- Lint rules enforced via hooks (hard blocks)
|
|
119
|
+
- Plan-checker runs as a separate agent
|
|
120
|
+
- Parallel wave-based execution
|
|
121
|
+
|
|
122
|
+
### Tier 2: Inline Execution
|
|
123
|
+
|
|
124
|
+
Codex and Cursor can run `bd` commands and read files, but have no subagent support. The harness adapts:
|
|
125
|
+
- `/go` executes tasks sequentially in the same context
|
|
126
|
+
- Plan-checker runs as a self-review step (not a separate agent)
|
|
127
|
+
- Lint rules are embedded in the prompt ("before editing, verify you've read the spec")
|
|
128
|
+
- No parallel execution — tasks run one at a time
|
|
129
|
+
|
|
130
|
+
This is still valuable. The workflow (build → go → review → docs → pr) works the same. You lose context isolation but keep the structure.
|
|
131
|
+
|
|
132
|
+
### Tier 3: Instructions Only
|
|
133
|
+
|
|
134
|
+
Copilot and Windsurf have minimal configuration. They get the workflow as natural language instructions:
|
|
135
|
+
- No slash commands — the instructions describe the process to follow
|
|
136
|
+
- The agent is told: "When asked to build a feature, first read the module's doc page..."
|
|
137
|
+
- Beads still works (any agent with shell access can use `bd`)
|
|
138
|
+
- Verification is self-check only
|
|
139
|
+
|
|
140
|
+
Even at this tier, having Beads + docs + module registry is a significant upgrade over nothing.
|
|
141
|
+
|
|
142
|
+
## What Stays Universal
|
|
143
|
+
|
|
144
|
+
Regardless of runtime, every agent gets:
|
|
145
|
+
|
|
146
|
+
1. **Beads** — any agent with shell access can run `bd ready`, `bd create`, `bd close`. The persistent memory layer works everywhere.
|
|
147
|
+
|
|
148
|
+
2. **Docs** — every agent can read markdown files. The documentation-as-spec pattern is runtime-agnostic.
|
|
149
|
+
|
|
150
|
+
3. **Module registry** — `ystack.config.json` is JSON. Any agent can parse it to find the right doc page and code scope.
|
|
151
|
+
|
|
152
|
+
4. **`.context/<bead-id>/`** — PLAN.md and DECISIONS.md are markdown files. Any agent can read and write them.
|
|
153
|
+
|
|
154
|
+
5. **The workflow** — build → go → review → docs → pr is a process, not a tool feature. It works in any agent that can follow multi-step instructions.
|
|
155
|
+
|
|
156
|
+
## Installation (Planned)
|
|
157
|
+
|
|
158
|
+
> **v0.1:** Only `npx ystack init` (Claude Code) is implemented. The `--runtime` flags and multi-runtime detection described below are planned for a future version.
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# Auto-detect runtime
|
|
162
|
+
npx ystack init
|
|
163
|
+
|
|
164
|
+
# Specify runtime (planned — not yet implemented)
|
|
165
|
+
npx ystack init --claude-code
|
|
166
|
+
npx ystack init --codex
|
|
167
|
+
npx ystack init --cursor
|
|
168
|
+
npx ystack init --copilot
|
|
169
|
+
npx ystack init --windsurf
|
|
170
|
+
npx ystack init --gemini
|
|
171
|
+
|
|
172
|
+
# Install multiple (planned)
|
|
173
|
+
npx ystack init --claude-code --cursor
|
|
174
|
+
|
|
175
|
+
# Update after ystack upgrade
|
|
176
|
+
npx ystack update
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
The installer (planned behavior):
|
|
180
|
+
1. Detects which runtimes are present (checks for `.claude/`, `.cursor/`, `AGENTS.md`, etc.)
|
|
181
|
+
2. Reads `core/` prompts
|
|
182
|
+
3. Applies the appropriate adapter
|
|
183
|
+
4. Writes files to the runtime's expected locations
|
|
184
|
+
5. Preserves any existing configuration (merges, doesn't overwrite)
|
|
185
|
+
|
|
186
|
+
## Contributing an Adapter (Future)
|
|
187
|
+
|
|
188
|
+
To add support for a new runtime:
|
|
189
|
+
|
|
190
|
+
1. Create `adapters/<runtime>/` directory
|
|
191
|
+
2. Implement the adapter interface:
|
|
192
|
+
- `detectRuntime()` — how to detect this runtime is in use
|
|
193
|
+
- `installSkills(corePrompts)` — how to package and write skill files
|
|
194
|
+
- `installRules(coreRules)` — how to package lint rules (hooks or inline)
|
|
195
|
+
- `installHooks(coreHooks)` — how to install hooks (or skip if unsupported)
|
|
196
|
+
3. Define the capability tier (1, 2, or 3)
|
|
197
|
+
4. Add to the installer's runtime registry
|
|
198
|
+
|
|
199
|
+
The adapter should be thin — under 200 lines. All the logic lives in `core/`.
|