Synchronizes packaged Fast Forward skills into the consumer repository.
Description
This command SHALL ensure that the consumer repository contains the expected
.agents/skills directory structure backed by the packaged skill set. The
command MUST verify that the packaged skills directory exists before any
synchronization is attempted. If the target skills directory does not exist,
it SHALL be created before the synchronization process begins.
The synchronization workflow is delegated to PackagedDirectorySynchronizer. This command MUST act as an orchestration layer only: it prepares the source and target paths, triggers synchronization, and translates the resulting status into Symfony Console output and process exit codes.
'agents:skills'
'Synchronizes Fast Forward skills into .agents/skills directory.'
['skills']
Constants
Properties
Methods
Initializes the command with an optional skills synchronizer instance.
Adds the standard JSON output options to the current command.
Configures the supported JSON output option.
Executes the skills synchronization workflow.
Determines whether JSON output was requested.
Determines whether pretty JSON output was requested.
Logs a failed command result and returns the failure exit code.
Determines whether structured JSON output SHOULD be enabled implicitly.
Determines whether a boolean input option was enabled.
Logs a non-terminal command message unless structured JSON output is active.
Logs a successful command result and returns the success exit code.
private
FilesystemInterface
$filesystem
private
PackagedDirectorySynchronizer
$synchronizer
Initializes the command with an optional skills synchronizer instance.
public
__construct(PackagedDirectorySynchronizer
$synchronizer, FilesystemInterface
$filesystem) : mixed
Parameters
Description
the synchronizer responsible for applying the skills synchronization process
Description
filesystem used to resolve and manage the skills directory structure
Adds the standard JSON output options to the current command.
protected
addJsonOption() : static
Return values
Configures the supported JSON output option.
protected
configure() : void
Executes the skills synchronization workflow.
protected
execute(InputInterface
$input, OutputInterface
$output) : int
Description
This method SHALL:
- announce the start of synchronization;
- resolve the packaged skills path and consumer target directory;
- fail when the packaged skills directory does not exist;
- create the target directory when it is missing;
- delegate synchronization to PackagedDirectorySynchronizer;
- return a success or failure exit code based on the synchronization result.
The command MUST return self::FAILURE when packaged skills are not available or when the synchronizer reports a failure. It MUST return self::SUCCESS only when synchronization completes successfully.
Parameters
$input
:
InputInterface
Description
the console input instance provided by Symfony
$output
:
OutputInterface
Description
the console output instance used to report progress
Return values
Description
The process exit status. This MUST be self::SUCCESS on success and self::FAILURE on failure.
Determines whether JSON output was requested.
protected
isJsonOutput(InputInterface
$input) : bool
Description
The pretty-json flag SHALL imply JSON output.
Parameters
$input
:
InputInterface
Return values
Determines whether pretty JSON output was requested.
protected
isPrettyJsonOutput(InputInterface
$input) : bool
Parameters
$input
:
InputInterface
Return values
Logs a failed command result and returns the failure exit code.
private
failure(
string
$message, InputInterface
$input[,
array<string, mixed>
$context = []][,
string|null
$file = null][,
int|null
$line = null]) : int
Parameters
$message
:
string
Description
the failure message
$input
:
InputInterface
Description
the originating command input
$context
:
array<string, mixed>
=
[]
Description
optional extra log context
$file
:
string|null
=
null
Description
the related file path when known
$line
:
int|null
=
null
Description
the related line when known
Return values
Determines whether structured JSON output SHOULD be enabled implicitly.
private
isImplicitJsonOutputEnabled() : bool
Description
Commands MAY opt into runtime-environment-aware behavior by exposing a
$runtimeEnvironment property. Commands that do not expose it SHALL fall
back to the shared runtime-environment service from the DevTools container.
Return values
Determines whether a boolean input option was enabled.
private
isOptionEnabled(InputInterface
$input,
string
$option) : bool
Parameters
$input
:
InputInterface
$option
:
string
Return values
Logs a non-terminal command message unless structured JSON output is active.
private
log(
string
$message, InputInterface
$input[,
array<string, mixed>
$context = []][,
string
$logLevel = LogLevel::INFO]) : void
Parameters
$message
:
string
Description
the progress message
$input
:
InputInterface
Description
the originating command input
$context
:
array<string, mixed>
=
[]
Description
optional extra log context
$logLevel
:
string
=
LogLevel::INFO
Description
the PSR-3 log level used for the message
private
resolveRuntimeEnvironment() : RuntimeEnvironmentInterface|null
Return values
Logs a successful command result and returns the success exit code.
private
success(
string
$message, InputInterface
$input[,
array<string, mixed>
$context = []][,
string
$logLevel = LogLevel::INFO]) : int
Parameters
$message
:
string
Description
the success message
$input
:
InputInterface
Description
the originating command input
$context
:
array<string, mixed>
=
[]
Description
optional extra log context
$logLevel
:
string
=
LogLevel::INFO
Description
the PSR-3 log level used for the successful result