Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ This repository's custom command prompts are designed for **OpenCode / oh-my-ope

### Prompt format constraints

- Do **not** rely on `allowed-tools` frontmatter for deployed OpenCode commands. Our deploy step strips non-OpenCode frontmatter and keeps only `description`.
- `argument-hint` may exist in source command files for authoring convenience, but it is not preserved in deployed `.opencode/commands/` files.
- Avoid prompt text that assumes Claude Code-only primitives such as `AskUserQuestion` or Claude-specific plugin agent names.
- When describing delegation, prefer generic subagent language over implementation-specific names so the same prompt remains portable across OpenCode setups.
- When describing delegation, prefer generic subagent language over implementation-specific names so the same prompt remains portable across setups.
- `zest-dev init` installs packaged skills only to `~/.agents/skills/<name>/`; it does not deploy editor-specific command or agent paths.

## Development

Expand Down
39 changes: 8 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A lightweight, human-interactive development workflow for AI-assisted coding.

## Quick Start

Install the CLI from npm, then initialize the editor-facing commands and skills in your project:
Install the CLI from npm, then install the packaged skills into `~/.agents/skills/`:

```bash
npm install -g zest-dev
Expand All @@ -24,13 +24,9 @@ zest-dev --version
zest-dev --help
```

### Initialize a Project
### Install Skills

From the project where you want to use Zest Dev, run:

```bash
zest-dev init
```
`zest-dev init` copies every packaged skill under `skills/<name>/` to `~/.agents/skills/<name>/`.

### Local Development Setup

Expand Down Expand Up @@ -75,28 +71,14 @@ If publishing fails, inspect the `Publish npm` workflow run on `main` before ret

## Usage Workflow

Zest Dev uses a **content-contract skill / approach command** model:
Zest Dev uses a **content-contract skill** model:

- the `zest-dev` skill owns Spec lifecycle and recording contracts
- Section Guides define Overview, Design, Plan, and Implementation content
- two thin commands choose how a new Spec reaches Designed Status
- Design Approaches (lightweight or grilling) are chosen inside the skill workflow
- the `zest-dev` CLI manages Spec files and lifecycle state

### Design Approaches

Use the lightweight route for straightforward work:

```bash
/zest-dev:lightweight "My new feature"
```

Use grilling when the design needs an intensive, one-question-at-a-time decision process:

```bash
/zest-dev:grilling "My complex feature"
```

Both commands create and activate a new Spec, establish its Overview, and reach the same Designed Status. The grilling route composes the registered `grilling` and `domain-modeling` skills. Research is not a separate status or required step; source-backed Research Findings live beside Design Decisions in the Design Record.
Research is not a separate status or required step; source-backed Research Findings live beside Design Decisions in the Design Record.

New-format Specs progress through `new → designed → planned → implemented`.

Expand All @@ -108,6 +90,7 @@ The `zest-dev` CLI manages spec files. Use it to inspect and update specs outsid

| Command | Purpose |
|---------|---------|
| `zest-dev init` | Install packaged skills to `~/.agents/skills/` |
| `zest-dev status` | View project status |
| `zest-dev show <spec-id\|active>` | View spec content |
| `zest-dev create <slug>` | Create new spec |
Expand Down Expand Up @@ -143,13 +126,7 @@ Valid status values: `new`, `designed`, `planned`, `implemented`

### Resource Layout

Zest Dev's editor-facing resources are stored in top-level directories:

- `commands/` - the lightweight and grilling Design Approach entrypoints
- `skills/` - the Zest Dev skill and its Section Guides
- `agents/` - reusable subagent definitions

The `plugin/` directory is a Claude Code compatibility layer. It keeps plugin metadata under `plugin/.claude-plugin/`, while `plugin/commands`, `plugin/skills`, and `plugin/agents` are symlinks to the top-level source directories.
Packaged agent skills live under `skills/` and are installed by `zest-dev init` into `~/.agents/skills/<name>/`.

### Project Structure

Expand Down
95 changes: 17 additions & 78 deletions bin/zest-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,64 +18,29 @@ const {
dumpSpec,
loadIssueRepresentation
} = require('../lib/spec-manager');
const { deployPlugin } = require('../lib/plugin-deployer');
const { installSkills, getGlobalSkillsDir } = require('../lib/skill-installer');
const { setupRalphFromActiveSpec } = require('../lib/ralph-setup');
const packageJson = require('../package.json');

const program = new Command();

function getOptionalGlobalOpenCodeCommandDir() {
const xdgConfigHome = process.env.XDG_CONFIG_HOME;
if (xdgConfigHome) {
return path.isAbsolute(xdgConfigHome)
? path.join(xdgConfigHome, 'opencode', 'commands')
: null;
}

const homeDir = process.env.HOME || process.env.USERPROFILE;
if (!homeDir || !path.isAbsolute(homeDir)) {
function getOptionalGlobalSkillsDir() {
try {
return getGlobalSkillsDir();
} catch {
return null;
}

return path.join(homeDir, '.config', 'opencode', 'commands');
}

function getOptionalHomeDir() {
const homeDir = process.env.HOME || process.env.USERPROFILE;
return homeDir && path.isAbsolute(homeDir) ? homeDir : null;
}

function getDeployedCommandDirs() {
const dirs = [
path.join(process.cwd(), '.cursor/commands'),
path.join(process.cwd(), '.opencode/commands')
];

const globalOpenCodeCommandDir = getOptionalGlobalOpenCodeCommandDir();
if (globalOpenCodeCommandDir) {
dirs.push(globalOpenCodeCommandDir);
}

return dirs;
}

function getDeployedZestDevSkillDirs() {
const dirs = [
path.join(process.cwd(), '.opencode/skills/zest-dev'),
path.join(process.cwd(), '.agents/skills/zest-dev')
];

const globalOpenCodeCommandDir = getOptionalGlobalOpenCodeCommandDir();
if (globalOpenCodeCommandDir) {
dirs.push(path.join(path.dirname(globalOpenCodeCommandDir), 'skills/zest-dev'));
}

const homeDir = getOptionalHomeDir();
if (homeDir) {
dirs.push(path.join(homeDir, '.agents/skills/zest-dev'));
function hasDeployedSkills() {
const skillsDir = getOptionalGlobalSkillsDir();
if (!skillsDir || !fs.existsSync(skillsDir)) {
return false;
}

return dirs;
return fs.readdirSync(skillsDir, { withFileTypes: true }).some(entry =>
entry.isDirectory() && fs.existsSync(path.join(skillsDir, entry.name, 'SKILL.md'))
);
}

function isFzfAvailable() {
Expand Down Expand Up @@ -136,23 +101,6 @@ async function selectSpecInteractively(specs) {
});
}

function hasDeployedCommandMarkdowns() {
return getDeployedCommandDirs().some(dirPath => {
if (!fs.existsSync(dirPath)) {
return false;
}

const files = fs.readdirSync(dirPath);
return files.some(file => /^zest-dev-.*\.md$/.test(file));
});
}

function hasDeployedZestDevSkill() {
return getDeployedZestDevSkillDirs().some(dirPath =>
fs.existsSync(path.join(dirPath, 'SKILL.md'))
);
}

program
.name('zest-dev')
.description('A lightweight, human-interactive development workflow for AI-assisted coding')
Expand All @@ -165,9 +113,9 @@ program
.action(() => {
try {
const status = getSpecsStatus();
if (hasDeployedCommandMarkdowns() || hasDeployedZestDevSkill()) {
if (hasDeployedSkills()) {
status.agent_hints = [
'Run `zest-dev init` to update deployed commands and skills.'
'Run `zest-dev init` to update deployed skills.'
];
}

Expand Down Expand Up @@ -305,19 +253,10 @@ program
// zest-dev init
program
.command('init')
.description('Initialize plugin deployment for OpenCode and/or Codex')
.option('--global', 'Deploy to global user locations (default)')
.option('--local', 'Deploy to the current project directory')
.option('-t, --target <target>', 'Deployment target (all|opencode|codex)')
.action((options) => {
.description('Install packaged skills to ~/.agents/skills')
.action(() => {
try {
if (options.global && options.local) {
throw new Error('Cannot specify both --global and --local');
}

const scope = options.local ? 'local' : 'global';
const target = options.target || (scope === 'local' ? 'opencode' : 'all');
const result = deployPlugin({ scope, target });
const result = installSkills();
console.log(yaml.dump(result));
} catch (error) {
console.error('Error:', error.message);
Expand Down
15 changes: 3 additions & 12 deletions e2e/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@
from helpers.paths import REPO_ROOT


EXPECTED_COMMANDS = [
"zest-dev-grilling.md",
"zest-dev-lightweight.md",
EXPECTED_SKILLS = [
"t3-task",
"zest-dev",
]
THIN_COMMANDS = EXPECTED_COMMANDS
SKILL_SECTION_FILES = ["overview.md", "design.md", "plan.md", "implementation.md"]
CODEX_SUBAGENTS = ["code-architect.toml", "code-explorer.toml", "code-reviewer.toml"]
FINAL_RALPH_TASK = (
"Make sure all tasks are done in ralph loops, and then create PR. "
"If there is a related issue, make sure to link it in the PR."
Expand Down Expand Up @@ -106,13 +104,6 @@ def frontmatter(content: str, filename: str) -> dict:
return parsed


def assert_plugin_resource_symlink_at(root_dir: Path, name: str) -> None:
plugin_path = root_dir / "plugin" / name
top_level_path = root_dir / name
assert plugin_path.is_symlink(), f"plugin/{name} should be a symlink"
assert plugin_path.resolve() == top_level_path.resolve()


def create_dangling_active_symlink(project_dir: Path, target_id: str) -> None:
active_link = project_dir / "specs" / "change" / "active"
try:
Expand Down
Loading
Loading