Class ShaftProjectService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateProject(String outputDirectory, String runner, String platform, String groupId, String artifactId, String version, String shaftVersion, List<String> optionalModules, boolean includeGithubActions, boolean includeDependabot, boolean overwrite) Creates a SHAFT Maven project from the same examples and rules used by the guide generator.createProject(String outputDirectory, String runner, String platform, String groupId, String artifactId, String version, List<String> optionalModules, boolean includeGithubActions, boolean includeDependabot, boolean overwrite) Creates a SHAFT Maven project and resolves the generated<shaft.version>from Maven Central.initAgents(String loop, String targetDirectory, boolean overwrite) Scaffolds SHAFT agent/skill bridge definitions into an existing test repo for a coding-agent loop.upgradeProject(String projectRoot, String upgradeType, boolean dryRun, boolean approve, String shaftVersion, String compileCommand, int compileTimeout, boolean skipBaselineCompile, boolean allowAiRepair) Runs the existing modular SHAFT project upgrader script against a Java project.
-
Constructor Details
-
ShaftProjectService
public ShaftProjectService()Creates the default project lifecycle MCP service.
-
-
Method Details
-
createProject
@Tool(name="shaft_project_create", description="creates a new SHAFT Maven project from the same examples and rules used by the guide generator") public McpShaftProjectGenerationResult createProject(String outputDirectory, String runner, String platform, String groupId, String artifactId, String version, String shaftVersion, List<String> optionalModules, boolean includeGithubActions, boolean includeDependabot, boolean overwrite) Creates a SHAFT Maven project from the same examples and rules used by the guide generator.- Parameters:
outputDirectory- workspace-relative output directoryrunner- TestNG, JUnit, or Cucumberplatform- web, mobile, or api where supported by the selected runnergroupId- Maven group IDartifactId- Maven artifact ID; defaults to the guide generator artifact name when blankversion- Maven project version; defaults to 1.0.0 when blankshaftVersion- optional override for generated project<shaft.version>optionalModules- optional SHAFT module artifact IDsincludeGithubActions- whether to include the generated workflow for web/api projectsincludeDependabot- whether to include Dependabot configurationoverwrite- whether existing files may be replaced- Returns:
- generated project details
-
createProject
public McpShaftProjectGenerationResult createProject(String outputDirectory, String runner, String platform, String groupId, String artifactId, String version, List<String> optionalModules, boolean includeGithubActions, boolean includeDependabot, boolean overwrite) Creates a SHAFT Maven project and resolves the generated<shaft.version>from Maven Central.- Parameters:
outputDirectory- workspace-relative output directoryrunner- TestNG, JUnit, or Cucumberplatform- web, mobile, or api where supported by the selected runnergroupId- Maven group IDartifactId- Maven artifact IDversion- Maven project versionoptionalModules- optional SHAFT module artifact IDsincludeGithubActions- whether to include a generated GitHub Actions workflowincludeDependabot- whether to include Dependabot configurationoverwrite- whether existing files may be replaced- Returns:
- generated project details
-
upgradeProject
@Tool(name="shaft_project_upgrade", description="runs the existing SHAFT modular project upgrader script against the current Java project") public McpShaftProjectUpgradeResult upgradeProject(String projectRoot, String upgradeType, boolean dryRun, boolean approve, String shaftVersion, String compileCommand, int compileTimeout, boolean skipBaselineCompile, boolean allowAiRepair) Runs the existing modular SHAFT project upgrader script against a Java project.- Parameters:
projectRoot- workspace-relative Java/Maven project rootupgradeType- basic, session, or fulldryRun- whether to preview changes without writing filesapprove- explicit approval required when dryRun is falseshaftVersion- optional target SHAFT versioncompileCommand- optional compile command string passed to the upgradercompileTimeout- compile timeout in seconds; defaults to 900 when non-positiveskipBaselineCompile- whether to pass --skip-baseline-compileallowAiRepair- whether to allow the upgrader to use its configured AI repair path- Returns:
- upgrader process result
-
initAgents
@Tool(name="shaft_project_init_agents", description="scaffolds SHAFT skill bridges and managed host-instruction blocks into an existing test repo for one or all coding-agent loops (all, claude, codex, opencode, vscode); preserves user-authored instruction text and only overwrites SHAFT-owned skill files when overwrite=true") public McpShaftProjectInitAgentsResult initAgents(String loop, String targetDirectory, boolean overwrite) Scaffolds SHAFT agent/skill bridge definitions into an existing test repo for a coding-agent loop.Every bridge is generated at call time from the bundled
shaft-skills/<skill>/SKILL.mdguides shipped inside the shaft-mcp jar, rather than a hand-duplicated copy of the full skill text, so the set of skills and their descriptions always tracksshaft-skills/as of the shaft-mcp build. Existing skill files are left untouched unlessoverwriteistrue; host instruction files always preserve user-authored bytes outside SHAFT's managed block. Existing recognized host adapters are refreshed alongside the selected loop, andallinstalls every supported host adapter.A bundled skill whose
SKILL.mdfrontmatter declaresdistribution: fullis a methodology skill whose value lives in its text, so it is scaffolded as its full body instead of a thin bridge: verbatim for claude/codex/opencode, and with an injectedapplyTo: "**"frontmatter key (body otherwise verbatim) for vscode. Skills without that key keep the thin bridge.- Parameters:
loop- all, claude, codex, opencode, or vscodetargetDirectory- workspace-relative existing test repo directoryoverwrite- whether existing SHAFT-owned skill files may be replaced- Returns:
- generated agent-scaffolding details
-