Skip to content

feat(profile): add 'all' profile preset for installing all workflows#1207

Open
bgc2020 wants to merge 1 commit into
Fission-AI:mainfrom
bgc2020:main
Open

feat(profile): add 'all' profile preset for installing all workflows#1207
bgc2020 wants to merge 1 commit into
Fission-AI:mainfrom
bgc2020:main

Conversation

@bgc2020

@bgc2020 bgc2020 commented Jun 12, 2026

Copy link
Copy Markdown

Add a third profile option 'all' alongside 'core' and 'custom':

  • openspec init --profile all installs all 11 workflows
  • openspec config profile all preset shortcut
  • deriveProfileFromWorkflowSelection returns 'all' when all workflows selected
  • Migration sets 'all' profile when all workflows are already installed
  • Interactive picker auto-derives 'all' when all 11 workflows are checked

Source changes: Profile type, Zod schemas, getProfileWorkflows, resolveProfileOverride, migration logic, config command presets, workspace skill state schemas, CLI descriptions, completions.

Test additions: profile resolution, init --profile all, config schema validation, deriveProfileFromWorkflowSelection, config profile preset, migration to 'all', global-config round-trip.

Docs updates: cli.md, commands.md, getting-started.md, workflows.md, migration-guide.md, supported-tools.md, CHANGELOG.md, spec.md.

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]

Summary by CodeRabbit

  • New Features
    • Added an all profile option for openspec init --profile and openspec config profile to install every available workflow.
    • Added openspec init --language <code> and language support in openspec/config.yaml to drive language-aware prompt context.
  • Bug Fixes
    • Improved profile detection during migration and profile derivation to reliably use all when all workflows are present.
  • Documentation
    • Updated CLI reference and setup/migration guides to reflect all profile behavior and the new --language workflow.

Add a third profile option 'all' alongside 'core' and 'custom':
- openspec init --profile all installs all 11 workflows
- openspec config profile all preset shortcut
- deriveProfileFromWorkflowSelection returns 'all' when all workflows selected
- Migration sets 'all' profile when all workflows are already installed
- Interactive picker auto-derives 'all' when all 11 workflows are checked

Source changes: Profile type, Zod schemas, getProfileWorkflows,
resolveProfileOverride, migration logic, config command presets,
workspace skill state schemas, CLI descriptions, completions.

Test additions: profile resolution, init --profile all, config schema
validation, deriveProfileFromWorkflowSelection, config profile preset,
migration to 'all', global-config round-trip.

Docs updates: cli.md, commands.md, getting-started.md, workflows.md,
migration-guide.md, supported-tools.md, CHANGELOG.md, spec.md.

🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%]
Co-authored-by: opencode (glm-5.1) <ai@local>
@bgc2020 bgc2020 requested a review from TabishB as a code owner June 12, 2026 08:16
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR extends OpenSpec with two complementary features: an 'all' profile preset that installs all 11 available workflows, and multi-language support that auto-injects language-specific instructions into artifact prompts. The changes flow from type definitions through profile resolution, config serialization, CLI wiring, migration inference, and comprehensive documentation updates.

Changes

Profile System Enhancement and Language Support

Layer / File(s) Summary
Profile type definitions and schema constraints
src/core/global-config.ts, src/core/config-schema.ts, src/core/workspace/foundation.ts, src/core/workspace/legacy-state.ts
Profile type and validation schemas expanded to accept 'all' in addition to 'core' and 'custom' across global config, workspace state, and legacy state layers.
Profile resolution and workflow mapping
src/core/profiles.ts, src/commands/config.ts
getProfileWorkflows returns ALL_WORKFLOWS for 'all' profile; deriveProfileFromWorkflowSelection detects when selected workflows match all available workflows and returns 'all'; config list displays appropriate workflows per profile.
Config command profile handling
src/commands/config.ts
config profile preset logic recognizes 'all' preset, applies it directly without prompts; config list now displays ALL_WORKFLOWS when profile is 'all' and outputs Language field when present.
Language support foundation module
src/core/language.ts
New module defining supported language codes, instruction mappings, and utilities for language validation, instruction lookup, prepending language instructions to context while stripping prior ones, and context cleanup.
Project config with language and profile migration
src/core/project-config.ts, src/core/migration.ts
Project config schema extended with optional language field constrained to supported languages; migration logic detects whether installed workflows equal ALL_WORKFLOWS and sets profile to 'all' vs 'custom' accordingly, deriving final workflow set via getProfileWorkflows.
Config serialization with language field
src/core/config-prompts.ts
serializeConfig updated to conditionally include language in YAML output (omitting 'en') and documents auto-injection of language instructions from the language field.
Init command: profile and language options
src/cli/index.ts, src/core/completions/command-registry.ts, src/core/init.ts
openspec init extended with --language option for language override; --profile accepts 'all'; language and profile validation added; command registry and help text updated; config serialization receives resolved language value.
Artifact instructions with language context
src/core/artifact-graph/instruction-loader.ts, src/commands/config.ts
Instruction loader prepends language-specific instructions to project context using projectConfig.language; config list outputs Language metadata when present.
Documentation: profiles, language, migration, and CLI reference
CHANGELOG.md, docs/cli.md, docs/commands.md, docs/getting-started.md, docs/migration-guide.md, docs/supported-tools.md, docs/workflows.md, docs/multi-language.md, openspec/specs/cli-config/spec.md
Changelog, CLI docs, guides, tool references, workflow instructions, language guide, and spec all updated to describe 'all' profile option, --language CLI flag, language auto-injection behavior, and migration profile detection.
Test coverage: profiles and language functionality
test/commands/config-profile.test.ts, test/commands/config.test.ts, test/core/global-config.test.ts, test/core/init.test.ts, test/core/migration.test.ts, test/core/profiles.test.ts, test/core/language.test.ts, test/core/artifact-graph/instruction-loader.test.ts, test/core/project-config.test.ts
New tests verify profile derivation returns 'all' for all workflows; config schema validates 'all' profile; init/migration with 'all' profile installs extended workflows; language codes supported, instructions mapped and prepended correctly; context cleanup preserves non-instruction content; config round-trip serialization preserves language field; instruction generation prepends language instructions for non-English languages.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant InitCmd as InitCommand
  participant ProjConfig as ProjectConfig
  participant Instr as InstructionLoader
  participant Prompts as Artifact Prompts
  User->>InitCmd: openspec init --profile all --language ja
  InitCmd->>InitCmd: validate profile='all'
  InitCmd->>InitCmd: validate language='ja'
  InitCmd->>ProjConfig: serializeConfig({language: 'ja'})
  ProjConfig->>Prompts: language: ja
  Instr->>ProjConfig: readProjectConfig()
  ProjConfig-->>Instr: {language: 'ja'}
  Instr->>Instr: prependLanguageInstruction('ja', context)
  Instr->>Prompts: Japanese instructions + original context
  Prompts->>User: localized artifact prompts
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

  • Fission-AI/OpenSpec#726: Main PR extends the profile system introduced in PR #726 by updating profile/preset plumbing (global config/schema, openspec init --profile, config profile derivation/listing, migration profile detection) to support an additional 'all' preset.
  • Fission-AI/OpenSpec#736: Main PR extends the same openspec config profile/deriveProfileFromWorkflowSelection logic and config listing/presets introduced by the retrieved PR to recognize the new 'all' profile.
  • Fission-AI/OpenSpec#499: Both PRs modify src/core/artifact-graph/instruction-loader.ts's generateInstructions to enrich project-level context via readProjectConfig—the retrieved PR adds context/rules injection, and the main PR further prepends a language instruction from projectConfig.language.

Suggested reviewers

  • alfred-openspec

Poem

🐰 All profiles now shine with language bright,
Eleven workflows gathered in one sight!
Japanese, Portuguese whispers too,
Auto-injected context for me and you,
Config flows true, from core to "all" in flight! 🌍

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 63.64% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main feature addition: introducing a new 'all' profile preset that allows users to install all workflows in one command.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
test/core/init.test.ts (1)

539-554: 💤 Low value

Test title suggests more comprehensive verification than implemented.

The test is titled "should use --profile all to install all workflows" but only verifies 2 of the 11 workflows are created (propose and onboard). While this is acceptable as a smoke test verifying both core and expanded workflows are included, the title could be more accurate.

Consider either:

  • Verifying all 11 workflows are created for comprehensive coverage
  • Renaming to "should use --profile all to install core and expanded workflows"

The test logic itself is correct and follows established patterns.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/core/init.test.ts` around lines 539 - 554, The test title is misleading
because it asserts only two workflows; update the test to either assert all 11
workflows exist or change the test title to reflect it checks core + expanded
workflows. Locate the InitCommand usage in the test (new InitCommand({ tools:
'claude', force: true, profile: 'all' })) and either add expectations for the
remaining workflow SKILL.md files (matching the other nine workflow identifiers)
or rename the it(...) description from "should use --profile all to install all
workflows" to "should use --profile all to install core and expanded workflows"
so the name matches the assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@test/core/init.test.ts`:
- Around line 539-554: The test title is misleading because it asserts only two
workflows; update the test to either assert all 11 workflows exist or change the
test title to reflect it checks core + expanded workflows. Locate the
InitCommand usage in the test (new InitCommand({ tools: 'claude', force: true,
profile: 'all' })) and either add expectations for the remaining workflow
SKILL.md files (matching the other nine workflow identifiers) or rename the
it(...) description from "should use --profile all to install all workflows" to
"should use --profile all to install core and expanded workflows" so the name
matches the assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f5900077-cbec-42b8-a56c-d79dd26fed83

📥 Commits

Reviewing files that changed from the base of the PR and between 1b06fdd and 735fa84.

📒 Files selected for processing (25)
  • AGENTS.md
  • CHANGELOG.md
  • docs/cli.md
  • docs/commands.md
  • docs/getting-started.md
  • docs/migration-guide.md
  • docs/supported-tools.md
  • docs/workflows.md
  • openspec/specs/cli-config/spec.md
  • src/cli/index.ts
  • src/commands/config.ts
  • src/core/completions/command-registry.ts
  • src/core/config-schema.ts
  • src/core/global-config.ts
  • src/core/init.ts
  • src/core/migration.ts
  • src/core/profiles.ts
  • src/core/workspace/foundation.ts
  • src/core/workspace/legacy-state.ts
  • test/commands/config-profile.test.ts
  • test/commands/config.test.ts
  • test/core/global-config.test.ts
  • test/core/init.test.ts
  • test/core/migration.test.ts
  • test/core/profiles.test.ts

@alfred-openspec alfred-openspec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the profile/config/migration surface and this looks good to merge. The all preset is wired through schema/types, init override validation, config profile preset, workflow resolution, workspace state parsing, migration inference, docs, and completions.\n\nVerified locally: focused config/profile/init/migration/profile tests pass, and pnpm exec tsc --noEmit passes. Small note: the branch deletes an empty root AGENTS.md, which is harmless but also unrelated if you want to keep the diff tidier.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
test/core/artifact-graph/instruction-loader.test.ts (1)

469-486: 💤 Low value

Consider moving temp directory cleanup outside the loop (affects multiple tests).

Both sites use a loop-based pattern that creates and cleans up a temp directory per iteration. If an assertion fails mid-loop, subsequent iterations won't run and their temp directories won't be cleaned up.

  • test/core/artifact-graph/instruction-loader.test.ts#L469-L486: The loop over nonEnLangs creates/cleans temp dirs inside the loop body, making cleanup fragile when assertions fail.
  • test/core/project-config.test.ts#L95-L105: The loop over supported languages creates/cleans temp dirs inside the loop body with the same fragility.

Consider refactoring to use a single temp directory for all iterations, or extracting to a parameterized test pattern (e.g., it.each([...])) for more robust cleanup handled by the test framework.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/core/artifact-graph/instruction-loader.test.ts` around lines 469 - 486,
The test at test/core/artifact-graph/instruction-loader.test.ts#L469-L486 uses a
loop-based pattern where temp directories are created and cleaned up inside the
loop body, making cleanup fragile if assertions fail mid-loop. Refactor this
test to use parameterized testing with it.each() passing the nonEnLangs array as
test parameters, moving the temp directory creation and cleanup outside the loop
body so the test framework manages cleanup properly. Apply the same refactoring
pattern to the sibling test at test/core/project-config.test.ts#L95-L105 which
has the same loop-based cleanup fragility issue with its supported languages
iteration.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@test/core/artifact-graph/instruction-loader.test.ts`:
- Around line 469-486: The test at
test/core/artifact-graph/instruction-loader.test.ts#L469-L486 uses a loop-based
pattern where temp directories are created and cleaned up inside the loop body,
making cleanup fragile if assertions fail mid-loop. Refactor this test to use
parameterized testing with it.each() passing the nonEnLangs array as test
parameters, moving the temp directory creation and cleanup outside the loop body
so the test framework manages cleanup properly. Apply the same refactoring
pattern to the sibling test at test/core/project-config.test.ts#L95-L105 which
has the same loop-based cleanup fragility issue with its supported languages
iteration.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 60ddda00-958c-4fa8-ad1c-15ffe49afc73

📥 Commits

Reviewing files that changed from the base of the PR and between 735fa84 and 53d8984.

📒 Files selected for processing (14)
  • docs/cli.md
  • docs/multi-language.md
  • src/cli/index.ts
  • src/commands/config.ts
  • src/core/artifact-graph/instruction-loader.ts
  • src/core/completions/command-registry.ts
  • src/core/config-prompts.ts
  • src/core/init.ts
  • src/core/language.ts
  • src/core/project-config.ts
  • test/core/artifact-graph/instruction-loader.test.ts
  • test/core/init.test.ts
  • test/core/language.test.ts
  • test/core/project-config.test.ts
✅ Files skipped from review due to trivial changes (1)
  • docs/multi-language.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/cli.md
  • src/core/completions/command-registry.ts

@alfred-openspec alfred-openspec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked after the previous approval was dismissed. The profile schema/types, config preset, init override, completions, migration inference, workspace state parsing, docs, and focused tests still look coherent. The deleted root AGENTS.md is an empty placeholder in the diff, and the remaining CodeRabbit point is a non-blocking test-title nit. Still looks good to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants