agnostic-prompt-aps 1.1.1__py3-none-any.whl
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.
- agnostic_prompt_aps-1.1.1.dist-info/METADATA +57 -0
- agnostic_prompt_aps-1.1.1.dist-info/RECORD +42 -0
- agnostic_prompt_aps-1.1.1.dist-info/WHEEL +5 -0
- agnostic_prompt_aps-1.1.1.dist-info/entry_points.txt +2 -0
- agnostic_prompt_aps-1.1.1.dist-info/licenses/LICENSE +190 -0
- agnostic_prompt_aps-1.1.1.dist-info/top_level.txt +1 -0
- aps_cli/__init__.py +3 -0
- aps_cli/cli.py +250 -0
- aps_cli/core.py +157 -0
- aps_cli/payload/agnostic-prompt-standard/SKILL.md +73 -0
- aps_cli/payload/agnostic-prompt-standard/assets/agents/vscode-agent-v1.0.0.agent.md +187 -0
- aps_cli/payload/agnostic-prompt-standard/assets/constants/constants-json-block-v1.0.0.example.md +15 -0
- aps_cli/payload/agnostic-prompt-standard/assets/constants/constants-text-block-v1.0.0.example.md +15 -0
- aps_cli/payload/agnostic-prompt-standard/assets/formats/format-code-changes-full-v1.0.0.example.md +21 -0
- aps_cli/payload/agnostic-prompt-standard/assets/formats/format-code-map-v1.0.0.example.md +18 -0
- aps_cli/payload/agnostic-prompt-standard/assets/formats/format-error-v1.0.0.example.md +9 -0
- aps_cli/payload/agnostic-prompt-standard/assets/formats/format-hierarchical-outline-v1.0.0.example.md +17 -0
- aps_cli/payload/agnostic-prompt-standard/assets/formats/format-ideation-list-v1.0.0.example.md +20 -0
- aps_cli/payload/agnostic-prompt-standard/assets/formats/format-markdown-table-v1.0.0.example.md +17 -0
- aps_cli/payload/agnostic-prompt-standard/assets/formats/format-table-api-coverage-v1.0.0.example.md +13 -0
- aps_cli/payload/agnostic-prompt-standard/platforms/README.md +39 -0
- aps_cli/payload/agnostic-prompt-standard/platforms/_schemas/platform-manifest.schema.json +84 -0
- aps_cli/payload/agnostic-prompt-standard/platforms/_schemas/tools-registry.schema.json +148 -0
- aps_cli/payload/agnostic-prompt-standard/platforms/_template/README.md +10 -0
- aps_cli/payload/agnostic-prompt-standard/platforms/_template/manifest.json +25 -0
- aps_cli/payload/agnostic-prompt-standard/platforms/_template/tools-registry.json +12 -0
- aps_cli/payload/agnostic-prompt-standard/platforms/vscode-copilot/README.md +100 -0
- aps_cli/payload/agnostic-prompt-standard/platforms/vscode-copilot/frontmatter/agent-frontmatter.md +24 -0
- aps_cli/payload/agnostic-prompt-standard/platforms/vscode-copilot/frontmatter/instructions-frontmatter.md +12 -0
- aps_cli/payload/agnostic-prompt-standard/platforms/vscode-copilot/frontmatter/prompt-frontmatter.md +18 -0
- aps_cli/payload/agnostic-prompt-standard/platforms/vscode-copilot/frontmatter/skill-frontmatter.md +10 -0
- aps_cli/payload/agnostic-prompt-standard/platforms/vscode-copilot/manifest.json +40 -0
- aps_cli/payload/agnostic-prompt-standard/platforms/vscode-copilot/templates/AGENTS.md +7 -0
- aps_cli/payload/agnostic-prompt-standard/platforms/vscode-copilot/tools-registry.json +509 -0
- aps_cli/payload/agnostic-prompt-standard/references/00-structure.md +123 -0
- aps_cli/payload/agnostic-prompt-standard/references/01-vocabulary.md +124 -0
- aps_cli/payload/agnostic-prompt-standard/references/02-linting-and-formatting.md +122 -0
- aps_cli/payload/agnostic-prompt-standard/references/03-agentic-control.md +192 -0
- aps_cli/payload/agnostic-prompt-standard/references/04-schemas-and-types.md +137 -0
- aps_cli/payload/agnostic-prompt-standard/references/05-grammar.md +99 -0
- aps_cli/payload/agnostic-prompt-standard/references/06-logging-and-privacy.md +32 -0
- aps_cli/payload/agnostic-prompt-standard/references/07-error-taxonomy.md +62 -0
aps_cli/core.py
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
import os
|
|
5
|
+
import shutil
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Iterable, Optional
|
|
9
|
+
|
|
10
|
+
SKILL_ID = "agnostic-prompt-standard"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass(frozen=True)
|
|
14
|
+
class Platform:
|
|
15
|
+
platform_id: str
|
|
16
|
+
display_name: str
|
|
17
|
+
adapter_version: Optional[str]
|
|
18
|
+
has_templates: bool
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def is_tty() -> bool:
|
|
22
|
+
try:
|
|
23
|
+
return bool(os.isatty(0) and os.isatty(1))
|
|
24
|
+
except Exception:
|
|
25
|
+
return False
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def find_repo_root(start_dir: Path) -> Optional[Path]:
|
|
29
|
+
cur = start_dir.resolve()
|
|
30
|
+
while True:
|
|
31
|
+
if (cur / ".git").exists():
|
|
32
|
+
return cur
|
|
33
|
+
parent = cur.parent
|
|
34
|
+
if parent == cur:
|
|
35
|
+
return None
|
|
36
|
+
cur = parent
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def default_project_skill_path(repo_root: Path, *, claude: bool = False) -> Path:
|
|
40
|
+
"""Return the project-skill path for the detected agent ecosystem.
|
|
41
|
+
|
|
42
|
+
- Default: `.github/skills/<skill-id>/` (Copilot Agent Skills)
|
|
43
|
+
- Claude: `.claude/skills/<skill-id>/` (Claude platform)
|
|
44
|
+
"""
|
|
45
|
+
base = repo_root / (".claude" if claude else ".github") / "skills"
|
|
46
|
+
return base / SKILL_ID
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def default_personal_skill_path(*, claude: bool = False) -> Path:
|
|
50
|
+
"""Return the per-user skill path.
|
|
51
|
+
|
|
52
|
+
- Default: `~/.copilot/skills/<skill-id>/`
|
|
53
|
+
- Claude: `~/.claude/skills/<skill-id>/`
|
|
54
|
+
"""
|
|
55
|
+
base = Path.home() / (".claude" if claude else ".copilot") / "skills"
|
|
56
|
+
return base / SKILL_ID
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def infer_platform_id(workspace_root: Path) -> Optional[str]:
|
|
60
|
+
gh = workspace_root / ".github"
|
|
61
|
+
has_agents = (gh / "agents").exists()
|
|
62
|
+
has_prompts = (gh / "prompts").exists()
|
|
63
|
+
has_instructions = (gh / "copilot-instructions.md").exists() or (gh / "instructions").exists()
|
|
64
|
+
if has_agents or has_prompts or has_instructions:
|
|
65
|
+
return "vscode-copilot"
|
|
66
|
+
return None
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def resolve_payload_skill_dir() -> Path:
|
|
70
|
+
"""Locate the bundled APS skill directory.
|
|
71
|
+
|
|
72
|
+
Priority:
|
|
73
|
+
1) Installed package payload: aps_cli/payload/agnostic-prompt-standard
|
|
74
|
+
2) Repo checkout: ../../../../skill/agnostic-prompt-standard (relative to this file)
|
|
75
|
+
"""
|
|
76
|
+
here = Path(__file__).resolve().parent
|
|
77
|
+
packaged = here / "payload" / SKILL_ID
|
|
78
|
+
if packaged.is_dir():
|
|
79
|
+
return packaged
|
|
80
|
+
|
|
81
|
+
# repo fallback
|
|
82
|
+
repo_root = Path(__file__).resolve().parents[4]
|
|
83
|
+
dev = repo_root / "skill" / SKILL_ID
|
|
84
|
+
if dev.is_dir():
|
|
85
|
+
return dev
|
|
86
|
+
|
|
87
|
+
raise FileNotFoundError("APS payload not found. (Did you run tools/sync_payload.py before building?)")
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def load_platforms(skill_dir: Path) -> list[Platform]:
|
|
91
|
+
platforms_dir = skill_dir / "platforms"
|
|
92
|
+
out: list[Platform] = []
|
|
93
|
+
for entry in platforms_dir.iterdir():
|
|
94
|
+
if not entry.is_dir():
|
|
95
|
+
continue
|
|
96
|
+
if entry.name.startswith("_"):
|
|
97
|
+
continue
|
|
98
|
+
manifest_path = entry / "manifest.json"
|
|
99
|
+
if not manifest_path.exists():
|
|
100
|
+
continue
|
|
101
|
+
try:
|
|
102
|
+
manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
|
|
103
|
+
except Exception:
|
|
104
|
+
continue
|
|
105
|
+
platform_id = manifest.get("platformId", entry.name)
|
|
106
|
+
display_name = manifest.get("displayName", entry.name)
|
|
107
|
+
adapter_version = manifest.get("adapterVersion")
|
|
108
|
+
has_templates = (entry / "templates").is_dir()
|
|
109
|
+
out.append(
|
|
110
|
+
Platform(
|
|
111
|
+
platform_id=platform_id,
|
|
112
|
+
display_name=display_name,
|
|
113
|
+
adapter_version=adapter_version,
|
|
114
|
+
has_templates=has_templates,
|
|
115
|
+
)
|
|
116
|
+
)
|
|
117
|
+
out.sort(key=lambda p: p.display_name.lower())
|
|
118
|
+
return out
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def ensure_dir(p: Path) -> None:
|
|
122
|
+
p.mkdir(parents=True, exist_ok=True)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def remove_dir(p: Path) -> None:
|
|
126
|
+
shutil.rmtree(p, ignore_errors=True)
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def copy_dir(src: Path, dst: Path) -> None:
|
|
130
|
+
shutil.copytree(src, dst)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def copy_templates(templates_dir: Path, workspace_root: Path, force: bool) -> dict[str, list[str]]:
|
|
134
|
+
"""Merge-copy templates_dir into workspace_root.
|
|
135
|
+
|
|
136
|
+
Returns {"copied": [...], "skipped": [...]}
|
|
137
|
+
"""
|
|
138
|
+
copied: list[str] = []
|
|
139
|
+
skipped: list[str] = []
|
|
140
|
+
|
|
141
|
+
for root, dirs, files in os.walk(templates_dir):
|
|
142
|
+
root_path = Path(root)
|
|
143
|
+
rel_root = root_path.relative_to(templates_dir)
|
|
144
|
+
for d in dirs:
|
|
145
|
+
ensure_dir(workspace_root / rel_root / d)
|
|
146
|
+
for f in files:
|
|
147
|
+
src = root_path / f
|
|
148
|
+
rel = (rel_root / f)
|
|
149
|
+
dst = workspace_root / rel
|
|
150
|
+
ensure_dir(dst.parent)
|
|
151
|
+
if dst.exists() and not force:
|
|
152
|
+
skipped.append(str(rel))
|
|
153
|
+
continue
|
|
154
|
+
shutil.copy2(src, dst)
|
|
155
|
+
copied.append(str(rel))
|
|
156
|
+
|
|
157
|
+
return {"copied": copied, "skipped": skipped}
|
|
@@ -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>
|
aps_cli/payload/agnostic-prompt-standard/assets/constants/constants-json-block-v1.0.0.example.md
ADDED
|
@@ -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>
|
aps_cli/payload/agnostic-prompt-standard/assets/constants/constants-text-block-v1.0.0.example.md
ADDED
|
@@ -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>
|
aps_cli/payload/agnostic-prompt-standard/assets/formats/format-code-changes-full-v1.0.0.example.md
ADDED
|
@@ -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>
|
aps_cli/payload/agnostic-prompt-standard/assets/formats/format-ideation-list-v1.0.0.example.md
ADDED
|
@@ -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>
|
aps_cli/payload/agnostic-prompt-standard/assets/formats/format-markdown-table-v1.0.0.example.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<format id="TABLE_PROCESS_RESULTS_V1" name="Process Results Table" purpose="Summarize process execution across processes in lexical order.">
|
|
2
|
+
- Output wrapper starts with a fenced block whose info string is exactly `format:TABLE_PROCESS_RESULTS_V1`.
|
|
3
|
+
- Header row MUST be:
|
|
4
|
+
| ProcessId | Name | Status | StartedAt | EndedAt | DurationMs | Outcome | Artifacts | Errors |
|
|
5
|
+
- Example row:
|
|
6
|
+
| <PROCESS_ID> | <PROCESS_NAME> | <STATUS> | <STARTED_AT> | <ENDED_AT> | <DURATION_MS> | <OUTCOME> | <ARTIFACTS> | <ERRORS> |
|
|
7
|
+
WHERE:
|
|
8
|
+
- <PROCESS_ID> is String.
|
|
9
|
+
- <PROCESS_NAME> is String.
|
|
10
|
+
- <STATUS> is one of: PENDING, RUNNING, OK, WARN, ERROR.
|
|
11
|
+
- <STARTED_AT> is ISO8601.
|
|
12
|
+
- <ENDED_AT> is ISO8601.
|
|
13
|
+
- <DURATION_MS> is Integer.
|
|
14
|
+
- <OUTCOME> is String.
|
|
15
|
+
- <ARTIFACTS> is String.
|
|
16
|
+
- <ERRORS> is String.
|
|
17
|
+
</format>
|
aps_cli/payload/agnostic-prompt-standard/assets/formats/format-table-api-coverage-v1.0.0.example.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<format id="TABLE_API_COVERAGE_V1" name="API Coverage Table" purpose="Report API operation coverage against a specification.">
|
|
2
|
+
## <TABLE_NAME>
|
|
3
|
+
| Operation | URI | SpecRef | Gap |
|
|
4
|
+
| --- | --- | --- | --- |
|
|
5
|
+
| <OPERATION> | <URI> | <SPEC_REF> | <GAP> |
|
|
6
|
+
|
|
7
|
+
WHERE:
|
|
8
|
+
- <TABLE_NAME> is the title for the API coverage table.
|
|
9
|
+
- <OPERATION> is the HTTP method, one of: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, `OPTIONS`.
|
|
10
|
+
- <URI> is the absolute path of the API endpoint, starting with `/`.
|
|
11
|
+
- <SPEC_REF> is a reference to the relevant part of the API specification, one of: `OpenAPI: <PATH_OR_COMPONENT>` or `Swagger: <PATH_OR_COMPONENT>`.
|
|
12
|
+
- <GAP> is the coverage gap analysis code, one of: `OK`, `MISSING_PATH`, `MISSING_METHOD`, `REQ_SCHEMA_MISMATCH`, `RESP_SCHEMA_MISMATCH`, `STATUS_CODE_MISSING`.
|
|
13
|
+
</format>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Platforms
|
|
2
|
+
|
|
3
|
+
APS is designed to be **platform-agnostic**, but real hosts (IDEs, agent runtimes, CI bots) differ in:
|
|
4
|
+
|
|
5
|
+
- File discovery conventions (where prompts/agents/skills live)
|
|
6
|
+
- YAML frontmatter dialects (which fields exist, required/optional)
|
|
7
|
+
- Tool availability, naming, and approval UX
|
|
8
|
+
- Safety constraints (auto-approve settings, restricted file paths)
|
|
9
|
+
|
|
10
|
+
This folder contains **platform adapters** that describe those differences *without changing the APS v1.0 spec*.
|
|
11
|
+
|
|
12
|
+
## Adapter layout (recommended)
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
platforms/
|
|
16
|
+
_schemas/ # JSON Schemas for adapter files
|
|
17
|
+
_template/ # skeleton for new adapters
|
|
18
|
+
<platform-id>/
|
|
19
|
+
README.md
|
|
20
|
+
manifest.json # validates against _schemas/platform-manifest.schema.json
|
|
21
|
+
tools-registry.json # validates against _schemas/tools-registry.schema.json
|
|
22
|
+
frontmatter/ # copy/paste blocks for this platform
|
|
23
|
+
templates/ # ready-to-copy workspace artifacts
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Add a new platform adapter
|
|
27
|
+
|
|
28
|
+
1. Copy `platforms/_template/` to `platforms/<platform-id>/`
|
|
29
|
+
2. Fill in:
|
|
30
|
+
- `manifest.json` (file discovery rules + docs links)
|
|
31
|
+
- `tools-registry.json` (available tools + naming + risk tags)
|
|
32
|
+
3. Do **not** change `references/` unless you are intentionally publishing an APS spec revision.
|
|
33
|
+
|
|
34
|
+
## Contract
|
|
35
|
+
|
|
36
|
+
- Anything under `references/` is **normative** APS.
|
|
37
|
+
- Anything under `platforms/` is **non-normative** (documentation/templates/mappings only).
|
|
38
|
+
- Adapters should prefer **mapping + configuration** over rewriting APS core rules.
|
|
39
|
+
|