@agnostic-prompt/aps 1.1.1

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.
Files changed (43) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +38 -0
  3. package/bin/aps.js +8 -0
  4. package/package.json +35 -0
  5. package/payload/agnostic-prompt-standard/SKILL.md +73 -0
  6. package/payload/agnostic-prompt-standard/assets/agents/vscode-agent-v1.0.0.agent.md +187 -0
  7. package/payload/agnostic-prompt-standard/assets/constants/constants-json-block-v1.0.0.example.md +15 -0
  8. package/payload/agnostic-prompt-standard/assets/constants/constants-text-block-v1.0.0.example.md +15 -0
  9. package/payload/agnostic-prompt-standard/assets/formats/format-code-changes-full-v1.0.0.example.md +21 -0
  10. package/payload/agnostic-prompt-standard/assets/formats/format-code-map-v1.0.0.example.md +18 -0
  11. package/payload/agnostic-prompt-standard/assets/formats/format-error-v1.0.0.example.md +9 -0
  12. package/payload/agnostic-prompt-standard/assets/formats/format-hierarchical-outline-v1.0.0.example.md +17 -0
  13. package/payload/agnostic-prompt-standard/assets/formats/format-ideation-list-v1.0.0.example.md +20 -0
  14. package/payload/agnostic-prompt-standard/assets/formats/format-markdown-table-v1.0.0.example.md +17 -0
  15. package/payload/agnostic-prompt-standard/assets/formats/format-table-api-coverage-v1.0.0.example.md +13 -0
  16. package/payload/agnostic-prompt-standard/platforms/README.md +39 -0
  17. package/payload/agnostic-prompt-standard/platforms/_schemas/platform-manifest.schema.json +84 -0
  18. package/payload/agnostic-prompt-standard/platforms/_schemas/tools-registry.schema.json +148 -0
  19. package/payload/agnostic-prompt-standard/platforms/_template/README.md +10 -0
  20. package/payload/agnostic-prompt-standard/platforms/_template/manifest.json +25 -0
  21. package/payload/agnostic-prompt-standard/platforms/_template/tools-registry.json +12 -0
  22. package/payload/agnostic-prompt-standard/platforms/vscode-copilot/README.md +100 -0
  23. package/payload/agnostic-prompt-standard/platforms/vscode-copilot/frontmatter/agent-frontmatter.md +24 -0
  24. package/payload/agnostic-prompt-standard/platforms/vscode-copilot/frontmatter/instructions-frontmatter.md +12 -0
  25. package/payload/agnostic-prompt-standard/platforms/vscode-copilot/frontmatter/prompt-frontmatter.md +18 -0
  26. package/payload/agnostic-prompt-standard/platforms/vscode-copilot/frontmatter/skill-frontmatter.md +10 -0
  27. package/payload/agnostic-prompt-standard/platforms/vscode-copilot/manifest.json +40 -0
  28. package/payload/agnostic-prompt-standard/platforms/vscode-copilot/templates/.github/agents/aps-prompt-protocol.agent.md +187 -0
  29. package/payload/agnostic-prompt-standard/platforms/vscode-copilot/templates/AGENTS.md +7 -0
  30. package/payload/agnostic-prompt-standard/platforms/vscode-copilot/tools-registry.json +509 -0
  31. package/payload/agnostic-prompt-standard/references/00-structure.md +123 -0
  32. package/payload/agnostic-prompt-standard/references/01-vocabulary.md +124 -0
  33. package/payload/agnostic-prompt-standard/references/02-linting-and-formatting.md +122 -0
  34. package/payload/agnostic-prompt-standard/references/03-agentic-control.md +192 -0
  35. package/payload/agnostic-prompt-standard/references/04-schemas-and-types.md +137 -0
  36. package/payload/agnostic-prompt-standard/references/05-grammar.md +99 -0
  37. package/payload/agnostic-prompt-standard/references/06-logging-and-privacy.md +32 -0
  38. package/payload/agnostic-prompt-standard/references/07-error-taxonomy.md +62 -0
  39. package/payload/agnostic-prompt-standard/scripts/.gitkeep +0 -0
  40. package/scripts/lint.js +27 -0
  41. package/scripts/prepack.js +23 -0
  42. package/src/cli.js +292 -0
  43. package/src/core.js +179 -0
package/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # APS CLI (Node)
2
+
3
+ This package provides the `aps` CLI for installing the **Agnostic Prompt Standard (APS)** skill into:
4
+
5
+ - a repository workspace: `.github/skills/agnostic-prompt-standard/`
6
+ - or as a personal skill: `~/.copilot/skills/agnostic-prompt-standard/`
7
+
8
+ ## Install / run
9
+
10
+ One-off (no global install):
11
+
12
+ ```bash
13
+ npx @agnostic-prompt/aps init
14
+ ```
15
+
16
+ Global install:
17
+
18
+ ```bash
19
+ npm install -g @agnostic-prompt/aps
20
+ aps init
21
+ ```
22
+
23
+ ## Commands
24
+
25
+ ```bash
26
+ aps init [--repo|--personal] [--platform <id>] [--templates] [--yes] [--force]
27
+ aps doctor [--json]
28
+ aps platforms
29
+ aps version
30
+ ```
31
+
32
+ ## Claude platform path
33
+
34
+ If you need the Claude platform `.claude/skills` location, pass `--claude`:
35
+
36
+ ```bash
37
+ aps init --claude
38
+ ```
package/bin/aps.js ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { main } from '../src/cli.js';
3
+
4
+ main(process.argv).catch((err) => {
5
+ const msg = err?.message ?? String(err);
6
+ console.error(`Error: ${msg}`);
7
+ process.exit(1);
8
+ });
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@agnostic-prompt/aps",
3
+ "version": "1.1.1",
4
+ "description": "CLI to install and manage the Agnostic Prompt Standard (APS) skill and platform templates.",
5
+ "type": "module",
6
+ "bin": {
7
+ "aps": "./bin/aps.js"
8
+ },
9
+ "engines": {
10
+ "node": ">=18"
11
+ },
12
+ "scripts": {
13
+ "test": "node --test ./test/*.test.js",
14
+ "lint": "node ./scripts/lint.js",
15
+ "prepack": "node ./scripts/prepack.js",
16
+ "prepare": "node ./scripts/prepack.js"
17
+ },
18
+ "dependencies": {
19
+ "@inquirer/prompts": "^7.0.0",
20
+ "commander": "^12.0.0"
21
+ },
22
+ "files": [
23
+ "bin/",
24
+ "src/",
25
+ "scripts/",
26
+ "payload/",
27
+ "README.md",
28
+ "LICENSE"
29
+ ],
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://github.com/chris-buckley/agnostic-prompt-standard.git"
33
+ },
34
+ "license": "Apache-2.0"
35
+ }
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: agnostic-prompt-standard
3
+ description: The reference framework to generate, compile, and lint greenfield prompts that conform to the Agnostic Prompt Standard (APS) v1.0.
4
+ license: Apache-2.0
5
+ metadata:
6
+ authors: "Christopher Buckley; Juan Burckhardt; Anastasiya Smirnova"
7
+ spec_version: "1.0"
8
+ framework_revision: "1.1.1"
9
+ last_updated: "2026-01-15"
10
+ ---
11
+
12
+ # Agnostic Prompt Standard (APS) v1.0 — Skill Entry
13
+
14
+ This `SKILL.md` is the **entrypoint** for the Agnostic Prompt Standard (APS) v1.0.
15
+
16
+ - The APS **normative spec** is in `references/` (those documents define the standard).
17
+ - Everything else in this repository is **supporting material** (examples, templates, platform adapters).
18
+
19
+ ## Normative spec (APS v1.0)
20
+
21
+ 1. [00 Structure](references/00-structure.md)
22
+ 2. [01 Vocabulary](references/01-vocabulary.md)
23
+ 3. [02 Linting and formatting](references/02-linting-and-formatting.md)
24
+ 4. [03 Agentic control](references/03-agentic-control.md)
25
+ 5. [04 Schemas and types](references/04-schemas-and-types.md)
26
+ 6. [05 Grammar](references/05-grammar.md)
27
+ 7. [06 Logging and privacy](references/06-logging-and-privacy.md)
28
+ 8. [07 Error taxonomy](references/07-error-taxonomy.md)
29
+
30
+ ## Skill layout
31
+
32
+ - `SKILL.md` — this file (skill entrypoint).
33
+ - `references/` — the APS v1.0 normative documents (this is what an LSP/linter should ingest).
34
+ - `assets/` — reusable examples for `<format>` and `<constants>` blocks.
35
+ - `constants/` — example constants blocks.
36
+ - `constants-json-block-v1.0.0.example.md`
37
+ - `constants-text-block-v1.0.0.example.md`
38
+ - `formats/` — example format blocks.
39
+ - `format-code-changes-full-v1.0.0.example.md`
40
+ - `format-code-map-v1.0.0.example.md`
41
+ - `format-error-v1.0.0.example.md`
42
+ - `format-hierarchical-outline-v1.0.0.example.md`
43
+ - `format-ideation-list-v1.0.0.example.md`
44
+ - `format-markdown-table-v1.0.0.example.md`
45
+ - `format-table-api-coverage-v1.0.0.example.md`
46
+ - `platforms/` — **non-normative** platform adapters (file conventions, frontmatter, tool registries, templates).
47
+ - `README.md` — platforms overview and contract.
48
+ - `_schemas/` — JSON Schemas for adapter validation.
49
+ - `platform-manifest.schema.json`
50
+ - `tools-registry.schema.json`
51
+ - `_template/` — skeleton for new platform adapters.
52
+ - `README.md`, `manifest.json`, `tools-registry.json`
53
+ - `vscode-copilot/` — VS Code + GitHub Copilot adapter.
54
+ - `README.md` — adapter quickstart and nuances.
55
+ - `manifest.json` — file discovery rules.
56
+ - `tools-registry.json` — tool names, sets, and renames.
57
+ - `frontmatter/` — copy/paste YAML frontmatter templates.
58
+ - `templates/` — drop-in workspace artifacts (`AGENTS.md`, `.github/agents/`).
59
+ - `scripts/` — optional build / compile / lint scripts (empty by default).
60
+
61
+ ---
62
+
63
+ ## Platform adapters
64
+
65
+ Platform-specific details (file discovery, frontmatter dialects, tool naming) are documented in `platforms/`.
66
+
67
+ → See [platforms/README.md](platforms/README.md) for overview and how to add new adapters.
68
+
69
+ ### VS Code + GitHub Copilot
70
+
71
+ The initial adapter for VS Code + GitHub Copilot is at `platforms/vscode-copilot/`.
72
+
73
+ → See [platforms/vscode-copilot/README.md](platforms/vscode-copilot/README.md) for quickstart, file discovery, frontmatter templates, and tool naming.
@@ -0,0 +1,187 @@
1
+ ---
2
+ name: APS v1.0 Agent
3
+ description: "Generate APS v1.0 .prompt.md files: load APS+VS Code adapter, extract intent, then generate+lint (and write if allowed)."
4
+ tools: ['search', 'read', 'edit', 'execute', 'todo', 'web/fetch', 'read/problems', 'search/changes', 'search/usages']
5
+ model: Claude Opus 4.5 (copilot)
6
+ argument-hint: Goal in 1-2 sentences.
7
+ target: vscode
8
+ infer: true
9
+ ---
10
+
11
+ <instructions>
12
+ You MUST follow APS v1.0 section order and the tag newline rule.
13
+ You MUST keep one directive per line inside <instructions>.
14
+ You MUST load SKILL_PATH and ADAPTER_TOOLS_PATH once per session before probing.
15
+ You MUST infer VS Code Copilot defaults (paths + tool names) from the adapter; avoid obvious questions.
16
+ You MUST structure <intent> facts in this order: platform, tools, task, inputs, outputs, constraints, success, assumptions.
17
+ You MUST default VS Code prompt frontmatter + tool names from the adapter; only ask if user overrides.
18
+ You MUST interleave intent refinement and tool/permission constraints; ask <=2 blocker questions per turn.
19
+ You MUST mark assumptions inside the <intent> artifact.
20
+ You MUST emit exactly one user-visible fenced block whose info string is format:<ID> per turn.
21
+ You MUST derive PROMPT_SLUG deterministically from the final intent using SLUG_RULES.
22
+ You MUST always return the generated prompt text and a lint report; write files only when WRITE_OK is true.
23
+ You MUST redact secrets and personal data in any logs or artifacts.
24
+ </instructions>
25
+
26
+ <constants>
27
+ PROMPTS_DIR: ".github/prompts/"
28
+ PROMPT_EXT: ".prompt.md"
29
+ SKILL_PATH: ".github/skills/agnostic-prompt-standard/SKILL.md"
30
+ ADAPTER_TOOLS_PATH: ".github/skills/agnostic-prompt-standard/platforms/vscode-copilot/tools-registry.json"
31
+ CTA: "Reply with letter choices (e.g., '1a, 2c') or 'ok' to accept defaults."
32
+
33
+ SLUG_RULES: TEXT<<
34
+ - lowercase ascii
35
+ - space/_ -> -
36
+ - keep [a-z0-9-]
37
+ - collapse/trim -
38
+ >>
39
+
40
+ ASK_RULES: TEXT<<
41
+ - ask only what blocks prompt generation
42
+ - 0-2 questions per turn
43
+ - each question MUST have 4 suggested answers (a-d) plus option (e) for "all of the above" or "none/other"
44
+ - format each question as:
45
+ Q1: <question text>
46
+ a) <option 1>
47
+ b) <option 2>
48
+ c) <option 3>
49
+ d) <option 4>
50
+ e) All of the above / None / Other (specify)
51
+ - include tool/permission limits if relevant
52
+ - accept defaults on reply: ok, or reply with letter(s) like "1a, 2c"
53
+ >>
54
+
55
+ LINT_CHECKS: TEXT<<
56
+ - section order: instructions, constants, formats, runtime, triggers, processes, input
57
+ - tag newline rule
58
+ - no tabs
59
+ - no // inside triggers/processes
60
+ - ids in RUN/USE are backticked
61
+ - where: keys are lexicographic
62
+ - every format:<ID> referenced exists
63
+ - output is exactly one fenced block per turn
64
+ >>
65
+
66
+ PROMPT_SKELETON: TEXT<<
67
+ <instructions>\n...\n</instructions>\n<constants>\n...\n</constants>\n<formats>\n...\n</formats>\n<runtime>\n...\n</runtime>\n<triggers>\n...\n</triggers>\n<processes>\n...\n</processes>\n<input>\n...\n</input>
68
+ >>
69
+ </constants>
70
+
71
+ <formats>
72
+ <format id="ERROR" name="Format Error" purpose="Emit a single-line reason when a requested format cannot be produced.">
73
+ - Output wrapper starts with a fenced block whose info string is exactly format:ERROR.
74
+ - Body is AG-036 FormatContractViolation: <ONE_LINE_REASON>.
75
+ WHERE:
76
+ - <ONE_LINE_REASON> is String.
77
+ - <ONE_LINE_REASON> is <=160 characters.
78
+ - <ONE_LINE_REASON> contains no newlines.
79
+ </format>
80
+
81
+ <format id="ASK_V1" name="Intent + Minimal Probe" purpose="Show the current intent and ask up to 2 blocker questions with suggested answers.">
82
+ STATE: <STATE>
83
+
84
+ <intent>
85
+ <INTENT>
86
+ </intent>
87
+
88
+ ASK
89
+ <QUESTIONS>
90
+
91
+ CTA: <CTA>
92
+ WHERE:
93
+ - <STATE> is String.
94
+ - <INTENT> is String.
95
+ - <QUESTIONS> is MultilineQuestions where each question has format:
96
+ Q<N>: <question_text>
97
+ a) <option_1>
98
+ b) <option_2>
99
+ c) <option_3>
100
+ d) <option_4>
101
+ e) All of the above / None / Other (specify)
102
+ - <CTA> is String.
103
+ </format>
104
+
105
+ <format id="OUT_V1" name="Generated Prompt + Lint" purpose="Return the prompt text, lint report, and (optional) write location.">
106
+ # <PROMPT_NAME>
107
+ File: <FILE_PATH>
108
+ Written: <WRITTEN>
109
+
110
+ <PROMPT>
111
+
112
+ ## Lint
113
+ <LINT>
114
+ WHERE:
115
+ - <FILE_PATH> is Path.
116
+ - <LINT> is String.
117
+ - <PROMPT> is String.
118
+ - <PROMPT_NAME> is String.
119
+ - <WRITTEN> is Boolean.
120
+ </format>
121
+ </formats>
122
+
123
+ <runtime>
124
+ USER_INPUT: ""
125
+ SESSION_INIT: false
126
+ SKILL_CONTENT: ""
127
+ ADAPTER_TOOLS: ""
128
+ STATE: ""
129
+ INTENT: ""
130
+ QUESTIONS: ""
131
+ INTENT_OK: false
132
+ WRITE_OK: false
133
+ PROMPT_SLUG: ""
134
+ FILE_PATH: ""
135
+ PROMPT: ""
136
+ LINT: ""
137
+ WRITTEN: false
138
+ </runtime>
139
+
140
+ <triggers>
141
+ <trigger event="user_message" target="router" />
142
+ </triggers>
143
+
144
+ <processes>
145
+ <process id="router" name="Route">
146
+ IF SESSION_INIT is false:
147
+ RUN `init`
148
+ RUN `refine`
149
+ IF INTENT_OK is false:
150
+ RETURN: format="ASK_V1", cta=CTA, intent=INTENT, questions=QUESTIONS, state=STATE
151
+ RUN `generate`
152
+ RETURN: format="OUT_V1", file_path=FILE_PATH, lint=LINT, prompt=PROMPT, prompt_name=PROMPT_SLUG, written=WRITTEN
153
+ </process>
154
+
155
+ <process id="init" name="Init+Load Context">
156
+ SET SESSION_INIT := true (from "Agent Inference")
157
+ USE `read/readFile` where: filePath=SKILL_PATH
158
+ CAPTURE SKILL_CONTENT from `read/readFile`
159
+ USE `read/readFile` where: filePath=ADAPTER_TOOLS_PATH
160
+ CAPTURE ADAPTER_TOOLS from `read/readFile`
161
+ </process>
162
+
163
+ <process id="refine" name="Intent">
164
+ SET STATE := <STATE_TEXT> (from "Agent Inference" using USER_INPUT)
165
+ SET INTENT := <INTENT_FACTS> (from "Agent Inference" using USER_INPUT, SKILL_CONTENT, ADAPTER_TOOLS)
166
+ SET QUESTIONS := <BLOCKERS> (from "Agent Inference" using INTENT, ASK_RULES)
167
+ SET INTENT_OK := <DONE> (from "Agent Inference")
168
+ SET WRITE_OK := <OK_TO_WRITE> (from "Agent Inference")
169
+ </process>
170
+
171
+ <process id="generate" name="Generate+Lint+MaybeWrite">
172
+ SET PROMPT_SLUG := <SLUG> (from "Agent Inference" using INTENT, SLUG_RULES)
173
+ SET FILE_PATH := <PROMPT_FILE_PATH> (from "Agent Inference" using PROMPT_SLUG, PROMPTS_DIR, PROMPT_EXT)
174
+ SET PROMPT := <PROMPT_TEXT> (from "Agent Inference" using INTENT, SKILL_CONTENT, ADAPTER_TOOLS, PROMPT_SKELETON)
175
+ SET LINT := <LINT_TEXT> (from "Agent Inference" using PROMPT, LINT_CHECKS)
176
+ IF WRITE_OK is true:
177
+ USE `edit/createDirectory` where: dirPath=PROMPTS_DIR
178
+ USE `edit/createFile` where: content=PROMPT, filePath=FILE_PATH
179
+ SET WRITTEN := true (from "Agent Inference")
180
+ ELSE:
181
+ SET WRITTEN := false (from "Agent Inference")
182
+ </process>
183
+ </processes>
184
+
185
+ <input>
186
+ USER_INPUT is the user's latest message containing goals or answers.
187
+ </input>
@@ -0,0 +1,15 @@
1
+ <constants>
2
+ // Example: multi-line JSON constant using JSON<< ... >>.
3
+ // Engines parse BODY as JsonValue then compile it to canonical JSON (see json_spacing).
4
+
5
+ DEFAULT_TZ: "Z"
6
+
7
+ API_CONFIG: JSON<<
8
+ {
9
+ "apiBasePath": "/v1",
10
+ "defaultTimeZone": DEFAULT_TZ,
11
+ "retries": 3,
12
+ "timeoutMs": 2000
13
+ }
14
+ >>
15
+ </constants>
@@ -0,0 +1,15 @@
1
+ <constants>
2
+ // Example: multi-line TEXT constant using TEXT<< ... >>.
3
+ // NOTE: Comment stripping (//) does NOT apply inside TEXT<< bodies.
4
+
5
+ REPO_TREE: TEXT<<
6
+ cb-agnostic-prompt-protocol
7
+ ├── assets
8
+ │ ├── constants
9
+ │ │ └── constants-json-block-v1.0.0.example.md
10
+ │ └── formats
11
+ │ ├── format-code-map-v1.0.0.example.md
12
+ │ └── format-error-v1.0.0.example.md
13
+ └── SKILL.md
14
+ >>
15
+ </constants>
@@ -0,0 +1,21 @@
1
+ <format id="CODE_CHANGES_V1" name="Code Changes" purpose="Display updated and new files with complete code.">
2
+ ## <CHANGE_TITLE>
3
+
4
+ <CHANGE_DESCRIPTION>
5
+ File: <FILE_PATH>
6
+ ```<LANG>
7
+ <COMPLETE_CODE>
8
+ ```
9
+
10
+ ---
11
+
12
+
13
+
14
+ WHERE:
15
+ - <CHANGE_TITLE> is String; title for the set of changes.
16
+ - <CHANGE_DESCRIPTION> is String; terse description of the change; present voice; NO changelog style.
17
+ - <FILE_PATH> is Path; relative from repository root; MUST NOT start with "/".
18
+ - <LANG> is String; valid code language for GitHub-flavored Markdown.
19
+ - <COMPLETE_CODE> is String; complete file contents; best practices; comments MUST be terse and present voice.
20
+ - … denotes repetition; one block per updated or new file; each separated by "---"; AVOID unchanged files.
21
+ </format>
@@ -0,0 +1,18 @@
1
+ <format id="CODE_MAP_V1" name="Code Map" purpose="Display relevant code snippets with links to source">
2
+ <AREA_TITLE>
3
+ > [<SHORT_DESC>](../../../<REPO_NAME>/<REL_PATH>#L<LINE_FROM>-L<LINE_TO>)
4
+ ```<LANG>
5
+ <LINE_FROM>: <code line>
6
+ <LINE_FROM+1>: <code line>
7
+
8
+ <LINE_TO>: <code line>
9
+ ```
10
+
11
+ WHERE:
12
+ - <AREA_TITLE> is the title of the area being described.
13
+ - <REPO_NAME> is a single path segment.
14
+ - <REL_PATH> is repo-relative and MUST NOT start with "/".
15
+ - <LINE_FROM> and <LINE_TO> are integers; LINE_TO ≥ LINE_FROM.
16
+ - <SHORT_DESC> is a short description of the code snippet.
17
+ - <LANG> is a valid code language for GitHub-flavored Markdown.
18
+ </format>
@@ -0,0 +1,9 @@
1
+ <format id="ERROR" name="Format Error" purpose="Emit a single-line reason when a requested format cannot be produced.">
2
+ - Output wrapper starts with a fenced block whose info string is exactly `format:ERROR`.
3
+ - Body is `AG-036 FormatContractViolation: <ONE_LINE_REASON>`.
4
+ - Body MUST be a single line.
5
+ WHERE:
6
+ - <ONE_LINE_REASON> is String.
7
+ - <ONE_LINE_REASON> is ≤ 160 characters.
8
+ - <ONE_LINE_REASON> contains no newlines.
9
+ </format>
@@ -0,0 +1,17 @@
1
+ <format id="OUTLINE_V1" name="Hierarchical Outline" purpose="Generate a semantic multilevel numbered outline.">
2
+ ## <OUTLINE_TITLE>
3
+
4
+ <LEVEL_1_NUMBER> <STATEMENT>
5
+ <LEVEL_2_NUMBER> <STATEMENT>
6
+ <LEVEL_3_NUMBER> <STATEMENT>
7
+
8
+
9
+
10
+ WHERE:
11
+ - <OUTLINE_TITLE> is String; title for the outline.
12
+ - <LEVEL_1_NUMBER> is String; format "N" (e.g., "1", "2", "3").
13
+ - <LEVEL_2_NUMBER> is String; format "N.N" (e.g., "1.1", "1.2").
14
+ - <LEVEL_3_NUMBER> is String; format "N.N.N" (e.g., "1.1.1", "1.1.2"); maximum depth.
15
+ - <STATEMENT> is String; single atomic statement; topic, instruction, or information; NO obvious statements.
16
+ - … denotes repetition; one space indentation per level; up to 3 levels deep.
17
+ </format>
@@ -0,0 +1,20 @@
1
+ <format id="IDEATION_LIST_V1" name="Ideation List" purpose="Generate structured brainstorming ideas for a given task.">
2
+ ## <TASK_TITLE>
3
+
4
+ [<ITEM_NUMBER>] <IDEA_TITLE>
5
+ Summary: <IDEA_SUMMARY>
6
+ Details: <IDEA_DETAILS>
7
+
8
+ ---
9
+
10
+
11
+
12
+ WHERE:
13
+ - <TASK_TITLE> is String; the task or topic for ideation.
14
+ - <ITEM_COUNT> is Integer; total number of ideation items to generate.
15
+ - <ITEM_NUMBER> is Integer; sequential from 1 to <ITEM_COUNT>.
16
+ - <IDEA_TITLE> is String; short descriptive title; present tense; active voice.
17
+ - <IDEA_SUMMARY> is String; one sentence; present tense; active voice.
18
+ - <IDEA_DETAILS> is String; 2–4 sentences; conceptual only; NO implementation, code, or pseudo-code.
19
+ - … denotes repetition; exactly <ITEM_COUNT> items; each separated by "---".
20
+ </format>