28 Commits

Author SHA1 Message Date
1df4ea1b72 fix(docs): correct install one-liner raw URL (Gitea, not GitLab) + v0.2.1
git.codelab.vc is Gitea/Forgejo: raw path is /raw/branch/<ref>/, the GitLab-style
/-/raw/main/ returned 404 so the one-command install was broken. The one-liner
now also fetches the script from the stable channel (vetted), not main.
v0.2.1
2026-07-16 15:24:47 +03:00
de006ccf0c chore(release): v0.2.0 v0.2.0 2026-07-16 15:17:05 +03:00
be2d445a09 fix(install): require git alongside Node (pi install git: needs it)
Found in a clean cps sandbox run: a machine without git passes the Node check
but fails later inside 'pi install git:...' with an unclear error. Now checked
up front with an actionable message. CHANGELOG updated.

Decision on optionalDependencies (@modelcontextprotocol/sdk): KEEP. The heavy
install observed in the sandbox (~317 packages) is dominated by npm>=7
auto-installing the Pi peerDependencies stack, not the MCP SDK; removing the
SDK saves little and would make MCP enablement fragile across pi updates.
2026-07-16 15:12:12 +03:00
38f4ecf81f Merge harness hardening: security guardrails, DX commands, release channels, MCP scaffold 2026-07-16 14:36:29 +03:00
2995823a0f feat(mcp): scaffold Jira/Confluence/GitLab MCP bridge (disabled by default)
Pi has no built-in MCP; this adds a bridge extension + declarative registry.
- config/mcp.json: jira/confluence/gitlab servers, all enabled:false; URLs from
  company.json ({config:...}), tokens from env ({env:...}) — nothing hardcoded
- extensions/mcp-bridge.ts: resolves env templates, and for enabled servers
  connects via MCP SDK (dynamic import) and registers their tools; /mcp-status
  command; graceful no-op when disabled or SDK absent
- docs/mcp.md: how to enable, prerequisites (VPN, tokens, uvx/npx, SDK), security
- package.json: @modelcontextprotocol/sdk as optionalDependency; ignore package-lock

Verified offline: extension loads, /mcp-status lists 3 servers (disabled), env
resolver builds gitlab API URL from company.json gitHost + GITLAB_TOKEN. Live
connect needs VPN + a token + authorization to run the server package.
2026-07-16 14:33:21 +03:00
f4ebdd745a docs(readme): document new commands, guardrails, channels
- command table: /kit-doctor, /kit-help
- guardrails: secret-scanner, commit-guard, llm-redaction, audit-log; permission-gate updated to release-*/v*
- install/update: channels (stable/beta), PI_KIT_CHANNEL, link to RELEASING.md
- maintainer: extensions/lib note, npm test, releases section
2026-07-16 13:51:56 +03:00
3f987cecc5 feat(release): install channels (stable/beta) + RELEASING/CHANGELOG
- install.sh installs a moving channel ref: git:...@stable by default, PI_KIT_CHANNEL=beta|vX.Y.Z to override; pi update follows the channel
- cheat sheet shows channel + new commands (/kit-doctor, /kit-help)
- RELEASING.md: channel/tag release + rollback process; CHANGELOG.md (Keep a Changelog)
- supersedes earlier 'no ref = latest' for controlled rollout

Verified: install.sh syntax + channel resolution (stable default, beta/tag override).
2026-07-16 13:50:27 +03:00
5f8f5e8bf9 feat(dx): /kit-doctor and /kit-help commands
- /kit-doctor: environment health check (node, kit version/channel, config source+values, env vars presence, env.sh, loaded command/skill counts) with pass/warn summary; read-only, offline-safe
- /kit-help: catalog of package commands + skills (filtered to package path) + static guardrail list

Verified live via pi RPC: both commands register and render.
2026-07-16 13:48:31 +03:00
7e50043984 feat(security): secret-scanner, commit-guard, llm-redaction, audit-log
- lib/secrets.ts: shared SECRET_PATTERNS + scanSecrets/redact (AWS/GitLab/GitHub/Slack tokens, private keys, JWT, generic credentials)
- lib/audit.ts: local JSONL audit (~/.config/pi-kit/audit.jsonl, 600), optional PI_KIT_AUDIT_URL POST; never logs secret values
- secret-scanner: block write/edit whose content matches a secret (complements protected-paths)
- commit-guard: enforce Conventional Commits on 'git commit -m' + scan message for secrets
- llm-redaction: redact secrets from outbound payload via before_provider_request
- audit-log: session_start + slash-command usage; wires company.json auditEndpoint into env
- config: auditEndpoint (null); package.json: npm test; test/guardrails.test.ts (16 cases, all pass)

Verified: all extensions load via pi (lib/ not loaded as extensions); npm test green.
2026-07-16 13:46:22 +03:00
295f620710 Merge feature branches: company-config, interactive-env-setup, skill-conventions, permission-gate deploy-ref guards 2026-07-16 13:31:22 +03:00
e04a2ddb72 docs(skills): fill language standards with industry defaults
Per decision to use common industry practice now and tune later:
- structures: standard layouts (go cmd/internal/pkg, python src-layout, rust cargo, ts pnpm workspaces, kotlin Gradle modules, swift SwiftPM)
- linters: default rulesets (golangci base, clippy -D warnings, ruff+mypy, typescript-eslint+prettier, ktlint+detekt, swiftlint+swiftformat)
- test runners: TS=vitest; coverage soft targets (~70-80%) marked '(пороги уточним)'
- swift deps: SwiftPM (Package.resolved), CocoaPods legacy-only
- reworded intros: values are industry defaults to be tuned, no raw TODO markers left

Verified: no TODO markers remain in *-standards; all six skills load via pi.
2026-07-16 13:25:18 +03:00
489a63be69 docs(skills): set Python=uv and TypeScript=pnpm
- python-standards: uv (uv sync/add, uv.lock committed, run via 'uv run …')
- typescript-standards: pnpm (pnpm install/build/test, pnpm-lock.yaml committed)
- test runner still TODO (vitest/jest)
2026-07-16 13:16:36 +03:00
6521d9c431 fix(permission-gate): guard release-* branch and v* tag pushes (deploy convention)
Deploy convention at M.Video: a release-* branch push deploys to stage and a
v* tag push deploys to PROD. The old guard only matched release/* (slash) and
never caught tag pushes, so a prod deploy could run unconfirmed.

- permission-gate: match main/master, release-[-/], --tags/--follow-tags, and
  whitespace-preceded v<digit> tags; false-positive-safe (space discriminator)
- create-mr.sh: refuse source branch release-* (not just release/*)
- jira-workflow doc updated to release-*

Verified with a behavioral test suite (10 cases incl. v2, false-positive checks).
2026-07-16 13:13:35 +03:00
c2cdf40cad docs(skills): fill cross-cutting Git/Jira conventions
- commit format: Conventional Commits (all six *-standards)
- branches/deploy: feature branches from main; release-* -> stage, tag v* -> prod (all six *-standards)
- jira-workflow: statuses To Do -> In Progress -> Review -> Done; who moves status when; MR link + status transition policy; comment guidance
- key-prefix list stays TODO (unknown project prefixes)

Verified: no leftover commit-format TODOs, deploy convention in all 6, skills still load via pi.
2026-07-16 13:10:34 +03:00
e6903f8b13 config: set company URLs (gitHost, tracker, docs)
- gitHost: gitlab.tech.mvideo.ru (где живёт код компании)
- trackerUrl: https://jira.mvideo.ru
- docsUrl: https://wiki.mvideo.ru (Confluence)
- repoMap остаётся TODO

Verified: /kit-config reflects the new values (source: local).
2026-07-16 13:03:03 +03:00
a6a4d4fee3 feat(install): interactive environment setup (URLs + secrets)
- prompt TRACKER_URL (visible, current value as default) and JIRA_TOKEN/GITLAB_TOKEN/provider key (hidden read -rs, never echoed) via /dev/tty (works under curl|bash)
- persist to ~/.config/pi-kit/env.sh (umask 077 => chmod 600), sourced from shell rc via idempotent managed block
- ask provider key only if none already set; empty input keeps existing value; re-runs load stored values as defaults
- non-interactive / PI_KIT_SETUP_ENV=0 falls back to printed guidance
- README documents the flow, env.sh, and the skip switch

Unit-tested: single-quote escaping round-trip, 600 perms, empty-value omission, rc-block idempotency.
2026-07-16 12:56:35 +03:00
e98e4ca9ae feat(skills): add kotlin-standards + swift-standards for mobile profile
- kotlin-standards: gradle build/test, ktlint/detekt, Android lint; company specifics TODO
- swift-standards: SwiftPM/xcodebuild, swiftformat/swiftlint, XCTest; company specifics TODO
- wire mobile profile -> kotlin+swift; 'all' now includes both; README matrix updated
- verified all six *-standards skills load via pi RPC
2026-07-16 12:31:12 +03:00
fbf10b0521 feat(install): profile-based skill gating + public skills
- prompt for profile (frontend/backend/qa/mobile) via /dev/tty (works under curl|bash); PI_KIT_PROFILE env fallback
- gate bundled skills per profile by rewriting the pi-kit entry in settings.json to object-form {source, skills:[...]}; prompts/extensions stay ungated
- install common public skills for everyone (grill-me, grill-with-docs, code-review, diagnosing-bugs from mattpocock/skills) and profile-specific (frontend-design from anthropics/skills) via npx skills add --global
- README: profiles table + gating mechanism for maintainers

Verified: gating logic (string->object, idempotent, other packages preserved), live backend-profile load via RPC (ts excluded, prompts intact), npx skills add --global lands in ~/.agents/skills without cwd pollution, all 4 common skills exist in mattpocock/skills (diagnose is 'diagnosing-bugs').
2026-07-16 12:15:07 +03:00
7fc7d79815 feat(skills): add rust-standards, typescript-standards, python-standards
- mirror go-standards: structure, linters/formatters, tests, commits/MR, pre-MR checklist
- ecosystem defaults (clippy/rustfmt, eslint/prettier/tsc, ruff/mypy/pytest); company specifics marked TODO
- verified all four *-standards skills load via pi RPC get_commands
2026-07-16 11:54:29 +03:00
7fc16777a6 feat(jira-workflow): add GitLab create-mr.sh helper
- creates a merge request via GitLab API (curl + GITLAB_TOKEN, PRIVATE-TOKEN header)
- derives host + project path from git remote origin (or GITLAB_HOST); no hardcoded URLs
- refuses to open an MR from a protected source branch; MR_PUSH/MR_DRY_RUN toggles
- optionally attaches the MR link to a Jira ticket via link-mr.sh
- verified parsing for ssh (scp-form) and https remotes incl. nested namespaces
2026-07-16 11:34:55 +03:00
bc4ceb100d fix(install): make provider check provider-agnostic
Engineers use different LLM providers (Anthropic/OpenAI/OpenRouter/...); the
package does not pin a provider or model. install.sh now accepts any known
provider key and README states provider-agnosticism explicitly.
2026-07-16 11:28:12 +03:00
640e1da3c6 fix(extensions): avoid premature block-comment close; mark package as ESM
- protected-paths.ts: reword comment that contained a globstar+slash sequence which closed the /** */ block early (caused a ParseError at load)
- package.json: add "type": "module" (extensions are ESM)

Verified locally: pi install ./, all 5 commands + 4 skills load via RPC get_commands, /kit-config prints values+source, dynamic config change reflected, protected-paths + permission-gate pass a behavioral test suite.
2026-07-16 11:19:12 +03:00
36df885b32 docs: add README for employees and maintainers (in Russian)
- employee: one-command install, update, command table, skills, guardrails
- maintainer: package layout, single-file config + remoteConfigUrl, how to add skill/prompt/extension, MR-only supply-chain rule, local verification
2026-07-16 11:14:54 +03:00
927010e4bf feat: add idempotent install.sh bootstrap script
- checks Node >= 20, installs Pi if missing, runs pi install with PI_KIT_REPO (single source of the repo address, no version ref)
- verifies API key env var (Anthropic/proxy TODO), prints where to get it
- prints cheat sheet: run, update, commands, internal course link (TODO)
2026-07-16 11:00:47 +03:00
75e9bf85ba feat(extensions): protected-paths, permission-gate, company-context
- protected-paths: glob-based block of write/edit to secrets/keys/.git/prod configs
- permission-gate: confirm dangerous bash (rm -rf, force push, push to protected branch, prod kubectl, docker prune, sudo)
- company-context: loads config/company.json (+ optional remoteConfigUrl w/ 2.5s timeout), injects corporate context via before_agent_start, registers /kit-config
- config path resolved via import.meta.url, not cwd; text template in company-context.md
2026-07-16 11:00:09 +03:00
0725b6b034 feat(skills): add jira-workflow, repo-map, docs-map, go-standards
- descriptions state WHEN each skill applies
- jira-workflow ships curl scripts reading TRACKER_URL/JIRA_TOKEN from env, no hardcoded secrets/URLs
- repo-map/docs-map defer values to session corporate context; company specifics left as TODO
- go-standards uses realistic Go defaults, company-specific bits marked TODO
2026-07-16 10:57:00 +03:00
fe99b404fa feat(prompts): add /bugfix, /feature, /review, /rfc command templates
- Pi-native $ARGUMENTS placeholders (not {{}})
- reference skills and session corporate context; no hardcoded URLs
- feature.md stops for plan approval; rfc.md carries a TODO to match internal template
2026-07-16 10:55:10 +03:00
76b3d71340 chore: add package manifest, config source-of-truth and tsconfig
- package.json with pi section (extensions/skills/prompts) and Pi libs as peerDependencies (*)
- config/company.json as the single source of truth (values are TODO, gitHost set)
- tsconfig.json for optional local typecheck
2026-07-16 10:53:55 +03:00