sia-package 0.2.0a0__tar.gz

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.
@@ -0,0 +1,171 @@
1
+ Metadata-Version: 2.4
2
+ Name: sia-package
3
+ Version: 0.2.0a0
4
+ Summary: Self-Improving Agents (SIA) - A portable, host-agnostic instruction package that turns any coding assistant into a self-improving project collaborator.
5
+ Home-page: https://github.com/GunjanGrunge/SIA_package
6
+ Author: GunjanGrunge
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/GunjanGrunge/SIA_package
9
+ Project-URL: Repository, https://github.com/GunjanGrunge/SIA_package
10
+ Project-URL: Issues, https://github.com/GunjanGrunge/SIA_package/issues
11
+ Keywords: sia,ai-agent,claude-code,antigravity,codex,bmad,superpowers,self-improving-agents,prompts,skills
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ Dynamic: home-page
24
+ Dynamic: requires-python
25
+
26
+
27
+ # SIA (Self-Improving Agents)
28
+
29
+ <p align="center">
30
+ <img src="https://img.shields.io/badge/version-0.2.0--alpha-00F2FE.svg?style=flat-square" alt="Version 0.2.0-alpha" />
31
+ <img src="https://img.shields.io/badge/status-active-success.svg?style=flat-square" alt="Status: Active" />
32
+ <img src="https://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat-square" alt="License: MIT" />
33
+ <img src="https://img.shields.io/badge/host--agnostic-yes-7B2CBF.svg?style=flat-square" alt="Host-agnostic" />
34
+ </p>
35
+
36
+ > **A portable, host-agnostic instruction package that turns any coding assistant into a self-improving project collaborator.**
37
+
38
+ It generates fresh, project-specific process artifacts: a project `AGENT.md`, a spec, an implementation plan, **modular feature-based project skills**, token savings metrics, and auditable subagent task records. You install SIA and state the goal; SIA derives the needed feature skills, delegates implementation through the host harness (Claude Code, Antigravity, Codex, etc.), reviews the results in your project root directory, and reports the integrated outcome with clear token savings metrics.
39
+
40
+ This repo **is** the package. Clone it directly into a project as `sia/` and you're set up.
41
+
42
+ ## Architecture
43
+
44
+ ```text
45
+ ┌────────────────┐ ┌──────────────────────────┐ ┌─────────────────────────┐
46
+ │ 1. BOOTSTRAP │ ---> │ 2. INTAKE & CLASSIFY │ ---> │ 3. SPEC & AGENT.MD │
47
+ │ banner & mode │ │ Repo exploration/Goal │ │ Specs & Standing Rules │
48
+ └────────────────┘ └──────────────────────────┘ └─────────────────────────┘
49
+
50
+ ┌────────────────┐ ┌──────────────────────────┐ ▼
51
+ │ 6. FEEDBACK │ <--- │ 5. EXECUTION & AUDIT │ <--- ┌─────────────────────────┐
52
+ │ Loop & rules │ │ Root Dir & Subagents │ │ 4. MODULAR SKILL SYNTH │
53
+ └────────────────┘ └──────────────────────────┘ │ Feature Domain Skills │
54
+ └─────────────────────────┘
55
+ ```
56
+
57
+ The full pipeline this package implements — see `AGENT.md` for the authoritative step-by-step version this diagram summarizes.
58
+
59
+ ## Install
60
+
61
+ Initialize SIA in any project with your preferred package manager:
62
+
63
+ ```bash
64
+ # Option A: npm / npx (Zero-install launcher)
65
+ npx sia-agent init
66
+
67
+ # Option B: Python / PyPI
68
+ pip install sia-agent && sia init
69
+
70
+ # Option C: Direct Git Clone
71
+ git clone https://github.com/GunjanGrunge/SIA_package.git /path/to/your-project/sia
72
+ ```
73
+
74
+ Then, in `your-project/`:
75
+
76
+ 1. **Read [`sia/INSTALL.md`](./INSTALL.md)** — gitignoring this vendored
77
+ folder correctly (while keeping the artifacts SIA *generates* for
78
+ your project committed), and an optional Claude Code discovery shim.
79
+ 2. **Tell your assistant once:** *"Read `sia/AGENT.md` and follow it."*
80
+ That's the one mandatory entry point — from there it runs Intake,
81
+ asks what it needs to, and generates your project's own `AGENT.md`,
82
+ spec, project skill(s), and plan using the guides under `sia/guides/`.
83
+ During execution it requires a brief, dispatch record, subagent report,
84
+ reviewer verdict, and integration report for each planned task.
85
+
86
+ No API keys, no account, no cloud dependency. It's plain markdown
87
+ instructions plus a small Python structure-test harness
88
+ (`tests/validate_sia.py`) used only when developing this package itself.
89
+
90
+ For the complete new-project, existing-project, Claude Code, Codex,
91
+ subagent, reporting, and update workflow, read [USAGE.md](./USAGE.md).
92
+
93
+ ### Existing project? You choose the starting mode
94
+
95
+ After the minimal safety check, SIA asks which way you want to begin:
96
+
97
+ 1. **Repository-informed exploration** — SIA reads a bounded set of
98
+ relevant artifacts, explains what it knows and does not know, then
99
+ asks what you want to build or change.
100
+ 2. **Goal-first** — SIA skips the broad repository scan and asks what you
101
+ want immediately, reading only what is needed for that request.
102
+ 3. **Conversational discovery** — you describe the project first; SIA
103
+ verifies only the evidence needed for the work that emerges.
104
+
105
+ The chosen mode, evidence read, knowns, unknowns, and goal become part of
106
+ the generated project record. SIA never claims it understands files it
107
+ has not examined.
108
+
109
+ ### Attribution is automatic
110
+
111
+ The public distribution adds a compact README badge and trailers to future
112
+ SIA-mediated commits automatically—no slash command or toggle required.
113
+ Trailers credit SIA's workflow while keeping the existing human Git author
114
+ intact and linking the commit to project evidence. A direct user instruction
115
+ to omit attribution is respected. See
116
+ [`guides/attribution.md`](./guides/attribution.md) for the exact policy.
117
+
118
+ ## What's in here
119
+
120
+ ```
121
+ AGENT.md # bootstrap — read this first
122
+ guides/
123
+ ├── questioning-and-approval.md # batching questions, severity-tagged approval gates
124
+ ├── writing-agent-md.md # how to author a project's own AGENT.md
125
+ ├── writing-spec.md # how to author a project spec
126
+ ├── writing-plan.md # how to break a spec into a plan (file ownership, integration phase)
127
+ ├── writing-project-skills.md # how SIA derives host-discoverable project skills
128
+ ├── subagent-task-brief.md # task brief / report / progress-log / integration-report formats
129
+ └── security-gate.md # fixed threat-class checklist (software projects only)
130
+ capture-interface.md # feedback capture + the self-healing loop-engineering mechanism
131
+ integrations/claude-code/SKILL.md # optional Claude Code auto-discovery shim
132
+ INSTALL.md # how to add this to a project (gitignore policy, discovery)
133
+ VALIDATION.md # the dogfood checklist this package is tested against
134
+ USAGE.md # complete user guide for new and existing projects
135
+ CHANGELOG.md
136
+ tests/ # structure-test harness (dev tooling, not needed to use SIA)
137
+ ```
138
+
139
+ ## Core idea
140
+
141
+ SIA is a *generator*, not a library of pre-built templates. Every
142
+ project gets its own fresh `AGENT.md`, spec, plan, and skill pack — never copied
143
+ from another project — authored using the guides here. The one
144
+ exception is `guides/security-gate.md`, a fixed, reused checklist for
145
+ software projects.
146
+
147
+ When a host supports subagents, SIA's controller is not allowed to
148
+ silently replace a delegated implementation task with direct coding. A
149
+ task is complete only with durable dispatch, implementation, review, and
150
+ integration evidence; otherwise SIA reports the execution limitation to
151
+ the user.
152
+
153
+ The feedback loop (`capture-interface.md`) turns verified mistakes into
154
+ project-specific standing rules with full provenance (source, evidence,
155
+ severity, error class, scope, date, active/retired status), re-checked
156
+ before every future proposal — so a project accumulates fewer repeated
157
+ mistakes over its life instead of a longer history of the same ones.
158
+
159
+ ## Validation
160
+
161
+ `VALIDATION.md` is the dogfood checklist this package is tested against
162
+ before a version is called stable — real, previously-unseen codebases,
163
+ not synthetic examples. A pilot validation report covering several real
164
+ runs (including a full multi-subagent execution path: scoped task
165
+ briefs, independent implementer subagents, an independent reviewer, and
166
+ a real integration build) is maintained separately; ask the maintainer
167
+ for a link if you want to see it.
168
+
169
+ ## License
170
+
171
+ MIT.
@@ -0,0 +1,145 @@
1
+
2
+
3
+ <p align="center">
4
+ <img src="https://img.shields.io/badge/version-0.2.0--alpha-00F2FE.svg?style=flat-square" alt="Version 0.2.0-alpha" />
5
+ <img src="https://img.shields.io/badge/status-active-success.svg?style=flat-square" alt="Status: Active" />
6
+ <img src="https://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat-square" alt="License: MIT" />
7
+ <img src="https://img.shields.io/badge/host--agnostic-yes-7B2CBF.svg?style=flat-square" alt="Host-agnostic" />
8
+ </p>
9
+
10
+ > **A portable, host-agnostic instruction package that turns any coding assistant into a self-improving project collaborator.**
11
+
12
+ It generates fresh, project-specific process artifacts: a project `AGENT.md`, a spec, an implementation plan, **modular feature-based project skills**, token savings metrics, and auditable subagent task records. You install SIA and state the goal; SIA derives the needed feature skills, delegates implementation through the host harness (Claude Code, Antigravity, Codex, etc.), reviews the results in your project root directory, and reports the integrated outcome with clear token savings metrics.
13
+
14
+ This repo **is** the package. Clone it directly into a project as `sia/` and you're set up.
15
+
16
+ ## Architecture
17
+
18
+ ```text
19
+ ┌────────────────┐ ┌──────────────────────────┐ ┌─────────────────────────┐
20
+ │ 1. BOOTSTRAP │ ---> │ 2. INTAKE & CLASSIFY │ ---> │ 3. SPEC & AGENT.MD │
21
+ │ banner & mode │ │ Repo exploration/Goal │ │ Specs & Standing Rules │
22
+ └────────────────┘ └──────────────────────────┘ └─────────────────────────┘
23
+
24
+ ┌────────────────┐ ┌──────────────────────────┐ ▼
25
+ │ 6. FEEDBACK │ <--- │ 5. EXECUTION & AUDIT │ <--- ┌─────────────────────────┐
26
+ │ Loop & rules │ │ Root Dir & Subagents │ │ 4. MODULAR SKILL SYNTH │
27
+ └────────────────┘ └──────────────────────────┘ │ Feature Domain Skills │
28
+ └─────────────────────────┘
29
+ ```
30
+
31
+ The full pipeline this package implements — see `AGENT.md` for the authoritative step-by-step version this diagram summarizes.
32
+
33
+ ## Install
34
+
35
+ Initialize SIA in any project with your preferred package manager:
36
+
37
+ ```bash
38
+ # Option A: npm / npx (Zero-install launcher)
39
+ npx sia-agent init
40
+
41
+ # Option B: Python / PyPI
42
+ pip install sia-agent && sia init
43
+
44
+ # Option C: Direct Git Clone
45
+ git clone https://github.com/GunjanGrunge/SIA_package.git /path/to/your-project/sia
46
+ ```
47
+
48
+ Then, in `your-project/`:
49
+
50
+ 1. **Read [`sia/INSTALL.md`](./INSTALL.md)** — gitignoring this vendored
51
+ folder correctly (while keeping the artifacts SIA *generates* for
52
+ your project committed), and an optional Claude Code discovery shim.
53
+ 2. **Tell your assistant once:** *"Read `sia/AGENT.md` and follow it."*
54
+ That's the one mandatory entry point — from there it runs Intake,
55
+ asks what it needs to, and generates your project's own `AGENT.md`,
56
+ spec, project skill(s), and plan using the guides under `sia/guides/`.
57
+ During execution it requires a brief, dispatch record, subagent report,
58
+ reviewer verdict, and integration report for each planned task.
59
+
60
+ No API keys, no account, no cloud dependency. It's plain markdown
61
+ instructions plus a small Python structure-test harness
62
+ (`tests/validate_sia.py`) used only when developing this package itself.
63
+
64
+ For the complete new-project, existing-project, Claude Code, Codex,
65
+ subagent, reporting, and update workflow, read [USAGE.md](./USAGE.md).
66
+
67
+ ### Existing project? You choose the starting mode
68
+
69
+ After the minimal safety check, SIA asks which way you want to begin:
70
+
71
+ 1. **Repository-informed exploration** — SIA reads a bounded set of
72
+ relevant artifacts, explains what it knows and does not know, then
73
+ asks what you want to build or change.
74
+ 2. **Goal-first** — SIA skips the broad repository scan and asks what you
75
+ want immediately, reading only what is needed for that request.
76
+ 3. **Conversational discovery** — you describe the project first; SIA
77
+ verifies only the evidence needed for the work that emerges.
78
+
79
+ The chosen mode, evidence read, knowns, unknowns, and goal become part of
80
+ the generated project record. SIA never claims it understands files it
81
+ has not examined.
82
+
83
+ ### Attribution is automatic
84
+
85
+ The public distribution adds a compact README badge and trailers to future
86
+ SIA-mediated commits automatically—no slash command or toggle required.
87
+ Trailers credit SIA's workflow while keeping the existing human Git author
88
+ intact and linking the commit to project evidence. A direct user instruction
89
+ to omit attribution is respected. See
90
+ [`guides/attribution.md`](./guides/attribution.md) for the exact policy.
91
+
92
+ ## What's in here
93
+
94
+ ```
95
+ AGENT.md # bootstrap — read this first
96
+ guides/
97
+ ├── questioning-and-approval.md # batching questions, severity-tagged approval gates
98
+ ├── writing-agent-md.md # how to author a project's own AGENT.md
99
+ ├── writing-spec.md # how to author a project spec
100
+ ├── writing-plan.md # how to break a spec into a plan (file ownership, integration phase)
101
+ ├── writing-project-skills.md # how SIA derives host-discoverable project skills
102
+ ├── subagent-task-brief.md # task brief / report / progress-log / integration-report formats
103
+ └── security-gate.md # fixed threat-class checklist (software projects only)
104
+ capture-interface.md # feedback capture + the self-healing loop-engineering mechanism
105
+ integrations/claude-code/SKILL.md # optional Claude Code auto-discovery shim
106
+ INSTALL.md # how to add this to a project (gitignore policy, discovery)
107
+ VALIDATION.md # the dogfood checklist this package is tested against
108
+ USAGE.md # complete user guide for new and existing projects
109
+ CHANGELOG.md
110
+ tests/ # structure-test harness (dev tooling, not needed to use SIA)
111
+ ```
112
+
113
+ ## Core idea
114
+
115
+ SIA is a *generator*, not a library of pre-built templates. Every
116
+ project gets its own fresh `AGENT.md`, spec, plan, and skill pack — never copied
117
+ from another project — authored using the guides here. The one
118
+ exception is `guides/security-gate.md`, a fixed, reused checklist for
119
+ software projects.
120
+
121
+ When a host supports subagents, SIA's controller is not allowed to
122
+ silently replace a delegated implementation task with direct coding. A
123
+ task is complete only with durable dispatch, implementation, review, and
124
+ integration evidence; otherwise SIA reports the execution limitation to
125
+ the user.
126
+
127
+ The feedback loop (`capture-interface.md`) turns verified mistakes into
128
+ project-specific standing rules with full provenance (source, evidence,
129
+ severity, error class, scope, date, active/retired status), re-checked
130
+ before every future proposal — so a project accumulates fewer repeated
131
+ mistakes over its life instead of a longer history of the same ones.
132
+
133
+ ## Validation
134
+
135
+ `VALIDATION.md` is the dogfood checklist this package is tested against
136
+ before a version is called stable — real, previously-unseen codebases,
137
+ not synthetic examples. A pilot validation report covering several real
138
+ runs (including a full multi-subagent execution path: scoped task
139
+ briefs, independent implementer subagents, an independent reviewer, and
140
+ a real integration build) is maintained separately; ask the maintainer
141
+ for a link if you want to see it.
142
+
143
+ ## License
144
+
145
+ MIT.
@@ -0,0 +1,218 @@
1
+ """
2
+ SIA (Self-Improving Agents) - Terminal Startup & Status Banner
3
+ ===============================================================
4
+ Compact, elegant startup banner in the style of modern developer CLIs (Claude Code).
5
+ Features the official Hexagonal Prism 'S' vector mark in Electric Cyan,
6
+ engine detection, working directory verification, and SIA project status audit.
7
+ """
8
+
9
+ import os
10
+ import sys
11
+ import argparse
12
+ from pathlib import Path
13
+
14
+ # Electric Cyan Color Palette
15
+ CYAN = "\033[38;2;0;242;254m"
16
+ BOLD_CYAN = "\033[1m\033[38;2;0;242;254m"
17
+ DIM = "\033[38;2;120;135;155m"
18
+ GREEN = "\033[38;2;0;229;163m"
19
+ YELLOW = "\033[38;2;255;191;0m"
20
+ RED = "\033[38;2;255;75;75m"
21
+ RESET = "\033[0m"
22
+
23
+ VERSION = "0.2.0-alpha"
24
+
25
+ def is_color_enabled() -> bool:
26
+ return not bool(os.environ.get("NO_COLOR")) and sys.stdout.isatty()
27
+
28
+ def detect_host_engine() -> str:
29
+ """Detect active coding assistant host environment/engine"""
30
+ if os.environ.get("CLAUDE_CODE") or os.environ.get("CLAUDE_CODE_ENTRY"):
31
+ return "Claude Code (Terminal)"
32
+ elif os.environ.get("ANTIGRAVITY_IDE") or "antigravity" in sys.executable.lower():
33
+ return "Antigravity IDE"
34
+ elif os.environ.get("CODEX_CLI") or os.environ.get("CODEX_SESSION"):
35
+ return "Codex CLI"
36
+ elif "cursor" in os.environ.get("PATH", "").lower():
37
+ return "Cursor / Host Agent"
38
+ else:
39
+ return "Generic Host Engine (Claude/Codex/Antigravity)"
40
+
41
+ def verify_working_directory() -> tuple[str, bool]:
42
+ """Verify if execution directory is inside target project root or hidden workingtree"""
43
+ cwd = os.getcwd()
44
+ is_workingtree = ".claude/workingtree" in cwd.replace("\\", "/") or "scratch/" in cwd.replace("\\", "/")
45
+ return cwd, not is_workingtree
46
+
47
+ # Official High-Definition Hexagonal Prism 'S' Vector Mark
48
+ HEX_PRISM_MARK = [
49
+ " ⣠⣴⣶⣄ ",
50
+ " ⢀⣴⣾⣿⣿⣿⣿⣿⣦⣄ ",
51
+ " ⣠⣾⣿⣿⡿⠋⠁ ⠙⠿⣿⣿⣷⣦⡀ ",
52
+ " ⣴⣿⣿⣿⠟⠉ ⢀⣠⣄ ⠈⠛⣿⣿⣿⡗ ",
53
+ " ⣿⣿⣯⡀ ⠐⢿⣿⣿⣷⣤⡀⠐⢿⣿⡟ ",
54
+ " ⠙⢿⣿⣿⣷⣄ ⠈⠻⣿⣿⣿⣦⣀⠉ ",
55
+ " ⠙⠻⣿⣿⣷⣦⡀ ⠙⢿⣿⣿⣷⣄⡀ ",
56
+ " ⢠⣷⣄⠈⠻⢿⣿⣿⣶⣄ ⠉⠻⣿⣿⣿ ",
57
+ " ⢠⣿⣿⣿⠃ ⠙⠿⡿⠟⠁ ⢀⣤⣾⣿⣿ ",
58
+ " ⠘⠻⣿⣿⣿⣦⣄ ⣠⣶⣿⣿⡿⠛⠁ ",
59
+ " ⠙⠿⣿⣿⣷⣦⣴⣾⣿⣿⠟⠋ ",
60
+ " ⠈⠛⢿⣿⣿⡿⠋⠁ "
61
+ ]
62
+
63
+ def get_claude_code_banner(version=VERSION, cwd=None) -> str:
64
+ """Centered compact splash screen in vibrant Electric Cyan (Claude Code style)"""
65
+ if cwd is None:
66
+ cwd, is_valid_root = verify_working_directory()
67
+ home = os.path.expanduser("~")
68
+ if cwd.startswith(home):
69
+ cwd = "~" + cwd[len(home):]
70
+
71
+ engine = detect_host_engine()
72
+ c = BOLD_CYAN if is_color_enabled() else ""
73
+ cyan_reg = CYAN if is_color_enabled() else ""
74
+ d = DIM if is_color_enabled() else ""
75
+ g = GREEN if is_color_enabled() else ""
76
+ r = RESET if is_color_enabled() else ""
77
+
78
+ lines = [""]
79
+ for row in HEX_PRISM_MARK:
80
+ lines.append(f" {c}{row}{r}")
81
+
82
+ lines.append("")
83
+ lines.append(f" {c}SIA{r} {d}v{version}{r}")
84
+ lines.append(f" {cyan_reg}Self-Improving Agents{r}")
85
+ lines.append("")
86
+ lines.append(f" {c}•{r} Engine : {g}{engine}{r}")
87
+ lines.append(f" {c}•{r} Loop Engineering : {g}active{r}")
88
+ lines.append(f" {c}•{r} Security Gate : {g}armed{r}")
89
+ lines.append(f" {c}•{r} Human Gates : {d}questioning & approval{r}")
90
+ lines.append(f" {c}•{r} Directory : {d}{cwd}{r}")
91
+ lines.append("")
92
+ return "\n".join(lines)
93
+
94
+ def get_inline_banner(version=VERSION, cwd=None) -> str:
95
+ """Inline side-by-side compact banner in Electric Cyan"""
96
+ if cwd is None:
97
+ cwd, is_valid_root = verify_working_directory()
98
+ home = os.path.expanduser("~")
99
+ if cwd.startswith(home):
100
+ cwd = "~" + cwd[len(home):]
101
+
102
+ engine = detect_host_engine()
103
+ c = BOLD_CYAN if is_color_enabled() else ""
104
+ cyan_reg = CYAN if is_color_enabled() else ""
105
+ d = DIM if is_color_enabled() else ""
106
+ g = GREEN if is_color_enabled() else ""
107
+ r = RESET if is_color_enabled() else ""
108
+
109
+ side_text = [
110
+ "",
111
+ "",
112
+ f" {c}SIA{r} {d}v{version}{r}",
113
+ f" {cyan_reg}Self-Improving Agents{r}",
114
+ "",
115
+ f" {c}•{r} engine: {g}{engine}{r}",
116
+ f" {c}•{r} loop: {g}active{r} {d}•{r} security: {g}armed{r}",
117
+ f" {c}•{r} cwd: {d}{cwd}{r}",
118
+ "",
119
+ "",
120
+ "",
121
+ ""
122
+ ]
123
+
124
+ lines = [""]
125
+ for i in range(len(HEX_PRISM_MARK)):
126
+ l = f"{c}{HEX_PRISM_MARK[i]}{r}"
127
+ s = side_text[i]
128
+ lines.append(f" {l}{s}")
129
+ lines.append("")
130
+ return "\n".join(lines)
131
+
132
+ def print_status_audit():
133
+ """Print comprehensive SIA project status, modular skills, and token savings"""
134
+ c = BOLD_CYAN if is_color_enabled() else ""
135
+ d = DIM if is_color_enabled() else ""
136
+ g = GREEN if is_color_enabled() else ""
137
+ y = YELLOW if is_color_enabled() else ""
138
+ r = RESET if is_color_enabled() else ""
139
+
140
+ cwd, is_root_valid = verify_working_directory()
141
+ engine = detect_host_engine()
142
+
143
+ print(f"\n{c}=== SIA Status & Project Audit ==={r}")
144
+ print(f"SIA Version : {g}{VERSION}{r}")
145
+ print(f"Host Engine : {g}{engine}{r}")
146
+ print(f"Working Dir : {d}{cwd}{r} {'[' + g + 'OK: Project Root' + r + ']' if is_root_valid else '[' + y + 'WARN: Isolated Sandbox' + r + ']'}")
147
+
148
+ # Check for project AGENT.md
149
+ agent_file = Path("AGENT.md")
150
+ if agent_file.exists():
151
+ print(f"Project AGENT : {g}Present ({agent_file.stat().st_size} bytes){r}")
152
+ else:
153
+ print(f"Project AGENT : {y}Not generated yet (Run SIA Intake){r}")
154
+
155
+ # Inspect skills directory
156
+ skills_dir = Path("skills")
157
+ modular_skills = list(skills_dir.glob("*/SKILL.md")) if skills_dir.exists() else []
158
+ print(f"Modular Skills: {g}{len(modular_skills)} active feature skill(s){r}")
159
+ for s in modular_skills:
160
+ print(f" - {d}{s}{r}")
161
+
162
+ # Inspect SDD records
163
+ sdd_dir = Path("sdd")
164
+ if sdd_dir.exists():
165
+ progress_file = sdd_dir / "progress.md"
166
+ manifest_file = sdd_dir / "skill-manifest.md"
167
+ print(f"Execution Gate: {g}SDD records active{r}")
168
+ if progress_file.exists():
169
+ print(f"Progress Log : {d}{progress_file}{r}")
170
+ if manifest_file.exists():
171
+ print(f"Skill Manifest : {d}{manifest_file}{r}")
172
+ else:
173
+ print(f"Execution Gate: {d}No active plan execution in sdd/{r}")
174
+
175
+ print(f"Token Accounting: {g}Active (Tracking Tokens Used & Baseline Context Savings){r}")
176
+ print(f"{c}===================================={r}\n")
177
+
178
+ def print_banner(inline=False, version=VERSION):
179
+ """Main API function to print the banner to stdout"""
180
+ try:
181
+ sys.stdout.reconfigure(encoding="utf-8")
182
+ except Exception:
183
+ pass
184
+
185
+ if inline:
186
+ print(get_inline_banner(version=version))
187
+ else:
188
+ print(get_claude_code_banner(version=version))
189
+
190
+ def main():
191
+ parser = argparse.ArgumentParser(description="SIA Terminal Startup Banner & Status Audit")
192
+ parser.add_argument("--inline", action="store_true", help="Display inline side-by-side instead of centered stacked")
193
+ parser.add_argument("--status", "--check", action="store_true", help="Print current SIA project status, modular skills & token savings")
194
+ parser.add_argument("--save-txt", type=str, default=None, help="Save plain-text banner to file")
195
+ args = parser.parse_args()
196
+
197
+ if args.status:
198
+ print_status_audit()
199
+ return
200
+
201
+ if args.save_txt:
202
+ os.environ["NO_COLOR"] = "1"
203
+ content = get_inline_banner() if args.inline else get_claude_code_banner()
204
+ content_clean = content.strip("\r\n") + "\n"
205
+ # Replace actual directory with <current project directory> placeholder for release distribution
206
+ cwd, _ = verify_working_directory()
207
+ home = os.path.expanduser("~")
208
+ if cwd.startswith(home):
209
+ cwd = "~" + cwd[len(home):]
210
+ content_clean = content_clean.replace(cwd, "<current project directory>")
211
+ with open(args.save_txt, "w", encoding="utf-8") as f:
212
+ f.write(content_clean)
213
+ print(f"Saved banner to {args.save_txt}")
214
+ else:
215
+ print_banner(inline=args.inline)
216
+
217
+ if __name__ == "__main__":
218
+ main()
@@ -0,0 +1,104 @@
1
+ """
2
+ SIA (Self-Improving Agents) - Unified Python CLI & Plugin Launcher
3
+ ====================================================================
4
+ Provides `sia init`, `sia status`, `pip install sia-agent`, and `pipx` CLI tooling.
5
+ """
6
+
7
+ import os
8
+ import sys
9
+ import shutil
10
+ import argparse
11
+ from pathlib import Path
12
+ from banner import print_status_audit, print_banner, VERSION
13
+
14
+ PACKAGE_ROOT = Path(__file__).resolve().parent
15
+
16
+ def print_help():
17
+ try:
18
+ sys.stdout.reconfigure(encoding="utf-8")
19
+ except Exception:
20
+ pass
21
+ print(f"""
22
+ \033[1m\033[38;2;0;242;254mSIA (Self-Improving Agents) Python CLI v{VERSION}\033[0m
23
+
24
+ \033[36mUsage:\033[0m
25
+ sia init Initialize SIA in current project (vendors sia/ & sets up discovery shims)
26
+ sia status Run SIA project audit, check active skills & token savings
27
+ sia banner Display terminal launch banner
28
+ sia --help Show this help guide
29
+
30
+ \033[36mQuickstart:\033[0m
31
+ 1. Run \033[32msia init\033[0m inside your target project directory.
32
+ 2. Tell your assistant: \033[33m"Read sia/AGENT.md and follow it."\033[0m
33
+ 3. Verify status anytime with \033[32msia status\033[0m.
34
+ """)
35
+
36
+ def init_sia():
37
+ try:
38
+ sys.stdout.reconfigure(encoding="utf-8")
39
+ except Exception:
40
+ pass
41
+ cwd = Path.cwd().resolve()
42
+ sia_target = cwd / "sia"
43
+
44
+ print(f"\033[36m[SIA]\033[0m Initializing SIA v{VERSION} in project root: \033[33m{cwd}\033[0m")
45
+
46
+ if cwd != PACKAGE_ROOT.resolve():
47
+ sia_target.mkdir(parents=True, exist_ok=True)
48
+ items_to_copy = ['AGENT.md', 'BANNER.txt', 'CHANGELOG.md', 'INSTALL.md', 'README.md', 'USAGE.md', 'VALIDATION.md', 'banner.py', 'capture-interface.md', 'guides', 'integrations']
49
+ for item in items_to_copy:
50
+ src = PACKAGE_ROOT / item
51
+ dest = sia_target / item
52
+ if src.exists():
53
+ if src.is_dir():
54
+ shutil.copytree(src, dest, dirs_exist_ok=True)
55
+ else:
56
+ shutil.copy2(src, dest)
57
+ print("\033[32m✔ Vendored SIA files copied to ./sia/\033[0m")
58
+ else:
59
+ print("\033[32m✔ Currently in SIA package repository root.\033[0m")
60
+
61
+ # Update .gitignore
62
+ gitignore_path = cwd / ".gitignore"
63
+ gitignore_content = gitignore_path.read_text(encoding="utf-8") if gitignore_path.exists() else ""
64
+ if "sia/" not in gitignore_content:
65
+ with open(gitignore_path, "a", encoding="utf-8") as f:
66
+ f.write("\n# Vendored SIA (Self Improving Agents) tooling\nsia/\n")
67
+ print("\033[32m✔ Added sia/ to .gitignore\033[0m")
68
+ else:
69
+ print("\033[32m✔ .gitignore already configured for sia/\033[0m")
70
+
71
+ # Set up Claude Code discovery shim
72
+ claude_skills_dir = cwd / ".claude" / "skills" / "sia"
73
+ claude_skills_dir.mkdir(parents=True, exist_ok=True)
74
+ shim_src = PACKAGE_ROOT / "integrations" / "claude-code" / "SKILL.md"
75
+ shim_dest = claude_skills_dir / "SKILL.md"
76
+ if shim_src.exists():
77
+ shutil.copy2(shim_src, shim_dest)
78
+ print("\033[32m✔ Installed Claude Code discovery shim at .claude/skills/sia/SKILL.md\033[0m")
79
+
80
+ print("\n\033[1m\033[32mSIA successfully initialized!\033[0m")
81
+ print("Tell your assistant: \033[1m\033[33m\"Read sia/AGENT.md and follow it.\"\033[0m\n")
82
+
83
+ def main():
84
+ parser = argparse.ArgumentParser(description="SIA Python CLI & Plugin Launcher", add_help=False)
85
+ parser.add_argument("command", nargs="?", default="help", help="Command: init, status, banner, help")
86
+ parser.add_argument("--help", "-h", action="store_true", help="Show help message")
87
+ parser.add_argument("--status", "--check", action="store_true", help="Run status audit")
88
+ args, unknown = parser.parse_known_args()
89
+
90
+ cmd = args.command.lower() if args.command else "help"
91
+
92
+ if args.help or cmd in ["help", "--help", "-h"]:
93
+ print_help()
94
+ elif args.status or cmd in ["status", "check", "--status", "--check"]:
95
+ print_status_audit()
96
+ elif cmd == "init":
97
+ init_sia()
98
+ elif cmd == "banner":
99
+ print_banner()
100
+ else:
101
+ print_help()
102
+
103
+ if __name__ == "__main__":
104
+ main()
@@ -0,0 +1,46 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "sia-package"
7
+ version = "0.2.0-alpha"
8
+ description = "Self-Improving Agents (SIA) - A portable, host-agnostic instruction package that turns any coding assistant into a self-improving project collaborator."
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ authors = [
12
+ { name = "GunjanGrunge" }
13
+ ]
14
+ keywords = [
15
+ "sia",
16
+ "ai-agent",
17
+ "claude-code",
18
+ "antigravity",
19
+ "codex",
20
+ "bmad",
21
+ "superpowers",
22
+ "self-improving-agents",
23
+ "prompts",
24
+ "skills"
25
+ ]
26
+ classifiers = [
27
+ "Development Status :: 3 - Alpha",
28
+ "Intended Audience :: Developers",
29
+ "Programming Language :: Python :: 3",
30
+ "Programming Language :: Python :: 3.9",
31
+ "Programming Language :: Python :: 3.10",
32
+ "Programming Language :: Python :: 3.11",
33
+ "Programming Language :: Python :: 3.12",
34
+ "Programming Language :: Python :: 3.13",
35
+ "Topic :: Software Development :: Libraries :: Python Modules"
36
+ ]
37
+ requires-python = ">=3.9"
38
+
39
+ [project.urls]
40
+ Homepage = "https://github.com/GunjanGrunge/SIA_package"
41
+ Repository = "https://github.com/GunjanGrunge/SIA_package"
42
+ Issues = "https://github.com/GunjanGrunge/SIA_package/issues"
43
+
44
+ [project.scripts]
45
+ sia = "cli:main"
46
+ sia-agent = "cli:main"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,27 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="sia-package",
5
+ version="0.2.0-alpha",
6
+ description="Self-Improving Agents (SIA) - A portable, host-agnostic instruction package that turns any coding assistant into a self-improving project collaborator.",
7
+ long_description=open("README.md", encoding="utf-8").read(),
8
+ long_description_content_type="text/markdown",
9
+ author="GunjanGrunge",
10
+ url="https://github.com/GunjanGrunge/SIA_package",
11
+ license="MIT",
12
+ py_modules=["cli", "banner"],
13
+ packages=find_packages(),
14
+ include_package_data=True,
15
+ entry_points={
16
+ "console_scripts": [
17
+ "sia=cli:main",
18
+ "sia-agent=cli:main",
19
+ ],
20
+ },
21
+ classifiers=[
22
+ "Development Status :: 3 - Alpha",
23
+ "Intended Audience :: Developers",
24
+ "Programming Language :: Python :: 3",
25
+ ],
26
+ python_requires=">=3.9",
27
+ )
@@ -0,0 +1,171 @@
1
+ Metadata-Version: 2.4
2
+ Name: sia-package
3
+ Version: 0.2.0a0
4
+ Summary: Self-Improving Agents (SIA) - A portable, host-agnostic instruction package that turns any coding assistant into a self-improving project collaborator.
5
+ Home-page: https://github.com/GunjanGrunge/SIA_package
6
+ Author: GunjanGrunge
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/GunjanGrunge/SIA_package
9
+ Project-URL: Repository, https://github.com/GunjanGrunge/SIA_package
10
+ Project-URL: Issues, https://github.com/GunjanGrunge/SIA_package/issues
11
+ Keywords: sia,ai-agent,claude-code,antigravity,codex,bmad,superpowers,self-improving-agents,prompts,skills
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ Dynamic: home-page
24
+ Dynamic: requires-python
25
+
26
+
27
+ # SIA (Self-Improving Agents)
28
+
29
+ <p align="center">
30
+ <img src="https://img.shields.io/badge/version-0.2.0--alpha-00F2FE.svg?style=flat-square" alt="Version 0.2.0-alpha" />
31
+ <img src="https://img.shields.io/badge/status-active-success.svg?style=flat-square" alt="Status: Active" />
32
+ <img src="https://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat-square" alt="License: MIT" />
33
+ <img src="https://img.shields.io/badge/host--agnostic-yes-7B2CBF.svg?style=flat-square" alt="Host-agnostic" />
34
+ </p>
35
+
36
+ > **A portable, host-agnostic instruction package that turns any coding assistant into a self-improving project collaborator.**
37
+
38
+ It generates fresh, project-specific process artifacts: a project `AGENT.md`, a spec, an implementation plan, **modular feature-based project skills**, token savings metrics, and auditable subagent task records. You install SIA and state the goal; SIA derives the needed feature skills, delegates implementation through the host harness (Claude Code, Antigravity, Codex, etc.), reviews the results in your project root directory, and reports the integrated outcome with clear token savings metrics.
39
+
40
+ This repo **is** the package. Clone it directly into a project as `sia/` and you're set up.
41
+
42
+ ## Architecture
43
+
44
+ ```text
45
+ ┌────────────────┐ ┌──────────────────────────┐ ┌─────────────────────────┐
46
+ │ 1. BOOTSTRAP │ ---> │ 2. INTAKE & CLASSIFY │ ---> │ 3. SPEC & AGENT.MD │
47
+ │ banner & mode │ │ Repo exploration/Goal │ │ Specs & Standing Rules │
48
+ └────────────────┘ └──────────────────────────┘ └─────────────────────────┘
49
+
50
+ ┌────────────────┐ ┌──────────────────────────┐ ▼
51
+ │ 6. FEEDBACK │ <--- │ 5. EXECUTION & AUDIT │ <--- ┌─────────────────────────┐
52
+ │ Loop & rules │ │ Root Dir & Subagents │ │ 4. MODULAR SKILL SYNTH │
53
+ └────────────────┘ └──────────────────────────┘ │ Feature Domain Skills │
54
+ └─────────────────────────┘
55
+ ```
56
+
57
+ The full pipeline this package implements — see `AGENT.md` for the authoritative step-by-step version this diagram summarizes.
58
+
59
+ ## Install
60
+
61
+ Initialize SIA in any project with your preferred package manager:
62
+
63
+ ```bash
64
+ # Option A: npm / npx (Zero-install launcher)
65
+ npx sia-agent init
66
+
67
+ # Option B: Python / PyPI
68
+ pip install sia-agent && sia init
69
+
70
+ # Option C: Direct Git Clone
71
+ git clone https://github.com/GunjanGrunge/SIA_package.git /path/to/your-project/sia
72
+ ```
73
+
74
+ Then, in `your-project/`:
75
+
76
+ 1. **Read [`sia/INSTALL.md`](./INSTALL.md)** — gitignoring this vendored
77
+ folder correctly (while keeping the artifacts SIA *generates* for
78
+ your project committed), and an optional Claude Code discovery shim.
79
+ 2. **Tell your assistant once:** *"Read `sia/AGENT.md` and follow it."*
80
+ That's the one mandatory entry point — from there it runs Intake,
81
+ asks what it needs to, and generates your project's own `AGENT.md`,
82
+ spec, project skill(s), and plan using the guides under `sia/guides/`.
83
+ During execution it requires a brief, dispatch record, subagent report,
84
+ reviewer verdict, and integration report for each planned task.
85
+
86
+ No API keys, no account, no cloud dependency. It's plain markdown
87
+ instructions plus a small Python structure-test harness
88
+ (`tests/validate_sia.py`) used only when developing this package itself.
89
+
90
+ For the complete new-project, existing-project, Claude Code, Codex,
91
+ subagent, reporting, and update workflow, read [USAGE.md](./USAGE.md).
92
+
93
+ ### Existing project? You choose the starting mode
94
+
95
+ After the minimal safety check, SIA asks which way you want to begin:
96
+
97
+ 1. **Repository-informed exploration** — SIA reads a bounded set of
98
+ relevant artifacts, explains what it knows and does not know, then
99
+ asks what you want to build or change.
100
+ 2. **Goal-first** — SIA skips the broad repository scan and asks what you
101
+ want immediately, reading only what is needed for that request.
102
+ 3. **Conversational discovery** — you describe the project first; SIA
103
+ verifies only the evidence needed for the work that emerges.
104
+
105
+ The chosen mode, evidence read, knowns, unknowns, and goal become part of
106
+ the generated project record. SIA never claims it understands files it
107
+ has not examined.
108
+
109
+ ### Attribution is automatic
110
+
111
+ The public distribution adds a compact README badge and trailers to future
112
+ SIA-mediated commits automatically—no slash command or toggle required.
113
+ Trailers credit SIA's workflow while keeping the existing human Git author
114
+ intact and linking the commit to project evidence. A direct user instruction
115
+ to omit attribution is respected. See
116
+ [`guides/attribution.md`](./guides/attribution.md) for the exact policy.
117
+
118
+ ## What's in here
119
+
120
+ ```
121
+ AGENT.md # bootstrap — read this first
122
+ guides/
123
+ ├── questioning-and-approval.md # batching questions, severity-tagged approval gates
124
+ ├── writing-agent-md.md # how to author a project's own AGENT.md
125
+ ├── writing-spec.md # how to author a project spec
126
+ ├── writing-plan.md # how to break a spec into a plan (file ownership, integration phase)
127
+ ├── writing-project-skills.md # how SIA derives host-discoverable project skills
128
+ ├── subagent-task-brief.md # task brief / report / progress-log / integration-report formats
129
+ └── security-gate.md # fixed threat-class checklist (software projects only)
130
+ capture-interface.md # feedback capture + the self-healing loop-engineering mechanism
131
+ integrations/claude-code/SKILL.md # optional Claude Code auto-discovery shim
132
+ INSTALL.md # how to add this to a project (gitignore policy, discovery)
133
+ VALIDATION.md # the dogfood checklist this package is tested against
134
+ USAGE.md # complete user guide for new and existing projects
135
+ CHANGELOG.md
136
+ tests/ # structure-test harness (dev tooling, not needed to use SIA)
137
+ ```
138
+
139
+ ## Core idea
140
+
141
+ SIA is a *generator*, not a library of pre-built templates. Every
142
+ project gets its own fresh `AGENT.md`, spec, plan, and skill pack — never copied
143
+ from another project — authored using the guides here. The one
144
+ exception is `guides/security-gate.md`, a fixed, reused checklist for
145
+ software projects.
146
+
147
+ When a host supports subagents, SIA's controller is not allowed to
148
+ silently replace a delegated implementation task with direct coding. A
149
+ task is complete only with durable dispatch, implementation, review, and
150
+ integration evidence; otherwise SIA reports the execution limitation to
151
+ the user.
152
+
153
+ The feedback loop (`capture-interface.md`) turns verified mistakes into
154
+ project-specific standing rules with full provenance (source, evidence,
155
+ severity, error class, scope, date, active/retired status), re-checked
156
+ before every future proposal — so a project accumulates fewer repeated
157
+ mistakes over its life instead of a longer history of the same ones.
158
+
159
+ ## Validation
160
+
161
+ `VALIDATION.md` is the dogfood checklist this package is tested against
162
+ before a version is called stable — real, previously-unseen codebases,
163
+ not synthetic examples. A pilot validation report covering several real
164
+ runs (including a full multi-subagent execution path: scoped task
165
+ briefs, independent implementer subagents, an independent reviewer, and
166
+ a real integration build) is maintained separately; ask the maintainer
167
+ for a link if you want to see it.
168
+
169
+ ## License
170
+
171
+ MIT.
@@ -0,0 +1,11 @@
1
+ README.md
2
+ banner.py
3
+ cli.py
4
+ pyproject.toml
5
+ setup.py
6
+ sia_package.egg-info/PKG-INFO
7
+ sia_package.egg-info/SOURCES.txt
8
+ sia_package.egg-info/dependency_links.txt
9
+ sia_package.egg-info/entry_points.txt
10
+ sia_package.egg-info/top_level.txt
11
+ tests/test_validate_sia_self.py
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ sia = cli:main
3
+ sia-agent = cli:main
@@ -0,0 +1,2 @@
1
+ banner
2
+ cli
@@ -0,0 +1,32 @@
1
+ import subprocess
2
+ import sys
3
+ import tempfile
4
+ import textwrap
5
+ from pathlib import Path
6
+
7
+ import validate_sia # noqa: E402 (sia/tests is on sys.path when run from that dir)
8
+
9
+
10
+ def test_assert_contains_raises_on_missing_pattern(tmp_path, monkeypatch):
11
+ monkeypatch.setattr(validate_sia, "SIA_ROOT", tmp_path)
12
+ (tmp_path / "sample.md").write_text("# Title\nbody text\n", encoding="utf-8")
13
+ try:
14
+ validate_sia.assert_contains("sample.md", [r"^# Title$", r"not present here"])
15
+ assert False, "expected AssertionError"
16
+ except AssertionError as exc:
17
+ assert "not present here" in str(exc)
18
+
19
+
20
+ def test_assert_contains_passes_when_all_patterns_found(tmp_path, monkeypatch):
21
+ monkeypatch.setattr(validate_sia, "SIA_ROOT", tmp_path)
22
+ (tmp_path / "sample.md").write_text("# Title\nbody text\n", encoding="utf-8")
23
+ validate_sia.assert_contains("sample.md", [r"^# Title$", r"body text"])
24
+
25
+
26
+ def test_assert_contains_raises_on_missing_file(tmp_path, monkeypatch):
27
+ monkeypatch.setattr(validate_sia, "SIA_ROOT", tmp_path)
28
+ try:
29
+ validate_sia.assert_contains("missing.md", [r"anything"])
30
+ assert False, "expected AssertionError"
31
+ except AssertionError as exc:
32
+ assert "does not exist" in str(exc)