@intentius/chant-lexicon-aws 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-aws",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "files": ["src/", "dist/"],
@@ -3,7 +3,7 @@
3
3
  exports[`snapshot tests Bucket lexicon entry 1`] = `
4
4
  {
5
5
  "attrs": {
6
- "arn": "Arn",
6
+ "Arn": "Arn",
7
7
  },
8
8
  "createOnly": [
9
9
  "BucketName",
@@ -27,7 +27,7 @@ exports[`snapshot tests Bucket lexicon entry 1`] = `
27
27
  exports[`snapshot tests Function lexicon entry 1`] = `
28
28
  {
29
29
  "attrs": {
30
- "arn": "Arn",
30
+ "Arn": "Arn",
31
31
  },
32
32
  "kind": "resource",
33
33
  "lexicon": "aws",
@@ -79,8 +79,8 @@ exports[`snapshot tests Function lexicon entry 1`] = `
79
79
  exports[`snapshot tests Role lexicon entry 1`] = `
80
80
  {
81
81
  "attrs": {
82
- "arn": "Arn",
83
- "roleId": "RoleId",
82
+ "Arn": "Arn",
83
+ "RoleId": "RoleId",
84
84
  },
85
85
  "kind": "resource",
86
86
  "lexicon": "aws",
@@ -160,17 +160,17 @@ exports[`snapshot tests Bucket .d.ts class declaration 1`] = `
160
160
  "export declare class Bucket {
161
161
  constructor(props: {
162
162
  /** A name for the bucket. */
163
- bucketName: string;
163
+ BucketName: string;
164
164
  /** The Amazon Resource Name (ARN) of the bucket. */
165
- arn?: string;
165
+ Arn?: string;
166
166
  /** Specifies default encryption for a bucket. */
167
- bucketEncryption?: Bucket_BucketEncryption;
167
+ BucketEncryption?: Bucket_BucketEncryption;
168
168
  /** An arbitrary set of tags (key-value pairs) for this S3 bucket. */
169
- tags?: Bucket_Tag[];
169
+ Tags?: Bucket_Tag[];
170
170
  /** Enables multiple versions of all objects in this bucket. */
171
- versioningConfiguration?: Bucket_VersioningConfiguration;
171
+ VersioningConfiguration?: Bucket_VersioningConfiguration;
172
172
  });
173
- readonly arn: string;
173
+ readonly Arn: string;
174
174
  }"
175
175
  `;
176
176
 
@@ -178,20 +178,20 @@ exports[`snapshot tests Function .d.ts class declaration 1`] = `
178
178
  "export declare class Function {
179
179
  constructor(props: {
180
180
  /** The code for the function. */
181
- code: Function_Code;
181
+ Code: Function_Code;
182
182
  /** The ARN of the function's execution role. */
183
- role: string;
183
+ Role: string;
184
184
  /** The ARN of the function. */
185
- arn?: string;
185
+ Arn?: string;
186
186
  /** The name of the Lambda function. */
187
- functionName?: string;
187
+ FunctionName?: string;
188
188
  /** The name of the method within your code that Lambda calls to run your function. */
189
- handler?: string;
189
+ Handler?: string;
190
190
  /** The amount of memory available to the function at runtime. */
191
- memorySize?: number;
191
+ MemorySize?: number;
192
192
  /** The identifier of the function's runtime. */
193
- runtime?: "java17" | "java21" | "nodejs18.x" | "nodejs20.x" | "python3.11" | "python3.12";
193
+ Runtime?: "java17" | "java21" | "nodejs18.x" | "nodejs20.x" | "python3.11" | "python3.12";
194
194
  });
195
- readonly arn: string;
195
+ readonly Arn: string;
196
196
  }"
197
197
  `;
@@ -152,7 +152,7 @@ Produces this CloudFormation resource:
152
152
  }
153
153
  \`\`\`
154
154
 
155
- Notice how \`dataBucket\` becomes \`DataBucket\` (PascalCase logical ID), and \`bucketName\` becomes \`BucketName\`. This mapping is automatic.
155
+ Notice how \`dataBucket\` becomes \`DataBucket\` (PascalCase logical ID). Property names like \`BucketName\` use the CloudFormation spec-native PascalCase directly.
156
156
 
157
157
  ## Resource types and naming
158
158
 
@@ -517,7 +517,7 @@ Pass CloudFormation Parameters to child stacks with the \`parameters\` option:
517
517
  \`\`\`typescript
518
518
  import { nestedStack } from "@intentius/chant-lexicon-aws";
519
519
 
520
- const network = nestedStack("network", import.meta.dir + "/network", {
520
+ const network = nestedStack("network", import.meta.dirname + "/network", {
521
521
  parameters: { Environment: "prod", CidrBlock: "10.0.0.0/16" },
522
522
  });
523
523
  \`\`\`
@@ -739,8 +739,8 @@ src/
739
739
  **Patterns demonstrated:**
740
740
 
741
741
  1. **Direct imports** — lexicon types come from \`@intentius/chant-lexicon-aws\`, sibling exports are imported from the file that defines them
742
- 2. **Shared defaults** — \`defaults.ts\` exports reusable property objects (\`bucketEncryption\`, \`publicAccessBlock\`) that other files import directly
743
- 3. **Cross-resource references** — \`dataBucket.arn\` in \`handler.ts\` serializes to \`Fn::GetAtt\` in the template
742
+ 2. **Shared defaults** — \`defaults.ts\` exports reusable property objects (\`BucketEncryption\`, \`PublicAccessBlockConfiguration\`) that other files import directly
743
+ 3. **Cross-resource references** — \`dataBucket.Arn\` in \`handler.ts\` serializes to \`Fn::GetAtt\` in the template
744
744
  4. **Intrinsics** — \`Sub\` tagged templates with pseudo-parameters for dynamic naming
745
745
 
746
746
  {{file:getting-started/src/handler.ts}}
@@ -798,6 +798,61 @@ src/
798
798
 
799
799
  See [Nested Stacks](./nested-stacks) for the full guide.`,
800
800
  },
801
+ {
802
+ slug: "skills",
803
+ title: "AI Skills",
804
+ description: "AI agent skills bundled with the AWS CloudFormation lexicon",
805
+ content: `The AWS lexicon ships an AI skill called **chant-aws** that teaches AI coding agents (like Claude Code) how to build, validate, and deploy CloudFormation templates from a chant project.
806
+
807
+ ## What are skills?
808
+
809
+ Skills are structured markdown documents bundled with a lexicon. When an AI agent works in a chant project, it discovers and loads relevant skills automatically — giving it operational knowledge about the deployment workflow without requiring the user to explain each step.
810
+
811
+ ## Installation
812
+
813
+ When you scaffold a new project with \`chant init --lexicon aws\`, the skill is installed to \`.claude/skills/chant-aws/SKILL.md\` for automatic discovery by Claude Code.
814
+
815
+ For existing projects, create the file manually:
816
+
817
+ \`\`\`
818
+ .claude/
819
+ skills/
820
+ chant-aws/
821
+ SKILL.md # skill content (see below)
822
+ \`\`\`
823
+
824
+ ## Skill: chant-aws
825
+
826
+ The \`chant-aws\` skill covers the full deployment lifecycle:
827
+
828
+ - **Build** — \`chant build src/ --output stack.json\`
829
+ - **Validate** — \`chant lint src/\` + \`aws cloudformation validate-template\`
830
+ - **Deploy** — \`aws cloudformation deploy\` with capabilities
831
+ - **Update** — change sets for preview, or direct deploy
832
+ - **Delete** — \`aws cloudformation delete-stack\`
833
+ - **Status** — \`describe-stacks\` and \`describe-stack-events\`
834
+ - **Troubleshooting** — event inspection, rollback recovery, drift detection
835
+
836
+ The skill is invocable as a slash command: \`/chant-aws\`
837
+
838
+ ## MCP integration
839
+
840
+ The lexicon also provides MCP (Model Context Protocol) tools and resources that AI agents can use programmatically:
841
+
842
+ | MCP tool | Description |
843
+ |----------|-------------|
844
+ | \`build\` | Build the chant project |
845
+ | \`lint\` | Run lint rules |
846
+ | \`explain\` | Summarize project resources |
847
+ | \`scaffold\` | Generate starter files |
848
+ | \`search\` | Search available resource types |
849
+ | \`aws:diff\` | Compare current build output against previous |
850
+
851
+ | MCP resource | Description |
852
+ |--------------|-------------|
853
+ | \`resource-catalog\` | JSON list of all supported CloudFormation resource types |
854
+ | \`examples/basic-stack\` | Example stack with S3 bucket and IAM role |`,
855
+ },
801
856
  ],
802
857
  };
803
858
 
@@ -152,17 +152,6 @@ export function writeGeneratedFiles(result: GenerateResult, baseDir: string): vo
152
152
  "",
153
153
  ].join("\n"),
154
154
  },
155
- snapshot: (generatedDir) => {
156
- const { snapshotArtifacts, saveSnapshot } = require("./rollback");
157
- const lexiconPath = join(generatedDir, "lexicon-aws.json");
158
- if (existsSync(lexiconPath)) {
159
- const snapshot = snapshotArtifacts(generatedDir);
160
- if (Object.keys(snapshot.files).length > 0) {
161
- const snapshotsDir = join(baseDir, ".snapshots");
162
- saveSnapshot(snapshot, snapshotsDir);
163
- }
164
- }
165
- },
166
155
  });
167
156
  }
168
157
 
@@ -184,8 +173,7 @@ function generateRuntimeIndex(
184
173
  // Build attrs map
185
174
  const attrs: Record<string, string> = {};
186
175
  for (const a of r.resource.attributes) {
187
- const camelName = a.name.charAt(0).toLowerCase() + a.name.slice(1);
188
- attrs[camelName] = a.name;
176
+ attrs[a.name] = a.name;
189
177
  }
190
178
 
191
179
  resourceEntries.push({ tsName, resourceType: cfnType, attrs });
@@ -3,7 +3,9 @@
3
3
  * with AWS-specific manifest building and skill collection.
4
4
  */
5
5
 
6
+ import { createRequire } from "module";
6
7
  import { readFileSync } from "fs";
8
+ const require = createRequire(import.meta.url);
7
9
  import { join, dirname } from "path";
8
10
  import { fileURLToPath } from "url";
9
11
  import type { IntrinsicDef } from "@intentius/chant/lexicon";
@@ -6,7 +6,7 @@ describe("typecheckDTS", () => {
6
6
  const content = `
7
7
  export declare class Bucket {
8
8
  readonly type: string;
9
- readonly bucketName?: string;
9
+ readonly BucketName?: string;
10
10
  }
11
11
  `;
12
12
  const result = await typecheckDTS(content);