Skip to content

Commit 1b18daf

Browse files
authored
Merge pull request #2043 from jimthompson5802/iss-2038-enable-claude-ai-suppor
feat(calm-cli, calm-ai): Add support for AI Assistant support for Claude Code
2 parents e4b4429 + 0245840 commit 1b18daf

11 files changed

Lines changed: 434 additions & 231 deletions

File tree

calm-ai/README.md

Lines changed: 237 additions & 110 deletions
Large diffs are not rendered by default.

calm-ai/ai-assistants/claude.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"description": "Claude Code integrated with FINOS CALM",
3+
"topLevelDirectory": ".claude/skills/calm",
4+
"topLevelPromptFileName": "SKILL.md",
5+
"skillPrefix": "`",
6+
"skillSuffix": "`",
7+
"frontmatter": "---\nname: calm\ndescription: An AI Assistant for FINOS CALM development.\nuser-invocable: true\n---",
8+
"skillPrompts": [
9+
"calm-prompts/architecture-creation.md",
10+
"calm-prompts/calm-cli-instructions.md",
11+
"calm-prompts/node-creation.md",
12+
"calm-prompts/relationship-creation.md",
13+
"calm-prompts/interface-creation.md",
14+
"calm-prompts/metadata-creation.md",
15+
"calm-prompts/control-creation.md",
16+
"calm-prompts/flow-creation.md",
17+
"calm-prompts/pattern-creation.md",
18+
"calm-prompts/documentation-creation.md",
19+
"calm-prompts/standards-creation.md"
20+
]
21+
}

calm-ai/ai-assistants/copilot.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"description": "Github Copilot integrated with FINOS CALM",
33
"topLevelDirectory": ".github/chatmodes",
4-
"topLevelPromptDirectory": "",
5-
"skill-prefix": "`",
6-
"skill-suffix": "`",
4+
"topLevelPromptFileName": "CALM.chatmode.md",
5+
"skillPrefix": "`",
6+
"skillSuffix": "`",
77
"frontmatter": "---\ndescription: An AI Assistant for FINOS CALM development.\ntools: ['codebase', 'editFiles', 'fetch', 'runInTerminal']\nmodel: Claude Sonnet 4.5\n---",
8-
"skill-prompts": [
8+
"skillPrompts": [
99
"calm-prompts/architecture-creation.md",
1010
"calm-prompts/calm-cli-instructions.md",
1111
"calm-prompts/node-creation.md",

calm-ai/ai-assistants/kiro.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"description": "AWS Kiro/Q integrated with FINOS CALM",
33
"frontmatter": "---\ninclusion: manual\n---",
44
"topLevelDirectory": ".kiro",
5-
"topLevelPromptDirectory": "steering",
6-
"skill-prefix": "#[[",
7-
"skill-suffix": "]]",
8-
"skill-prompts": [
5+
"topLevelPromptFileName": "steering/CALM.chatmode.md",
6+
"skillPrefix": "#[[",
7+
"skillSuffix": "]]",
8+
"skillPrompts": [
99
"calm-prompts/architecture-creation.md",
1010
"calm-prompts/calm-cli-instructions.md",
1111
"calm-prompts/node-creation.md",

calm-ai/templates/CALM.chatmode_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ On your first prompt in each session, you MUST:
3232

3333
1. Display: "Loading FINOS CALM instructions..."
3434
2. Read these tool prompt files to understand current CALM guidance:
35-
{{#each skill-prompts}}
36-
- {{{../skill-prefix}}}{{../topLevelDirectory}}/{{{this}}}{{{../skill-suffix}}}
35+
{{#each skillPrompts}}
36+
- {{{../skillPrefix}}}{{../topLevelDirectory}}/{{{this}}}{{{../skillSuffix}}}
3737
{{/each}}
3838

3939
3. After reading the prompts, confirm you're ready to assist with CALM architectures.

calm-ai/tools/calm-cli-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Configure CALM-specific AI assistance inside a repo:
130130
calm init-ai -p <provider> [--directory <path>] [--verbose]
131131
```
132132

133-
At present Github Copilot (`copilot`) and AWS Kiro (`kiro`) are supported as providers.
133+
At present Github Copilot (`copilot`), AWS Kiro (`kiro`), and Claude Code (`claude`) are supported as providers.
134134

135135
This generates custom prompts for the specified <provider> to use CALM-aware tools (nodes, relationships, interfaces, controls, flows, patterns, metadata).
136136

cli/DEVELOPER_GUIDE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,23 @@ There are currently two types of tests;
5252
- `cli` tests - these are end-to-end and involve linking the package as part of the test so that we can assert on actual `calm X` invocations.
5353
- `shared` tests - these are where the core logic tests live, like how validation behaves etc.
5454

55+
### Local verification of new CLI version
56+
57+
```shell
58+
$ cd cli
59+
60+
# create local distribution package in /tmp directory
61+
$ npm pack --pack-destination /tmp
62+
63+
# install from the local distribution package.
64+
# Note: this will replace an existing calm cli install in the global area
65+
$ npm install -g /tmp/finos-calm-cli-<version-identifier>.tgz
66+
67+
# run manual verfication of the new version, e.g,.
68+
# calm --help
69+
# calm init-ai --help
70+
```
71+
5572
## Releasing the CLI
5673

5774
The CLI uses **semantic-release** for automated releases. Version management follows these principles:

cli/src/cli.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ const TEMPLATE_DIR_OPTION = '-d, --template-dir <path>';
3232
const URL_MAPPING_OPTION = '-u, --url-to-local-file-mapping <path>';
3333
const CLEAR_OUTPUT_DIRECTORY_OPTION = '--clear-output-directory';
3434

35+
// init-ai command options
36+
const AI_DIRECTORY_OPTION = '-d, --directory <path>';
37+
const AI_PROVIDER_OPTION = '-p, --provider <provider>';
38+
const AI_PROVIDER_CHOICES = ['copilot', 'kiro', 'claude'];
39+
3540
export function setupCLI(program: Command) {
3641
program
3742
.name('calm')
@@ -228,18 +233,18 @@ export function setupCLI(program: Command) {
228233
await setupAiTools('copilot', options.directory, !!options.verbose);
229234
});
230235

231-
const providerOption = new Option('-p, --provider <provider>', 'AI provider to initialize')
232-
.choices(['copilot', 'kiro']);
236+
const providerOption = new Option(AI_PROVIDER_OPTION, 'AI provider to initialize')
237+
.choices(AI_PROVIDER_CHOICES);
233238

234239
program
235240
.command('init-ai')
236241
.description('Augment a git repository with AI assistance for CALM')
237242
.addOption(providerOption)
238-
.option('-d, --directory <path>', 'Target directory (defaults to current directory)', '.')
243+
.option(AI_DIRECTORY_OPTION, 'Target directory (defaults to current directory)', '.')
239244
.option(VERBOSE_OPTION, 'Enable verbose logging.', false)
240245
.action(async (options) => {
241246
const { setupAiTools } = await import('./command-helpers/ai-tools');
242-
const providers = (providerOption as Option & { argChoices?: string[] }).argChoices ?? [];
247+
const providers = AI_PROVIDER_CHOICES;
243248
let selectedProvider: string = options.provider;
244249
if (!selectedProvider) {
245250
const answer = await inquirer.prompt({

0 commit comments

Comments
 (0)