<PAGE>

                                                                    EXHIBIT 4(p)

                                                                  EXECUTION COPY

                          AMENDED AND RESTATED GUARANTY

                  THIS AMENDED AND RESTATED GUARANTY (this "GUARANTY"), dated as
of December 8, 2003, is made by CMS Gas Transmission Company, a Michigan
corporation, and CMS Generation Co., a Michigan corporation (together with its
permitted successors and assigns under the Credit Agreement, each individually a
"GUARANTOR" and collectively, together with any additional Subsidiaries of the
Company (as defined below) that become a party to this Guaranty by executing a
supplement hereto in the form attached hereto as Annex I, the "GUARANTORS"), in
favor of the Lenders (the "LENDERS") parties to the Credit Agreement (as defined
below) and Citicorp USA, Inc. ("CUSA"), as Collateral Agent (the "COLLATERAL
AGENT") for the Lenders.

                             PRELIMINARY STATEMENTS

         (1)      Barclays Bank PLC, as administrative agent, the Collateral
Agent and the lenders named therein were parties to two Amended and Restated
Credit Agreements, each dated as of July 12, 2002, one (as amended, restated,
supplemented or otherwise modified from time to time, the "SHORT TERM CREDIT
AGREEMENT") maturing March 31, 2003 and the other (as amended, restated,
supplemented or otherwise modified prior to September 12, 2003, the "LONG TERM
CREDIT AGREEMENT") maturing December 15, 2003, with CMS Energy Corporation, a
corporation organized and existing under the laws of the State of Michigan (the
"COMPANY").

         (2)      The Guarantors entered into that certain Guaranty, dated as of
July 12, 2002 (as amended or supplemented prior to the date hereof, the
"EXISTING GUARANTY"), in favor of such lenders and the Collateral Agent with
respect to the obligations of the Company under the Short Term Credit Agreement
and the Long Term Credit Agreement.

         (3)      The obligations of the Company under the Short Term Credit
Agreement have been paid in full prior to the date hereof.

         (4)      CUSA, as administrative agent (in such capacity, the
"ADMINISTRATIVE AGENT"), the Collateral Agent, the Lenders and the Company
amended and restated the Long Term Credit Agreement pursuant to that certain
Third Amended and Restated Credit Agreement, dated as of September 12, 2003 (as
amended prior to the date hereof, the "EXISTING CREDIT AGREEMENT").

         (5)      The Administrative Agent, the Collateral Agent, the Lenders,
the Company and CMS Enterprises Company, a Michigan corporation ("ENTERPRISES"
and, collectively with the Company, the "BORROWERS"), have agreed to amend and
restate the Existing Credit Agreement pursuant to that certain Fourth Amended
and Restated Credit Agreement, dated as of the date hereof (as amended,
restated, supplemented or otherwise modified from time to time, the "CREDIT

<PAGE>

AGREEMENT"; the terms defined therein and not otherwise defined herein being
used herein as therein defined).

         (7)      The Guarantors will derive substantial direct and indirect
benefit from the transactions contemplated by the Credit Agreement.

         (8)      Is the intention of the parties hereto that this Guaranty be
merely an amendment and restatement of the Existing Guaranty and not constitute
a novation of the obligations thereunder.

         (9)      It is a condition precedent to the effectiveness of the Credit
Agreement that the Guarantors shall have executed and delivered this Guaranty.

                  NOW, THEREFORE, in consideration of the premises and in order
to induce the Lenders to make Extensions of Credit under the Credit Agreement,
the Guarantors hereby agree that the Existing Guaranty is amended and restated
in its entirety as follows:

         SECTION 1. Guaranty. Each of the Guarantors hereby unconditionally
guarantees, jointly with the other Guarantors and severally, the punctual
payment when due, whether at stated maturity, by acceleration or otherwise, of
all obligations of the Borrowers now or hereafter existing under the Credit
Agreements and the Promissory Notes, whether for principal, interest, fees,
expenses or otherwise (such obligations being the "OBLIGATIONS"), and agrees to
pay any and all expenses (including reasonable fees and expenses of counsel)
incurred by the Agents or the Lenders in enforcing any rights under this
Guaranty. Without limiting the generality of the foregoing, the Guarantor's
liability shall extend to all amounts which constitute part of the Obligations
and would be owed by any Borrower to the Collateral Agent, the Administrative
Agent or the Lenders under the Credit Agreement and the Promissory Notes but for
the fact that they are unenforceable or not allowable due to the existence of a
bankruptcy, reorganization or similar proceeding involving such Borrower.

         SECTION 2. Guaranty Absolute. Each of the Guarantors guarantee, jointly
with the other Guarantors and severally, that the Obligations will be paid
strictly in accordance with the terms of the Credit Agreement and the Promissory
Notes, regardless of any law, regulation or order now or hereafter in effect in
any jurisdiction affecting any of such terms or the rights of the Collateral
Agent, the Administrative Agent or the Lenders with respect thereto against the
Borrowers. The obligations of the Guarantors under this Guaranty are independent
of the Obligations, and a separate action or actions may be brought and
prosecuted against any or all of the Guarantors to enforce this Guaranty,
irrespective of whether any action is brought against either Borrower or whether
either Borrower is joined in any such action or actions. The liability of each
of the Guarantors under this Guaranty shall be absolute and unconditional
irrespective of:

         (a)      any lack of validity or enforceability of the Credit
Agreement, the Promissory Notes, any other Loan Document, or any other agreement
or instrument relating thereto;

         (b)      any change in the time, manner or place of payment of, or in
any other term of, all or any of the Obligations, or any other amendment or
waiver of or any consent to departure from the Credit Agreement, the Promissory
Notes, or any other Loan Document, including, without

                                       2

<PAGE>

limitation, any increase in the Obligations resulting from the extension of
additional credit to any Borrower or any of the Borrowers' Subsidiaries or
otherwise;

         (c)      any taking, exchange, release or non-perfection of any
collateral, or any taking, release or amendment or waiver of or consent to
departure from any other guaranty, for all or any of the Obligations;

         (d)      the existence of any claim, set-off, defense or other right
which any of the Guarantors may have at any time against the Collateral Agent,
the Administrative Agent, any Lender or any other Person, whether in connection
with this Guaranty, the transactions contemplated in any of the other Loan
Documents, or any unrelated transaction;

         (e)      any manner of application of collateral, or proceeds thereof,
to all or any of the Obligations, or any manner of sale or other disposition of
any collateral for all or any of the Obligations or any other assets of any
Borrower or any of the Borrowers' Subsidiaries;

         (f)      any change, restructuring or termination of the corporate
structure or existence of any Borrower or any of the Borrowers' Subsidiaries; or

         (g)      any other circumstance which might otherwise constitute a
defense available to, or a discharge of, either Borrower or a guarantor.

         This Guaranty shall continue to be effective or be reinstated, as the
case may be, if at any time any payment of any of the Obligations is rescinded
or must otherwise be returned by the Collateral Agent, the Administrative Agent
or any Lender upon the insolvency, bankruptcy or reorganization of either
Borrower or otherwise, all as though such payment had not been made.

         SECTION 3. Rights of Contribution with Respect to Obligations.

         (a)      To the extent that any payment is made on the Obligations by
or on behalf of any Guarantor or Grantor (each, an "OBLIGOR") under or pursuant
to this Guaranty or any Pledge Agreement (an "OBLIGOR PAYMENT") which, taking
into account all other Obligor Payments then previously or concurrently made by
any other Obligor, exceeds the amount which otherwise would have been paid by or
attributable to such Obligor if each Obligor had paid the aggregate Obligations
satisfied by such Obligor Payment in the same proportion as such Obligor's
"Allocable Amount" (as defined below) (as determined immediately prior to such
Obligor Payment) bore to the aggregate Allocable Amounts of each of the Obligors
as determined immediately prior to the making of such Obligor Payment, then,
following payment in full in cash of the Obligations and the termination or
expiration of all Commitments, such Obligor shall be entitled to receive
contribution and indemnification payments from, and be reimbursed by, each other
Obligor for the amount of such excess, pro rata based upon their respective
Allocable Amounts in effect immediately prior to such Obligor Payment.

         (b)      As of any date of determination, the "ALLOCABLE AMOUNT" of any
Obligor shall be equal to the maximum amount of the claim which could then be
recovered from such Obligor with respect to the Obligations without rendering
such claim voidable or avoidable under Section 548 of Chapter 11 of the
Bankruptcy Code or under any applicable state Uniform Fraudulent Transfer Act,
Uniform Fraudulent Conveyance Act or similar statute or common law.

                                       3
<PAGE>

         (c)      This Section 3 is intended only to define the relative rights
of the Obligors, and nothing set forth in this Section 3 is intended to or shall
impair the obligations of the Obligors to pay any amounts as and when the same
shall become due and payable in accordance with the terms of this Guaranty or
any Pledge Agreement.

         (d)      The parties hereto acknowledge that the rights of contribution
and indemnification hereunder shall constitute assets of the Guarantors and the
other Obligors to which such contribution and indemnification is owing.

         (e)      The rights of the indemnifying Obligors against other Obligors
with respect to any payments on the Obligations shall be exercisable upon the
full payment of the Obligations in cash and the termination or expiry of the
Commitments.

         SECTION 4. Waiver. Each of the Guarantors hereby waives promptness,
diligence, notice of acceptance and any other notice with respect to any of the
Obligations and this Guaranty and any requirement that the Collateral Agent, the
Administrative Agent or any Lender protect, secure, perfect or insure any
security interest or lien or any property subject thereto or exhaust any right
or take any action against either Borrower or any other Person or any
collateral.

         SECTION 5. Subrogation; Subordination of Intercompany Indebtedness.

         (a)      Subrogation. Notwithstanding any payment or payments made by
any Guarantor hereunder, or any setoff or application of funds of any Guarantor
by the Collateral Agent, the Administrative Agent or any Lender, each Guarantor
hereby irrevocably waives any and all rights of subrogation to the rights of the
Collateral Agent, the Administrative Agent and the Lenders against the Borrowers
and any and all rights of reimbursement, assignment, indemnification or implied
contract or any similar rights against the Borrowers or against any endorser or
other guarantor of all or any part of the Obligations until the Lenders' claims
with respect to the Obligations have been paid in full and the Commitments
terminated. If, notwithstanding the foregoing, any amount shall be paid to any
Guarantor on account of such subrogation rights at any time when all of the
Obligations shall not have been paid in full, such amount shall be held by such
Guarantor in trust for the Collateral Agent, the Administrative Agent and the
Lenders, segregated from other funds of such Guarantor, and shall, forthwith
upon receipt by such Guarantor, be turned over to the Collateral Agent in the
exact form received by such Guarantor (duly endorsed by such Guarantor to the
Collateral Agent), to be applied against the Obligations, whether matured or
unmatured.

         (b)      Subordination of Intercompany Indebtedness. Each Guarantor
agrees that any and all claims of any Guarantor against any other Loan Party
with respect to any "Intercompany Indebtedness" (as hereinafter defined), any
endorser, obligor or any other guarantor of all or any part of the Obligations,
or against any of its properties shall be subordinate and subject in right of
payment to the prior payment, in full and in cash, of all Obligations; provided,
that, for the avoidance of doubt, so long as no Event of Default shall be
continuing, each Guarantor may make loans to and receive payments in the
ordinary course with respect to Intercompany Indebtedness (as hereinafter
defined) from any other Loan Party to the extent not prohibited by the terms of
the Credit Agreement and the other Loan Documents. If all or any part of the
assets

                                       4
<PAGE>

of any Loan Party, or the proceeds thereof, are subject to any distribution,
division or application to the creditors of such Loan Party, whether partial or
complete, voluntary or involuntary, and whether by reason of liquidation,
bankruptcy, arrangement, receivership, assignment for the benefit of creditors
or any other action or proceeding, or if the business of any such Loan Party is
dissolved or if substantially all of the assets of any such Loan Party are sold,
then, and in any such event (such events being herein referred to as an
"INSOLVENCY EVENT"), any payment or distribution of any kind or character,
either in cash, securities or other property, which shall be payable or
deliverable upon or with respect to any indebtedness of any Loan Party to any
Guarantor ("INTERCOMPANY INDEBTEDNESS") shall be paid or delivered directly to
the Collateral Agent for application to the Obligations, whether matured or
unmatured. Should any payment, distribution, security or instrument or proceeds
thereof be received by any Guarantor upon or with respect to the Intercompany
Indebtedness after any Insolvency Event and prior to the satisfaction of all of
the Obligations and the termination or expiration of all Commitments of the
Lenders, such Guarantor shall receive and hold the same in trust, as trustee,
for the benefit of the Lenders and shall forthwith deliver the same to the
Collateral Agent, for the benefit of the Collateral Agent, the Administrative
Agent and the Lenders, in precisely the form received (except for the
endorsement or assignment of such Guarantor where necessary), for application to
the Obligations, whether matured or unmatured, and, until so delivered, the same
shall be held in trust by such Guarantor as the property of the Lenders.

         SECTION 6. Representations and Warranties. Each Guarantor hereby
represents and warrants as follows:

         (a)      Such Guarantor is a corporation, limited liability company or
limited partnership, as applicable, duly organized, validly existing and in good
standing under the laws of the state of its organization and is duly qualified
to do business in, and is in good standing in, all other jurisdictions where the
nature of its business or the nature of property owned or used by it makes such
qualification necessary.

         (b)      The execution, delivery and performance by such Guarantor of
this Guaranty (i) are within such Guarantor's powers, (ii) have been duly
authorized by all necessary corporate or other organizational action or
proceedings and (iii) do not and will not (A) require any consent or approval of
the stockholders (or other applicable holder of equity) of such Guarantor (other
than such consents and approvals which have been obtained and are in full force
and effect), (B) violate any provision of the charter or by-laws (or other
comparable constitutive documents) of such Guarantor or of law, (C) violate any
legal restriction binding on or affecting such Guarantor, (D) result in a breach
of, or constitute a default under, any indenture or loan or credit agreement or
any other agreement, lease or instrument to which such Guarantor is a party or
by which it or its properties may be bound or affected, or (E) result in or
require the creation of any Lien (other than pursuant to the Loan Documents).

         (c)      This Guaranty constitutes the legal, valid and binding
obligation of such Guarantor enforceable against such Guarantor in accordance
with its terms; subject to the qualification, however, that the enforcement of
the rights and remedies herein is subject to bankruptcy and other similar laws
of general application affecting rights and remedies of creditors and the
application of general principles of equity (regardless of whether considered in
a proceeding in equity or at law).

                                       5
<PAGE>

         (d)      No authorization or approval or other action by, and no notice
to or filing with, any governmental authority or regulatory body is required for
the due execution, delivery and performance by such Guarantor of this Guaranty.

         SECTION 7. Amendments, Etc. No amendment or waiver of any provision of
this Guaranty, and no consent to any departure by any Guarantor herefrom, shall
in any event be effective unless the same shall be in writing and signed by the
Collateral Agent and, in the case of amendments, the Guarantors, and then such
waiver or consent shall be effective only in the specific instance and for the
specific purpose for which given, provided, however, that no amendment, waiver
or consent shall, unless in writing and signed by all the Lenders, (a) limit the
liability of any Guarantor hereunder, (b) postpone any date fixed for payment
hereunder, or (c) change the number of Lenders required to take any action
hereunder.

         SECTION 8. Addresses for Notices. All notices and other communications
provided for hereunder shall be in writing (including facsimile communication)
and mailed, telecopied or delivered, if to a Guarantor, to its address at One
Energy Plaza, Jackson, Michigan 49201, Attention: General Counsel, and if to the
Collateral Agent, the Administrative Agent or any Lender, at its address
specified in the Credit Agreement, or, as to any party, at such other address as
shall be designated by such party in a written notice to each other party. All
such notices and other communications shall, when mailed, be effective five days
after when deposited in the mails, or when telecopied or delivered.

         SECTION 9. No Waiver; Remedies. No failure on the part of the
Collateral Agent, the Administrative Agent or any Lender to exercise, and no
delay in exercising, any right hereunder shall operate as a waiver thereof; nor
shall any single or partial exercise of any right hereunder preclude any other
or further exercise thereof or the exercise of any other right. The remedies
herein provided are cumulative and not exclusive of any remedies provided by
law.

         SECTION 10. Right of Set-off. Upon (i) the occurrence and during the
continuance of any Event of Default under the Credit Agreement and (ii) the
declaration that the Obligations shall become and be forthwith due and payable
or the automatic acceleration of the Obligations, in either case pursuant to
Section 8.02 of the Credit Agreement, each Lender is hereby authorized at any
time and from time to time, to the fullest extent permitted by law, to set off
and apply any and all deposits (general or special, time or demand, provisional
or final) at any time held and other indebtedness at any time owing by such
Lender to or for the credit or the account of the applicable Guarantor against
any and all of the obligations of such Guarantor now or hereafter existing under
this Guaranty, whether or not such Lender shall have made any demand under this
Guaranty and although such obligations may be contingent and unmatured. Each
Lender agrees to notify promptly such Guarantor after any such set-off and
application made by such Lender, provided that the failure to give such notice
shall not affect the validity of such set-off and application. The rights of
each Lender under this Section 10 are in addition to other rights and remedies
(including, without limitation, other rights of set-off) which such Lender may
have.

         SECTION 11. Continuing Guaranty; Assignments under Credit Agreement.
This Guaranty is a continuing guaranty and shall (i) remain in full force and
effect until the later of (x) the payment in full of the Obligations and all
other amounts payable under this Guaranty and (y)

                                       6
<PAGE>

the expiration or termination of the Commitments, (ii) be binding upon each
Guarantor, its successors and assigns, and (iii) inure to the benefit of, and be
enforceable by, the Collateral Agent, the Administrative Agent, the Lenders and
their respective successors, transferees and assigns. Notwithstanding the
foregoing, if all or substantially all of the assets of any Guarantor or 100% of
the stock of any Guarantor is sold in a transaction permitted under the Credit
Agreement, such Guarantor shall automatically be released from its obligations
under this Guaranty. Without limiting the generality of the foregoing clause
(iii), any Lender may assign or otherwise transfer all or any portion of its
rights and obligations under the Credit Agreement (including, without
limitation, all or any portion of its Commitment, the Loans owing to it and any
Promissory Note held by it) to any other Person, and such other Person shall
thereupon become vested with all the benefits in respect thereof granted to such
Lender herein or otherwise subject, however, to the provisions of Sections 9.04
and 10.07 of the Credit Agreement.

         SECTION 12. Waiver of Jury Trial. EACH OF THE GUARANTORS AND THE
COLLATERAL AGENT HEREBY IRREVOCABLY WAIVES ALL RIGHT TO TRIAL BY JURY IN ANY
ACTION, PROCEEDING OR COUNTERCLAIM ARISING OUT OF OR RELATING TO THIS GUARANTY
OR ANY OTHER LOAN DOCUMENT, OR ANY OTHER INSTRUMENT OR DOCUMENT DELIVERED
HEREUNDER OR THEREUNDER.

         SECTION 13. Governing Law; Submission to Jurisdiction. THIS GUARANTY
SHALL BE GOVERNED BY, AND CONSTRUED IN ACCORDANCE WITH, THE LAWS OF THE STATE OF
NEW YORK (INCLUDING SECTION 5-1401 OF THE GENERAL OBLIGATIONS LAWS OF THE STATE
OF NEW YORK, BUT OTHERWISE WITHOUT REGARD TO CONFLICTS OF LAW PRINCIPLES). EACH
OF THE GUARANTORS AND THE COLLATERAL AGENT (I) IRREVOCABLY SUBMITS TO THE
JURISDICTION OF ANY NEW YORK STATE COURT OR FEDERAL COURT SITTING IN NEW YORK
CITY IN ANY ACTION ARISING OUT OF ANY LOAN DOCUMENT, (II) AGREES THAT ALL CLAIMS
IN SUCH ACTION MAY BE DECIDED IN SUCH COURT, (III) WAIVES, TO THE FULLEST EXTENT
IT MAY EFFECTIVELY DO SO, THE DEFENSE OF AN INCONVENIENT FORUM AND (IV) CONSENTS
TO THE SERVICE OF PROCESS BY MAIL. A FINAL JUDGMENT IN ANY SUCH ACTION SHALL BE
CONCLUSIVE AND MAY BE ENFORCED IN OTHER JURISDICTIONS. NOTHING HEREIN SHALL
AFFECT THE RIGHT OF ANY PARTY TO SERVE LEGAL PROCESS IN ANY MANNER PERMITTED BY
LAW OR AFFECT ITS RIGHT TO BRING ANY ACTION IN ANY OTHER COURT. EACH GUARANTOR
WAIVES ANY OBJECTION THAT IT MAY HAVE TO THE LOCATION OF THE COURT IN WHICH THE
COLLATERAL AGENT MAY COMMENCE A PROCEEDING DESCRIBED IN THIS SECTION.

         SECTION 14. no Novation. This Guaranty amends and restates in its
entirety the Existing Guaranty and this Guaranty is in no way intended to
constitute a novation of any obligations owed by the Guarantors to the
Collateral Agent under the Existing Guaranty.

                  [Remainder of page intentionally left blank.]

                                       7
<PAGE>

         IN WITNESS WHEREOF, each of the Guarantors has caused this Guaranty to
be duly executed and delivered by its officer thereunto duly authorized as of
the date first above written.

                                             CMS GAS TRANSMISSION COMPANY

                                             By /s/ LAURA L. MOUNTCASTLE
                                                --------------------------------
                                             Title: Vice President and Treasurer

                                             CMS GENERATION CO.

                                             By /s/ LAURA L. MOUNTCASTLE
                                                --------------------------------
                                             Title: Vice President and Treasurer

                                Signature Page to
                          Amended and Restated Guaranty

<PAGE>

Acknowledged and Agreed as of
the date first above written:

CITICORP USA, INC., as Collateral Agent

By /s/ DHAYA RANGANATHAN
   ---------------------------
Title: Vice President

                                Signature Page to
                          Amended and Restated Guaranty

<PAGE>

                                     ANNEX I
                                       TO
                          AMENDED AND RESTATED GUARANTY

         Reference is hereby made to the Amended and Restated Guaranty (the
"GUARANTY") made as of December 8, 2003 by and among CMS Gas Transmission
Company, a Michigan corporation, and CMS Generation Co., a Michigan corporation
(each a "GUARANTOR" and along with any additional Subsidiaries of the Borrower
that become parties to the Guaranty, including the undersigned by the execution
of this Annex I to Guaranty, the "GUARANTORS") in favor of the Collateral Agent
for the ratable benefits of the Lenders under the Credit Agreement. Capitalized
terms used herein and not defined herein shall have the meanings given to them
in the Guaranty. By its execution below, the undersigned [Name of New
Guarantor], a __________, agrees to become a Guarantor under the Guaranty and
agrees to be bound by such Guaranty as if originally a party thereto. By its
execution below, the undersigned represents and warrants as to itself that all
of the representations and warranties contained in the Guaranty are true and
correct as of the date hereof.

         In witness whereof [Name of New Guarantor], a ________, has executed
and delivered this ANNEX I counterpart to the Guaranty as of their _______,
_____.

                                                [Name of New Guarantor]

                                                By______________________________
                                                Title: