@intentius/chant-lexicon-aws 0.0.15 → 0.0.16

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "xxhash64",
3
3
  "artifacts": {
4
- "manifest.json": "cd37528ee323ee40",
4
+ "manifest.json": "c545c90591cb19d5",
5
5
  "meta.json": "41a0d6e1ffe91da7",
6
6
  "types/index.d.ts": "373de3ff75fb53b7",
7
7
  "rules/hardcoded-region.ts": "5c77997ce5bd34d5",
@@ -31,8 +31,7 @@
31
31
  "rules/waw011.ts": "d609d2e87d0d7440",
32
32
  "rules/waw020.ts": "381aaecfc89f87dd",
33
33
  "rules/waw026.ts": "b1a946c07807f7ad",
34
- "skills/chant-aws.md": "de8d9ccfe4dcf4bc",
35
- "skills/chant-eks.md": "90a956da37b295ca"
34
+ "skills/chant-aws.md": "de8d9ccfe4dcf4bc"
36
35
  },
37
- "composite": "d60321f25cca394d"
36
+ "composite": "fbf3f6df450b669b"
38
37
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aws",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "AWS",
6
6
  "intrinsics": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-aws",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "files": [
@@ -21,8 +21,8 @@
21
21
  "generate": "bun run src/codegen/generate-cli.ts",
22
22
  "bundle": "bun run src/package-cli.ts",
23
23
  "validate": "bun run src/validate-cli.ts",
24
- "docs": "bun src/codegen/docs-cli.ts",
25
- "prepack": "bun run bundle && bun run validate"
24
+ "docs": "bun run src/codegen/docs-cli.ts",
25
+ "prepack": "bun run generate && bun run bundle && bun run validate"
26
26
  },
27
27
  "dependencies": {
28
28
  "@intentius/chant": "0.0.15",
package/src/plugin.ts CHANGED
@@ -899,219 +899,50 @@ aws cloudformation wait stack-update-complete --stack-name my-app-prod`,
899
899
  },
900
900
  ],
901
901
  },
902
+ ];
903
+
904
+ // Load file-based skills from src/skills/
905
+ const { readFileSync } = require("fs");
906
+ const { join, dirname } = require("path");
907
+ const { fileURLToPath } = require("url");
908
+ const dir = dirname(fileURLToPath(import.meta.url));
909
+
910
+ const skillFiles = [
902
911
  {
912
+ file: "chant-eks.md",
903
913
  name: "chant-eks",
904
914
  description: "EKS end-to-end workflow — provision cluster, configure kubectl, deploy K8s workloads",
905
- content: `---
906
- skill: chant-eks
907
- description: End-to-end EKS workflow bridging AWS infrastructure and Kubernetes workloads
908
- user-invocable: true
909
- ---
910
-
911
- # EKS End-to-End Workflow
912
-
913
- ## Overview
914
-
915
- This skill bridges two lexicons:
916
- - **\`@intentius/chant-lexicon-aws\`** — EKS cluster, node groups, IAM roles, OIDC provider (CloudFormation)
917
- - **\`@intentius/chant-lexicon-k8s\`** — Kubernetes workloads, IRSA, ALB Ingress, storage, observability (K8s YAML)
918
-
919
- ## Architecture
920
-
921
- \`\`\`
922
- AWS Lexicon (CloudFormation) K8s Lexicon (kubectl apply)
923
- ┌────────────────────────┐ ┌────────────────────────────┐
924
- │ VPC + Subnets │ │ NamespaceEnv (quotas) │
925
- │ EKS Cluster │ │ AutoscaledService (app) │
926
- │ Managed Node Group │──ARNs──→ │ IrsaServiceAccount (IRSA) │
927
- │ OIDC Provider │ │ AlbIngress (ALB) │
928
- │ IAM Roles (IRSA) │ │ EbsStorageClass (gp3) │
929
- │ EKS Add-ons │ │ FluentBitAgent (logs) │
930
- └────────────────────────┘ │ ExternalDnsAgent (DNS) │
931
- └────────────────────────────┘
932
- \`\`\`
933
-
934
- ## Step 1: Provision AWS Infrastructure
935
-
936
- \`\`\`bash
937
- # Build CloudFormation template
938
- chant build src/infra/ --output infra.json
939
-
940
- # Deploy
941
- aws cloudformation deploy \\
942
- --template-file infra.json \\
943
- --stack-name my-eks-cluster \\
944
- --capabilities CAPABILITY_NAMED_IAM
945
- \`\`\`
946
-
947
- Key AWS resources:
948
- - **EKS Cluster** — control plane
949
- - **Managed Node Group** — EC2 worker nodes
950
- - **OIDC Provider** — enables IRSA (IAM Roles for Service Accounts)
951
- - **IAM Roles** — node role, app IRSA roles, ALB controller role
952
-
953
- ## Step 2: Configure kubectl
954
-
955
- \`\`\`bash
956
- aws eks update-kubeconfig --name my-cluster --region us-east-1
957
- kubectl get nodes # verify connectivity
958
- \`\`\`
959
-
960
- ## Step 3: Deploy K8s Workloads
961
-
962
- \`\`\`bash
963
- # Build K8s manifests
964
- chant build src/k8s/ --output manifests.yaml
965
-
966
- # Apply
967
- kubectl apply -f manifests.yaml
968
- \`\`\`
969
-
970
- ### Key K8s composites for EKS
971
-
972
- \`\`\`typescript
973
- import {
974
- NamespaceEnv,
975
- AutoscaledService,
976
- IrsaServiceAccount,
977
- AlbIngress,
978
- EbsStorageClass,
979
- FluentBitAgent,
980
- ExternalDnsAgent,
981
- } from "@intentius/chant-lexicon-k8s";
982
-
983
- // 1. Namespace with quotas and network isolation
984
- const ns = NamespaceEnv({
985
- name: "prod",
986
- cpuQuota: "16",
987
- memoryQuota: "32Gi",
988
- defaultCpuRequest: "100m",
989
- defaultMemoryRequest: "128Mi",
990
- defaultDenyIngress: true,
991
- });
992
-
993
- // 2. IRSA ServiceAccount (use IAM Role ARN from CloudFormation outputs)
994
- const irsa = IrsaServiceAccount({
995
- name: "app-sa",
996
- iamRoleArn: "arn:aws:iam::123456789012:role/app-role", // from CF output
997
- namespace: "prod",
998
- });
999
-
1000
- // 3. Application with autoscaling
1001
- const app = AutoscaledService({
1002
- name: "api",
1003
- image: "api:1.0",
1004
- port: 8080,
1005
- maxReplicas: 10,
1006
- cpuRequest: "200m",
1007
- memoryRequest: "256Mi",
1008
- namespace: "prod",
1009
- });
1010
-
1011
- // 4. ALB Ingress (use ACM cert ARN from CloudFormation outputs)
1012
- const ingress = AlbIngress({
1013
- name: "api-ingress",
1014
- hosts: [{ hostname: "api.example.com", paths: [{ path: "/", serviceName: "api", servicePort: 80 }] }],
1015
- certificateArn: "arn:aws:acm:us-east-1:123456789012:certificate/abc", // from CF output
1016
- namespace: "prod",
1017
- });
1018
-
1019
- // 5. Storage
1020
- const storage = EbsStorageClass({ name: "gp3-encrypted", type: "gp3", encrypted: true });
1021
-
1022
- // 6. Observability
1023
- const logging = FluentBitAgent({
1024
- logGroup: "/aws/eks/my-cluster/containers",
1025
- region: "us-east-1",
1026
- clusterName: "my-cluster",
1027
- });
1028
-
1029
- // 7. DNS
1030
- const dns = ExternalDnsAgent({
1031
- iamRoleArn: "arn:aws:iam::123456789012:role/external-dns-role",
1032
- domainFilters: ["example.com"],
1033
- });
1034
- \`\`\`
1035
-
1036
- ## Step 4: Verify
1037
-
1038
- \`\`\`bash
1039
- kubectl get pods -n prod
1040
- kubectl get ingress -n prod
1041
- kubectl logs -n amazon-cloudwatch -l app.kubernetes.io/name=fluent-bit
1042
- \`\`\`
1043
-
1044
- ## Cleanup
1045
-
1046
- \`\`\`bash
1047
- # Delete K8s workloads first
1048
- kubectl delete -f manifests.yaml
1049
-
1050
- # Then delete AWS infrastructure
1051
- aws cloudformation delete-stack --stack-name my-eks-cluster
1052
- aws cloudformation wait stack-delete-complete --stack-name my-eks-cluster
1053
- \`\`\`
1054
-
1055
- ## Cross-Lexicon Value Flow
1056
-
1057
- CloudFormation outputs flow into K8s composite props:
1058
-
1059
- | CloudFormation Output | K8s Composite Prop |
1060
- |----------------------|-------------------|
1061
- | App IAM Role ARN | \`IrsaServiceAccount.iamRoleArn\` |
1062
- | ALB Controller Role ARN | \`IrsaServiceAccount.iamRoleArn\` (for ALB controller SA) |
1063
- | ACM Certificate ARN | \`AlbIngress.certificateArn\` |
1064
- | ExternalDNS Role ARN | \`ExternalDnsAgent.iamRoleArn\` |
1065
- | EKS Cluster Name | \`FluentBitAgent.clusterName\`, \`AdotCollector.clusterName\` |
1066
- | EFS Filesystem ID | \`EfsStorageClass.fileSystemId\` |
1067
-
1068
- ## EKS Init Template
1069
-
1070
- Scaffold a dual-lexicon EKS project:
1071
-
1072
- \`\`\`bash
1073
- chant init --lexicon aws --template eks
1074
- \`\`\`
1075
-
1076
- This creates:
1077
- - \`src/infra/\` — EKS cluster, node group, IAM (AWS lexicon)
1078
- - \`src/k8s/\` — namespace, app, ingress, storage (K8s lexicon)
1079
- - \`package.json\` with both \`@intentius/chant-lexicon-aws\` and \`@intentius/chant-lexicon-k8s\`
1080
- `,
1081
915
  triggers: [
1082
916
  { type: "context", value: "eks" },
1083
917
  { type: "context", value: "kubernetes" },
1084
918
  { type: "context", value: "k8s-workloads" },
1085
919
  ],
1086
- preConditions: [
1087
- "AWS CLI is installed and configured",
1088
- "chant CLI is installed",
1089
- "kubectl is installed",
1090
- ],
1091
- postConditions: [
1092
- "EKS cluster is running",
1093
- "K8s workloads are deployed",
1094
- ],
1095
920
  parameters: [],
1096
921
  examples: [
1097
922
  {
1098
923
  title: "Full EKS deployment",
1099
- description: "Deploy infrastructure and workloads end-to-end",
1100
924
  input: "Set up a complete EKS environment with my API",
1101
- output: `# 1. Build and deploy infrastructure
1102
- chant build src/infra/ --output infra.json
1103
- aws cloudformation deploy --template-file infra.json --stack-name my-eks --capabilities CAPABILITY_NAMED_IAM
1104
-
1105
- # 2. Configure kubectl
1106
- aws eks update-kubeconfig --name my-cluster
1107
-
1108
- # 3. Build and deploy workloads
1109
- chant build src/k8s/ --output manifests.yaml
1110
- kubectl apply -f manifests.yaml`,
925
+ output: "chant build src/infra/ --output infra.json && aws cloudformation deploy --template-file infra.json --stack-name my-eks --capabilities CAPABILITY_NAMED_IAM",
1111
926
  },
1112
927
  ],
1113
928
  },
1114
929
  ];
930
+
931
+ for (const skill of skillFiles) {
932
+ try {
933
+ const content = readFileSync(join(dir, "skills", skill.file), "utf-8");
934
+ skills.push({
935
+ name: skill.name,
936
+ description: skill.description,
937
+ content,
938
+ triggers: skill.triggers,
939
+ parameters: skill.parameters,
940
+ examples: skill.examples,
941
+ });
942
+ } catch { /* skip missing skills */ }
943
+ }
944
+
945
+ return skills;
1115
946
  },
1116
947
 
1117
948
  completionProvider(ctx: CompletionContext): CompletionItem[] {
File without changes